Daohub-io / cap9

Capability-based security protocol for smart contracts
Apache License 2.0
22 stars 10 forks source link

CLI - new-procedure command #194

Open Latrasis opened 5 years ago

Latrasis commented 5 years ago

We need a new-procedure command for setting up a new procedure code.

New-Procedure Command

Parameters:

Output:

Deploy-Procedure Command

The deploy-procedure command is amended:

JakeOShannessy commented 5 years ago

This all works in #191. That is:

I'm going to add some better error messages and tests.

JakeOShannessy commented 5 years ago

Added error messages that should cover most if not all problems that might occur in this workflow and offer guidance on how to fix it.

JakeOShannessy commented 5 years ago

Added execution of arbitrary procedures via the admin procedure. Added tests to execute new procedures via this process.

JakeOShannessy commented 5 years ago

I added a script to the root of the cap9-cli package to step through all of these things with the right commands. I've reproduced it here:

cargo run --bin cap9-cli -- new --acl new-project
cd new-project
cargo run --bin cap9-cli -- deploy
cargo run --bin cap9-cli -- new-procedure hello_world
cd hello_world
cargo build --target wasm32-unknown-unknown --release
cd ..
cargo run --bin cap9-cli -- deploy-procedure hello_world
cargo run --bin cap9-cli -- fetch all-logs
cargo run --bin cap9-cli -- call-any hello_world say_hello
cargo run --bin cap9-cli -- fetch all-logs
JakeOShannessy commented 5 years ago

This issue is completed with #191.