- Install cargo-contract:
- Follow https://github.com/paritytech/cargo-contract
cargo install cargo-contract --force --locked --version 3.0.1
- Install chain:
- Follow https://github.com/paritytech/substrate-contracts-node
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.27.0 --force --locked
- Run chain:
substrate-contracts-node --base-path=./node-data --rpc-port 9988
- Deploy contract:
cd deploy && ./dev.sh
Now, you can interact with the contract through the front or the Polkadot JS Apps.
Our current contract code uses ink! 4, but the contract that has been deployed and is in use on Shiden Network was built with ink! 3.
To deploy and test the ink! 3 contract locally, please follow these instructions:
- Prepare Rust: Change
rust-toolchain.toml
's channel tonightly-2023-01-01
- Install old chain:
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.24.0 --force --locked
- Run chain:
substrate-contracts-node --wc-port 9988
- Note that this chain can't use the same data (
--base-path
) with the latest chain.
- Note that this chain can't use the same data (
- Deploy pre-built contract:
cd deploy && npx ts-node ./202109210_init/script.ts local
- Update environment file: Edit
/common/js/src/envs/local.json
- Fill in
gameAddress
and specifyink
3
- Fill in