Terrain initial setup
This tutorial uses a Terra-specific development tool called Terrain.
Terrain will help you:
- Scaffold your dApp project.
- Develop and deploy smart contracts.
- Create custom tasks for blockchain and contract interaction.
- Access a console (or REPL) for interacting with the Terra blockchain.
- Create predefined functions used in tasks and in the console.
Prerequisites
Set up Rust
Rust is the main programming language used for CosmWasm smart contracts. While WASM smart contracts can theoretically be written in any programming language, CosmWasm libraries and tooling work best with Rust.
- Install the latest version of Rust.
- Set 'stable' as the default release channel.
- Add WASM as the compilation target.
- Install a package to run custom cargo scripts.
- Install the latest version of Rust.
- Set 'stable' as the default release channel.
- Add WASM as the compilation target.
- Install a package to run custom cargo scripts.
Install Terrain
- Use npm to install the terrain command-line tool globally.
- Make sure you are using the latest version of Terrain. Previous versions may cause errors.
- Use npm to install the terrain command-line tool globally.
- Make sure you are using the latest version of Terrain. Previous versions may cause errors.
If you installed a previous version of Terrain, make sure to update it:
_2npm uninstall -g @iboss/terrain_2npm install -g @terra-money/terrain
Next steps: LocalTerra or Testnet
Depending on your setup, you can either install LocalTerra or use the Pisco testnet to power Terrain.
LocalTerra is a development environment designed to make it easy for smart contract developers to test their contracts locally. Terrain can also interact with the Terra blockchain's live testing environment, the Pisco testnet.
Localterra may not perform optimally on machines with less than 16 GB of RAM. Please use the Pisco testnet if your device does not meet this requirement.