Testing Smart Contracts with Solo
What is Solo?
Solo is a testing framework that allows developers to validate real smart contracts and entire inter-chain protocols before deploying them on the distributed network.
Access the Solo Framework
Clone the Wasp Repository
Solo is part of the Wasp codebase repository. You can access the Solo framework by cloning the repository with the following command:
git clone https://github.com/iotaledger/wasp.git
After you have cloned the repository, you can access the Solo package in the
Install the Solo Package
You can install the Solo package separately using the following command:
go get github.com/iotaledger/wasp/packages/solo
You can browse the Solo Go API reference (updated to the
master branch) in
You will need a smart contract to test along with Solo. You can find example implementations of Rust/Wasm smart contracts, including source code and tests, in the Wasp repository’s contracts/wasm folder.
For information on creating Wasm smart contracts, refer to the Wasm VM chapter.
The following sections will present some Solo usage examples. You can find the example code in the Wasp repository.
You can run
*_test files by moving to their directory and running the following command:
If you run this command from the
/documentation/tutorial-examples folder, you will run the
Tutorial Test, which
contains all the examples explained in the following sections.