Skip to main content

Run on Sandbox

If you have the soroban-cli installed, you can run contracts in a local sandbox environment.

The Soroban sandbox environment is the same Soroban environment that runs on Stellar networks, but it runs without nodes, and without the other features you find on a Stellar network.

info

It's also possible to run a contract on a fully featured local network. See Deploy to a Local Network for more details.

Using the code we wrote in Write a Contract and the resulting .wasm file we built in Build run the following command to invoke the hello function with a single argument friend.

soroban invoke \
--wasm target/wasm32-unknown-unknown/release/[project-name].wasm \
--id 1 \
--fn hello \
--arg friend

The following output should appear.

["Hello","friend"]