Using the Contracts Kit Workshop
Recording on Youtube:
Dial in Information is at: https://casperlabs.atlassian.net/wiki/spaces/REL/pages/136544674/Weekly%2BWorkshops%2BHome
Participants
@Medha Parlikar
@Tom Vasile (Deactivated)
@Ashok Ranadive (Unlicensed)
@Former user (Deleted)
During this workshop, we will show users how to use the CasperLabs contracts crate to set up a new smart contract project, and how to leverage the test infrastructure.
Goals
Install CasperLabs contract SDK
Create a new smart contract project
Set up the build environment
Build the empty contract
Run the test
Open the project in your IDE and view the project structure.
We will record the session.
Step by Step Plan
These instructions are also available on GitHub at: https://github.com/CasperLabs/CasperLabs/tree/dev/execution-engine/cargo-casperlabs
Install the SDK
cargo install cargo-casperlabs --force
2. Create your project & name it as you wish.
cargo casperlabs my_project
3. Set up your build environment
cd my_project/contract
rustup install $(cat rust-toolchain)
rustup target add --toolchain=$(cat rust-toolchain) wasm32-unknown-unknown
4. Now let’s build the empty project
Your contract will be built to: my_project/contract/target/wasm32-unknown-unknown/release/contract.wasm
.
5. Next we can run the test that comes with the SDK. This framework will run the contract within the execution engine with the tests.
6. Next we can open the project inside an IDE and observe the structure of the empty contract.
Software Version (GitHash)
CasperLabs Client 0.14.0 (2b8ccb3ac758484e44ff236be381b2d947c9c099
)
What you need to know:
Good resource for learning Rust: https://www.rust-lang.org/learn
Notes:
Outcome:
Help!
Go to Discord- we will help you there: https://discord.gg/mpZ9AYD