ignite/cli

How can I depoly a smart contract on an Ignite built blockchain?

calibar opened this issue · 9 comments

Hello, I'm a beginner and very curious about creating and deploying a smart contract on an Ignite-built chain. Is there a detailed guide I can follow? I've noticed that CosmWasm is a module that enables smart contract deployment on Cosmos chains. I've created an issue on the Cosmos SDK GitHub to inquire about using and integrating CosmWasm with a Cosmos chain. They suggested using the Ignite CLI to scaffold an application chain with CosmWasm. Could you please help me with this?

Hi, you can scaffold a CosmWasm enabled chain using the ignite wasm app. Tutorials are coming soon, but the gist of it is the following:

ignite s chain myawesomechain
cd myawesomechain
ignite app install github.com/ignite/apps/wasm@wasm/v0.1.1
ignite wasm add
ignite chain build
ignite wasm config

Then you have a cosmwasm enabled chain to which upload contracts. How to develop and deploy contract is explained in depth here: https://book.cosmwasm.com

EDIT: fix typo in command.

Thank you very much for your help! However, Is it possible that the initialization command is 'ignite chain init' instead of 'ignite wasm init'? I'm asking because when I tried 'ignite wasm init', it told me that the wasm command only accepts 'add' and 'config' arguments.

My bad, it is indeed warm add

Hi, I got the following error while I was trying 'ignite wasm add'. It said that "Chain does not support wasm integration (CLI >= v28 and Cosmos SDK >= v0.50).". However, I am using ignite cli 28.2.0 and cosmos-sdk0.50.3.
wasm add response
Ignite   cosmos-sdk version info

Hi,

Yes you need to use Ignite v28.3.0

Hi, I have updated my Ignite to v28.3.0, the following screenshot is what I got. Does this mean that the Cosmwasm-embed ignite chain has been successfully built?
28 3 execution result

Hi, Thank you very much for your help and patience. Regarding deploying contracts, I still have some questions. I briefly went through the Cosmwasm Book and found that it doesn't provide details on deploying contracts. For example, if I use Rust and Wasm to generate a contract called mycontract.wasm, how can I deploy mycontract.wasm to the CosmWasm-embed Ignite chain that I just built? And how can I execute it after the deployment?

Hi, I have updated my Ignite to v28.3.0, the following screenshot is what I got. Does this mean that the Cosmwasm-embed ignite chain has been successfully built? 28 3 execution result

Correct, your ignite chain has now cosmwasm.

Hi, Thank you very much for your help and patience. Regarding deploying contracts, I still have some questions. I briefly went through the Cosmwasm Book and found that it doesn't provide details on deploying contracts. For example, if I use Rust and Wasm to generate a contract called mycontract.wasm, how can I deploy mycontract.wasm to the CosmWasm-embed Ignite chain that I just built? And how can I execute it after the deployment?

Here you can find most of the command you need: https://docs.cosmwasm.com/docs/getting-started/interact-with-contract/#go-cli.