Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.57 KB

README.md

File metadata and controls

26 lines (20 loc) · 1.57 KB

Local development

  1. Install cargo-contract:
  2. Install chain:
  3. Run chain: substrate-contracts-node --base-path=./node-data --rpc-port 9988
  4. Deploy contract: cd deploy && ./dev.sh

Now, you can interact with the contract through the front or the Polkadot JS Apps.

ink! versions

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:

  1. Prepare Rust: Change rust-toolchain.toml's channel to nightly-2023-01-01
  2. Install old chain: cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.24.0 --force --locked
  3. Run chain: substrate-contracts-node --wc-port 9988
    • Note that this chain can't use the same data (--base-path) with the latest chain.
  4. Deploy pre-built contract: cd deploy && npx ts-node ./202109210_init/script.ts local
  5. Update environment file: Edit /common/js/src/envs/local.json
    • Fill in gameAddress and specify ink 3