Build & Deploy & Initialize
Last updated
Last updated
So far so good! We have implemented our smart contract and now we are ready to build, deploy, and create an instance of it.
Build Smart Contract
First, we need to build the smart contract into wasm format. Use the following command to do it. You can extract the schema and wasm compiled file into a new folder called βdistβ as we do in this example.
Deploy Smart Contract
Second, we need to deploy the wasm compiled smart contract to the testnet. Use the following command to do it. We have some good news for you! From now on you donβt have to run your own testnet node for deploying contracts. Essentially, using a public URL (node.testnet.concordium.com), you can connect to a testnet node and will be able to deploy/query nodes. For all operations in this tutorial, we are going to use the public gRPC endpoint that is provided by Concordium.
Please keep this in mind, for some use cases you might need to run your own local node as there could be some limitations of this one. If you need more info either check this link or connect with us from our support channel.
Initialize Smart Contract
Third, we need to create a new instance of this smart contract which will initialize our empty state that holds the assets and allow us to invoke all methods. Run the command below to create an instance of your deployed contract using the module reference.
Excellent. As a next step, letβs move to the following section.