Setting up the Developer Environment
Basics
TIG compiles all the algorithms submitted by Innovators into WebAssembly (WASM) for sandboxing and for verifiable execution by Benchmarkers. To facilitate this, Innovators must set up a Rust development environment.
We recommend developing using Visual Studio Code with Rust plugins:
You can install these plugins by searching for them in the Visual Studio Code Extensions Marketplace.
Setting up Private Fork
Innovators must fork the TIG Monorepo and develop their algorithms in a private fork. This ensures that the algorithm can be successfully compiled into WASM by the CI.
- Fork and clone the TIG Monorepo on your local machine.
git clone https://github.com/<YOUR_GITHUB_ACCOUNT>/tig-monorepo.git
Setup remotes with origin
pointed to your private repository and public
pointed to the public TIG Monorepo.
cd tig-monorepo
git remote add origin <YOUR_PRIVATE_REPO>
git remote add public https://github.com/tig-foundation/tig-monorepo.git
You need to pull the blank_slate
branch from the public repository.
git fetch public
git checkout -b blank_slate
git pull public blank_slate
Now push the blank_slate
branch to your private repository.
git push origin blank_slate
Checking out Existing Algorithms
Every algorithm has its own <branch>
with the name <challenge_name>/<algorithm_name>
.
Only algorithms that are successfully compiled into WASM have their branch pushed to this public repository.
Each algorithm branch will have 6 key files:
- Rust code with TIG commercial license header @
tig-algorithms/src/<branch>/commercial.rs
- Rust code with TIG open data license header @
tig-algorithms/src/<branch>/open_data.rs
- Rust code with TIG benchmarker outbound license header @
tig-algorithms/src/<branch>/benchmarker_outbound.rs
- Rust code with TIG innovator outbound license header @
tig-algorithms/src/<branch>/innovator_outbound.rs
- Rust code with TIG inbound license header @
tig-algorithms/src/<branch>/inbound.rs
- WASM blob @
tig-algorithms/wasm/<branch>.wasm
To read more about Licensing, please refer to the Licensing page.
To pull an existing algorithm from TIG public repository, run the following command:
git fetch public
git pull public <challenge_name>/<algorithm_name>