cargo contract build --release
yourplayer
andgame
contract- Upload
player
andgame
- Call
game.register_player
- Call
game.start_game
- Open https://splash.use.ink
- Call
game.submit_turn
use ink::env::{
DefaultEnvironment,
call::{build_call, Selector, ExecutionInput},
};
let board: (u32, u32) = build_call::<DefaultEnvironment>()
.call(game_addr)
.exec_input(
ExecutionInput::new(Selector::new(0xf10dee95_u32.to_be_bytes()))
)
.returns::<(u32, u32)>()
.invoke();
The documentation of build_call
contains more details.
export CONTRACT=5E123… # your player contract address
cargo contract call\
--url wss://contracts.theissen.io\
--suri "$SURI"\
--skip-dry-run\
--gas 300000000000\
--proof-size 512000\
--contract "$GAME"\
--message register_player\
--args "$CONTRACT" \"playername\"\
--skip-confirm\
game-metadata.json
export SURI="your twelve words"
export GAME=5E123… # your game contract address
cargo contract call\
--url wss://rococo-contracts-rpc.polkadot.io\
--suri "$SURI"\
--contract $GAME\
--message "start_game"\
--skip-confirm\
game-metadata.json
export SURI="your twelve words"
export GAME=5E123… # your game contract address
cargo contract call\
--url wss://rococo-contracts-rpc.polkadot.io\
--suri "$SURI"\
--contract $GAME\
--message "submit_turn"\
--skip-dry-run\
--gas 300000000000\
--proof-size 912000\
--skip-confirm\
game-metadata.json
export SURI="your twelve words"
export GAME=5E123… # your game contract address
cargo contract call\
--url wss://rococo-contracts-rpc.polkadot.io\
--contract $GAME\
--message "gas_limit"\
--dry-run game-metadata.json\
game-metadata.json