Skip to content
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

Merged
merged 8 commits into from
Feb 14, 2022
Merged

Add cli calls to play connectfour #22

merged 8 commits into from
Feb 14, 2022

Conversation

haerdib
Copy link

@haerdib haerdib commented Feb 11, 2022

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)

@haerdib haerdib self-assigned this Feb 11, 2022
@haerdib haerdib marked this pull request as ready for review February 14, 2022 08:01
Copy link

@gaudenzkessler gaudenzkessler left a 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

.takes_value(true)
.required(true)
.value_name("u8")
.help("play stone in column, must be in the range of [0,7]"),

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]?

Copy link
Author

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.

Copy link
Author

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!

.parse()
.expect("amount can be converted to u8");

if column >= 8 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6?

.expect("amount can be converted to u8");

if column >= 8 {
panic!("Game only allows columns smaller then 8");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6?

Copy link

@gaudenzkessler gaudenzkessler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great

@haerdib haerdib merged commit ef9d233 into master Feb 14, 2022
@haerdib haerdib deleted the add-boards-getter branch February 14, 2022 10:04
andyjsbell added a commit that referenced this pull request Jun 12, 2022
* 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]>
cowboy-bebug added a commit that referenced this pull request Jun 22, 2022
* 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]>
haerdib pushed a commit that referenced this pull request Sep 2, 2022
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)
haerdib pushed a commit that referenced this pull request Sep 21, 2022
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants