To use the protocol-25 zk preview that is not yet released:
Note
This requires workflow requires the stellar-cli, Rust, and Docker (or some other container runtime) to be installed. See the Getting Started documentation for how to install these.
Create a new contract with:
stellar contract init .
In the contract Cargo.toml replace the soroban-sdk imports with:
#[dependencies]
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3cf10a984dba03f68b4f2ed653b715063e983bba" }
#[dev-dependencies]
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3cf10a984dba03f68b4f2ed653b715063e983bba", features = ["testutils"] }Build the contract:
stellar contract build --out-dir out/
Run a version of the network supporting the zk primitives:
stellar container start -t future
or
docker run --rm -i --name stellar -p 8000:8000 stellar/quickstart:future --local
Configure the cli to interact with that network:
stellar network use local
Create a key on the local network:
stellar keys generate mykey
stellar keys fund mykey
stellar keys use mykey
Deploy the contract to the local network:
stellar contract deploy --wasm-dir out/<FILE>.wasm --alias mycontract
Invoke the contract:
stellar contract invoke --id mycontract -- <FUNCTION_NAME> <ARGS>