DEV Community

darkvallen
darkvallen

Posted on • Edited on

Setup Soroban Dev Environment On Windows(Ubuntu-WSL)

Hi! in my first post here,i will post about how to setup Soroban Dev Environment On Windows(Ubuntu-WSL). Here is the step-by-step :

1. Install WSL and Ubuntu

To install WSL, open the command prompt as administrator and run this following command:

wsl --install 
Enter fullscreen mode Exit fullscreen mode

Installing WSL
If the command doesn't install the Ubuntu distro automatically, use this command to install it:

wsl --install -d ubuntu 
Enter fullscreen mode Exit fullscreen mode

After installation, open Ubuntu and set up your username and password.

Setup Ubuntu Username and Password

Run this command to update everything:

sudo apt update && sudo apt upgrade 
Enter fullscreen mode Exit fullscreen mode

Note: You need administrator privileges to run the wsl command in the command prompt.

2. Install Rust

Soroban smart contracts is written in Rust. To install Rust, use this following command

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 
Enter fullscreen mode Exit fullscreen mode

And install the wasm32-unknown-unknown target with this command:

rustup target add wasm32-unknown-unknown 
Enter fullscreen mode Exit fullscreen mode

3. Install GCC Compiler

The GCC (GNU Compiler Collection) is a collection of compilers and libraries for various programming languages. It is needed to install Soroban-CLI. Use this following command to install it:

sudo apt install build-essential 
Enter fullscreen mode Exit fullscreen mode

4. Install Soroban-CLI

Soroban-CLI is the command-line multi-tool for interacting with Soroban contracts. Use this following command to install it:

cargo install --locked --version 0.6.0 soroban-cli 
Enter fullscreen mode Exit fullscreen mode

After installation, run the soroban command. If everything is working fine, you should get an output similar to:

$ soroban soroban 0.6.0 https://soroban.stellar.org USAGE: soroban <SUBCOMMAND> OPTIONS: -h, --help Print help information SUBCOMMANDS: contract Tools for smart contract developers config Read and update config serve Run a local webserver for web app development and testing events Watch the network for contract events lab Experiment with early features and expert tools version Print version information completion Print shell completion code for the specified shell gen Generate code client bindings for a contract xdr Decode xdr version Print version information completion Print shell completion code for the specified shell 
Enter fullscreen mode Exit fullscreen mode

Closing

Your Soroban Development Environment on Windows(Ubuntu-WSL) already set! 🎉🎉 And you can start tinkering with soroban smart contracts(write contracts,deploy,invoke,etc)

Top comments (0)