-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cli calls to play connectfour #22
Conversation
b496de5
to
c2f66c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine only a question on the coulumn numbers
app-libs/stf/src/cli.rs
Outdated
.takes_value(true) | ||
.required(true) | ||
.value_name("u8") | ||
.help("play stone in column, must be in the range of [0,7]"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are 7 columns: range [0,6]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. I see. Then the check in the connect four is not appropriate: https://github.com/ajuna-network/ajuna-node/blob/update-substrate-5/pallets/ajuna-connectfour/src/lib.rs#L288
Should be [1, 7] then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks for the review!
app-libs/stf/src/cli.rs
Outdated
.parse() | ||
.expect("amount can be converted to u8"); | ||
|
||
if column >= 8 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6?
app-libs/stf/src/cli.rs
Outdated
.expect("amount can be converted to u8"); | ||
|
||
if column >= 8 { | ||
panic!("Game only allows columns smaller then 8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great
* point sgx-runtime to ajuna-network at polkadot-v0.9.20 * change integritee-node -> Ajuna Also point `teerex-primitives` crate to polkadot-v0.9.20 branch, which is a required dep for Ajuna pegged at polkadot-v0.9.20. * detect new game Cherry-pick: 0b5e0bf * Add QueueGame cli call (#19) Cherry-pick: 26316ff * Add PlayTurn and GetBoard cli trusted calls to play connectfour (#22) Cherry-pick: ef9d233 * Create and send signed ack_game extrinsic (#7) * send extrinsic ack_game. * add Shard Identifier to Extrinsic Cherry-pick: ca24498 Co-authored-by: Gaudenz Kessler <[email protected]> * Detect ack_game extrinsic (#8) Cherry-pick: f5c3e43 Co-authored-by: Gaudenz Kessler <[email protected]> * Create a new connectfour game in the sgx runtime * fix game iteration * pretty print board games * add demo script * improve logging * rename last turn to block number Cherry-pick: 8360808 Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: haerdib <[email protected]> * Connect four demo with 2 workers * increase sleep time for demo * connect-four demo with 2 workers start workers with python script: python local-setup/launch.py local-setup/simple-config.json start demo-script in cli/: ./demo_connect_four_two_workers.sh -p 9985 -A 2090 -B 3090 -m file Cherry-pick: 00f336e Co-authored-by: Gaudenz Kessler <[email protected]> * Update sgxruntime and wasm builder (#32, #34) * update sgx-runtime * wasm-builder Cherry-pick: 74ff735, 24e2f2d Co-authored-by: Gaudenz Kessler <[email protected]> * rebase to latest master Cherry-pick: ed9e4c6 * integrate runner (#42) * remove obsolete GameEngine * add and use GameId type * add Runner storage * simplify RegistryStorageKeys trait * create new games from RunnerState:Queued * trigger CI against main * update CI to use Ajuna node * add node-url arg for the demo script * update `Cargo.lock` and patch * We would expect the runner to be Accepted Co-authored-by: Eric <[email protected]> Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: haerdib <[email protected]> Co-authored-by: gaudenzkessler <[email protected]> Co-authored-by: Andy Bell <[email protected]>
* point sgx-runtime to ajuna-network at polkadot-v0.9.20 * change integritee-node -> Ajuna Also point `teerex-primitives` crate to polkadot-v0.9.20 branch, which is a required dep for Ajuna pegged at polkadot-v0.9.20. * detect new game Cherry-pick: 0b5e0bf * Add QueueGame cli call (#19) Cherry-pick: 26316ff * Add PlayTurn and GetBoard cli trusted calls to play connectfour (#22) Cherry-pick: ef9d233 * Create and send signed ack_game extrinsic (#7) * send extrinsic ack_game. * add Shard Identifier to Extrinsic Cherry-pick: ca24498 Co-authored-by: Gaudenz Kessler <[email protected]> * Detect ack_game extrinsic (#8) Cherry-pick: f5c3e43 Co-authored-by: Gaudenz Kessler <[email protected]> * Create a new connectfour game in the sgx runtime * fix game iteration * pretty print board games * add demo script * improve logging * rename last turn to block number Cherry-pick: 8360808 Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: haerdib <[email protected]> * Connect four demo with 2 workers * increase sleep time for demo * connect-four demo with 2 workers start workers with python script: python local-setup/launch.py local-setup/simple-config.json start demo-script in cli/: ./demo_connect_four_two_workers.sh -p 9985 -A 2090 -B 3090 -m file Cherry-pick: 00f336e Co-authored-by: Gaudenz Kessler <[email protected]> * Update sgxruntime and wasm builder (#32, #34) * update sgx-runtime * wasm-builder Cherry-pick: 74ff735, 24e2f2d Co-authored-by: Gaudenz Kessler <[email protected]> * rebase to latest master Cherry-pick: ed9e4c6 * integrate runner (#42) * remove obsolete GameEngine * add and use GameId type * add Runner storage * simplify RegistryStorageKeys trait * create new games from RunnerState:Queued * trigger CI against main * update CI to use Ajuna node * add node-url arg for the demo script * update `Cargo.lock` and patch * We would expect the runner to be Accepted Co-authored-by: Eric <[email protected]> Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: haerdib <[email protected]> Co-authored-by: gaudenzkessler <[email protected]> Co-authored-by: Andy Bell <[email protected]>
author Eric <[email protected]> 1655038720 +1200 committer haerdib <[email protected]> 1662130355 +0200 [PLAT-265] Rebase upstream (#44) * point sgx-runtime to ajuna-network at polkadot-v0.9.20 * change integritee-node -> Ajuna Also point `teerex-primitives` crate to polkadot-v0.9.20 branch, which is a required dep for Ajuna pegged at polkadot-v0.9.20. * detect new game Cherry-pick: 0b5e0bf * Add QueueGame cli call (#19) Cherry-pick: 26316ff * Add PlayTurn and GetBoard cli trusted calls to play connectfour (#22) Cherry-pick: ef9d233 * Create and send signed ack_game extrinsic (#7) * send extrinsic ack_game. * add Shard Identifier to Extrinsic Cherry-pick: ca24498 Co-authored-by: Gaudenz Kessler <[email protected]> * Detect ack_game extrinsic (#8) Cherry-pick: f5c3e43 Co-authored-by: Gaudenz Kessler <[email protected]> * Create a new connectfour game in the sgx runtime * fix game iteration * pretty print board games * add demo script * improve logging * rename last turn to block number Cherry-pick: 8360808 Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: haerdib <[email protected]> * Connect four demo with 2 workers * increase sleep time for demo * connect-four demo with 2 workers start workers with python script: python local-setup/launch.py local-setup/simple-config.json start demo-script in cli/: ./demo_connect_four_two_workers.sh -p 9985 -A 2090 -B 3090 -m file Cherry-pick: 00f336e Co-authored-by: Gaudenz Kessler <[email protected]> * Update sgxruntime and wasm builder (#32, #34) * update sgx-runtime * wasm-builder Cherry-pick: 74ff735, 24e2f2d Co-authored-by: Gaudenz Kessler <[email protected]> * rebase to latest master Cherry-pick: ed9e4c6 * integrate runner (#42) * remove obsolete GameEngine * add and use GameId type * add Runner storage * simplify RegistryStorageKeys trait * create new games from RunnerState:Queued * trigger CI against main * update CI to use Ajuna node * add node-url arg for the demo script * update `Cargo.lock` and patch * We would expect the runner to be Accepted Co-authored-by: Eric <[email protected]> Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: haerdib <[email protected]> Co-authored-by: gaudenzkessler <[email protected]> Co-authored-by: Andy Bell <[email protected]> Board pallet integration (#45) Finalise game back to L1 (#47) * Finish game back on L1 * Helper scripts for worker Workaround to double RPC response for getter (#48) [PLAT-295] Integrate dot4gravity sidechain (#49) * update node * move types and add game play for bomb and stone bump version (#50) Dispute game trusted operation (#55) * dispute game trusted operation * Add start type * Add pass through for dispute * Bump Ajuna and sgx-runtime versions point to branch (#57)
author Eric <[email protected]> 1655038720 +1200 committer haerdib <[email protected]> 1662130355 +0200 [PLAT-265] Rebase upstream (#44) * point sgx-runtime to ajuna-network at polkadot-v0.9.20 * change integritee-node -> Ajuna Also point `teerex-primitives` crate to polkadot-v0.9.20 branch, which is a required dep for Ajuna pegged at polkadot-v0.9.20. * detect new game Cherry-pick: 0b5e0bf * Add QueueGame cli call (#19) Cherry-pick: 26316ff * Add PlayTurn and GetBoard cli trusted calls to play connectfour (#22) Cherry-pick: ef9d233 * Create and send signed ack_game extrinsic (#7) * send extrinsic ack_game. * add Shard Identifier to Extrinsic Cherry-pick: ca24498 Co-authored-by: Gaudenz Kessler <[email protected]> * Detect ack_game extrinsic (#8) Cherry-pick: f5c3e43 Co-authored-by: Gaudenz Kessler <[email protected]> * Create a new connectfour game in the sgx runtime * fix game iteration * pretty print board games * add demo script * improve logging * rename last turn to block number Cherry-pick: 8360808 Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: haerdib <[email protected]> * Connect four demo with 2 workers * increase sleep time for demo * connect-four demo with 2 workers start workers with python script: python local-setup/launch.py local-setup/simple-config.json start demo-script in cli/: ./demo_connect_four_two_workers.sh -p 9985 -A 2090 -B 3090 -m file Cherry-pick: 00f336e Co-authored-by: Gaudenz Kessler <[email protected]> * Update sgxruntime and wasm builder (#32, #34) * update sgx-runtime * wasm-builder Cherry-pick: 74ff735, 24e2f2d Co-authored-by: Gaudenz Kessler <[email protected]> * rebase to latest master Cherry-pick: ed9e4c6 * integrate runner (#42) * remove obsolete GameEngine * add and use GameId type * add Runner storage * simplify RegistryStorageKeys trait * create new games from RunnerState:Queued * trigger CI against main * update CI to use Ajuna node * add node-url arg for the demo script * update `Cargo.lock` and patch * We would expect the runner to be Accepted Co-authored-by: Eric <[email protected]> Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: haerdib <[email protected]> Co-authored-by: gaudenzkessler <[email protected]> Co-authored-by: Andy Bell <[email protected]> Board pallet integration (#45) Finalise game back to L1 (#47) * Finish game back on L1 * Helper scripts for worker Workaround to double RPC response for getter (#48) [PLAT-295] Integrate dot4gravity sidechain (#49) * update node * move types and add game play for bomb and stone bump version (#50) Dispute game trusted operation (#55) * dispute game trusted operation * Add start type * Add pass through for dispute * Bump Ajuna and sgx-runtime versions point to branch (#57)
Getter:
./integritee-cli -p 9994 -P 2094 trusted get-board //Bob --mrenclave=5q8KKAzwH3sfbfurS8VE895mMny3pGkuz4EzueRbw5XR
Call:
./integritee-cli -p 9994 -P 2094 trusted play-turn //Bob 2 --mrenclave=5q8KKAzwH3sfbfurS8VE895mMny3pGkuz4EzueRbw5XR --direct
Not yet tested as no state available currently, but to minimize rebase work, I think we should merge.
(Cli calls are working, just the sgx-runtime state connection is not yet tested)