Deploy locally on a Solochain
This guide will teach how to deploy your contract to a generic ink! compatible solochain
Make sure your contract builds.
For all available options run: pop build --help
When deploying a smart contract you need to know how much gas is needed so you can pay accordingly. More info on this topic can be found here:
To find an estimate of how much gas you will need, you can do a "dry-run" of the contract:
This will perform a dry-run via an RPC call to estimate the gas usage. It does not submit a transaction.
You can now see the estimate and make sure your account is properly funded with that amount.
We can now deploy the contract locally, meaning that we will upload and instantiate the contract.
It is also possible to only upload the contract and not instantiate by adding
--upload-only
Note: The contracts node will be running in the background of your machine. If at anytime you need to kill the process you can do the following:
Find the process ID by running the following command:
lsof -i :9944
Kill the process by running the
kill
command and passing in the ID of the process:
Your contract is now deployed! You can check in PolkadotJs Apps as well.
Technical Support
Create a question and tag it with "
pop
"Share the StackExchange question in our Pop Support Telegram channel
Last updated