Build a Contract
To build a Soroban contract to deploy or run with the
soroban-cli, use the
cargo build command.
cargo build --target wasm32-unknown-unknown --release
.wasm file will be outputted in the
target directory. The
.wasm file is
the built contract.
Run a Contract
If you have the
soroban-cli installed, you can invoke contract functions
that have been built.
soroban-cli invoke \
--wasm target/wasm32-unknown-unknown/release/first_project.wasm \
--id 1 \
--fn hello \
The following output should appear.