- Docs
- Developers
- Install development tools
Installing development tools for Archway
To begin developing on the Archway Network, you'll need to set up several essential tools and dependencies. This guide will walk you through the installation process for each component, ensuring you have a robust development environment for creating, testing, and deploying smart contracts on the Archway blockchain.
Prerequisites
- A Unix-like operating system (Linux, macOS, or Windows Subsystem for Linux). If you are on
Windows
the following guide should help you with installing Windows Subsystem for Linux. - Basic familiarity with command-line interfaces
- It is recommeded for
MacOs
users that they useHomebrew
for installing packages where possible. Execute the following command to installHomebrew
:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
If you are having issues installing Homebrew you can follow the instructions here.
- MacOs users require
Xcode CLI
. If you do not yet have this installed you can execute the following from your terminal to have it installed:
xcode-select --install
Dependencies
Openssl & pkg-config
Certain Rust crates (libraries) used in CosmWasm development have dependencies that require OpenSSL
and pkg-config
. Here are the detailed steps for macOS
and various Linux
distributions:
macOS
- Install OpenSSL:
brew install openssl
- Install pkg-config:
brew install pkg-config
- Set Environment Variables:
- Open your shell profile file (
~/.zshrc
,~/.bash_profile
, or~/.profile
) in a text editor and add the following line:export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
- Source your profile file to apply the changes:
source ~/.zshrc # or source ~/.bash_profile, depending on your shell
- Open your shell profile file (
Linux
Debian-based distributions (e.g., Ubuntu)
- Update the package list:
sudo apt update
- Install OpenSSL:
sudo apt install libssl-dev
- Install pkg-config:
sudo apt install pkg-config
Red Hat-based distributions (e.g., Fedora)
- Install OpenSSL:
sudo dnf install openssl-devel
- Install pkg-config:
sudo dnf install pkgconf
Arch Linux
- Install OpenSSL and pkg-config:
sudo pacman -S openssl pkgconf
Verify the Installation
To ensure that OpenSSL and pkg-config
are installed correctly, run the following commands in your terminal:
- Check OpenSSL version:
openssl version
- Check pkg-config version:
pkg-config --version
Rust
Rust is the programming language used for smart contract development on Archway. The best way to install Rust
on Unix-like operating systems is to use the rustup
tool, which manages Rust installations and updates.
MacOS users can also install Rust via Homebrew. Run the following command in your Terminal:
brew install rust
The follow are steps to install Rust
using rustup
via any Unix-like operating system:
- In the Terminal, run the following command to download and install
rustup
:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- You will be prompted to select an installation option. The recommendation is to use the default option by pressing
Enter
. - Check if
Rust
andrustup
were installed correctly by running the following commands:
rustc --versioncargo --versionrustup --version
The following is an example of the output:
rustc 1.82.0-nightly (c1a6199e9 2024-07-24)
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
cargo 1.82.0-nightly (5f6b9a922 2024-07-19)
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.82.0-nightly (c1a6199e9 2024-07-24)`
If you are having issus installing Rust, follow the instructions for your operating system here.
Cargo
Cargo is the Rust package manager, like go get is for Golang or npm is for JavaScript. Cargo
comes with Rust
if you installed Rust using rustup.
If you did not already install Rust with rustup, or don't have cargo in your command line path, see the instructions for installing Cargo here.
Cargo generate & cargo run script
The cargo-generate tool creates a new Rust project quickly by leveraging a pre-existing code base. Archway Developer CLI uses cargo-generate and cargo-run-script to provide and manage project templates for dapp development.
To install cargo-generate with vendored-openssl, and the cargo-run-script module, run the following commands in your terminal:
cargo install cargo-generate --features vendored-opensslcargo install cargo-run-script
Node.js and npm
Node.js is a JavaScript runtime that allows you to run JavaScript on your local machine, enabling the development of various applications and tools. npm (Node Package Manager) is a package manager for JavaScript that helps you install, update, and manage libraries and dependencies. The Archway Developer CLI relies on npm for installation and updates. Follow the instructions below to install Node.js and npm on your operating system.
macOS
You can install Node.js and npm on macOS using Homebrew
or Node Version Manager (nvm)
.
Using homebrew
- Execute the following command in your terminal:
brew install node
- Verify the installation:
- Check the Node.js version:
node --version
- Check the npm version:
npm --version
- Check the Node.js version:
Using node version manager (nvm)
- Install nvm:
- Run the following command to download and install
nvm
:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
- Close and reopen your Terminal, or source your profile:
source ~/.nvm/nvm.sh
- Run the following command to download and install
- Install Node.js using nvm:
- Install the latest version of Node.js:
nvm install node
- Alternatively, you can install a specific version:
nvm install 14.17.0
- Install the latest version of Node.js:
- Verify the installation:
- Check the Node.js version:
node --version
- Check the npm version:
npm --version
- Check the Node.js version:
Linux
You can install Node.js and npm on Linux using the package manager for your distribution or Node Version Manager (nvm).
Using the Package Manager
- Install Node.js and npm:
- For Debian-based distributions (e.g., Ubuntu):
sudo apt updatesudo apt install nodejs npm
- For Red Hat-based distributions (e.g., Fedora):
sudo dnf install nodejs npm
- For Debian-based distributions (e.g., Ubuntu):
- Verify the installation:
- Check the Node.js version:
node --version
- Check the npm version:
npm --version
- Check the Node.js version:
Using Node Version Manager (nvm)
- Install nvm:
- Run the following command to download and install
nvm
:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
- Close and reopen your Terminal, or source your profile:
source ~/.bashrc
- Run the following command to download and install
- Install Node.js using nvm:
- Install the latest version of Node.js:
nvm install node
- Alternatively, you can install a specific version:
nvm install 14.17.0
- Install the latest version of Node.js:
- Verify the installation:
- Check the Node.js version:
node --version
- Check the npm version:
npm --version
- Check the Node.js version:
For more detailed instructions, refer to the official Node.js documentation.
Docker
Docker is crucial for utilizing the rust optimizer, which is required for optimizing your smart contracts into a wasm binary for on-chain deployment. You can install Docker for your operating system here.
Warning
For Linux users, it's recommended to run the Docker daemon in Rootless Mode
Go
Go is required for installing the keyring for the Archway Developer CLI
. The following are the steps to install Go on Unix-like systems, including macOS and Linux:
macOS
Using Homebrew
- In your terminal execute the following:
brew install go
- Verify the installation:
go version
Using the Official Installer
- Download the Go installer:
- Visit the Go download page and download the macOS package.
- Run the installer:
- Open the downloaded
.pkg
file and follow the instructions to install Go.
- Open the downloaded
- Verify the installation:
go version
Linux
Using the Package Manager
- Install Go:
- For Debian-based distributions (e.g., Ubuntu):
sudo apt updatesudo apt install golang
- For Red Hat-based distributions (e.g., Fedora):
sudo dnf install golang
- For Debian-based distributions (e.g., Ubuntu):
- Verify the installation:
go version
Using the Official Tarball
- Download the Go tarball:
- Visit the Go download page and download the tarball for your system.
- Extract the tarball:
tar -C /usr/local -xzf go1.xx.x.linux-amd64.tar.gz
- Add Go to your PATH:
- Open your shell profile file (
~/.bashrc
,~/.zshrc
, or other) in a text editor and add the following line:export PATH=$PATH:/usr/local/go/bin
- Source your profile file to apply the changes:
source ~/.bashrc # or source ~/.zshrc
- Open your shell profile file (
- Verify the installation:
go version
Archway Developer CLI
This tool is an npm
package that offers a suite of commands to simplify interactions with the Archway blockchain. To install the Archway Developer CLI via npm
, run the following command in your terminal:
npm install -g @archwayhq/cli
Info
Since the release of Archway CLI v2, archwayd is no longer a dependency for the Developer CLI.
If you are on a Linux machine with a distribution different from Ubuntu, you may need to install the GNOME Keyring, or any other keyring compatible with the Secret service API to create accounts. Yuo can find more information on dependencies here.
Archwayd
All the actions executable through Archway Developer CLI can also be performed via archwayd, but it requires significantly more knowledge to achieve the same results.
To install archwayd, you can either download the latest release of the pre-built binary or build archwayd from source. Ensure that you use the release corresponding to the version of archwayd being used on the chain where you will be deploying your contracts.
Please note: MacOs users with M2 chips might need to install from source.
Use pre-built binary
For Linux, and depending on your architecture:
amd64
arm64
wget https://github.com/archway-network/archway/releases/download/v9.0.0/archwayd_linux_amd64
Verify the integrity of the binary
You can verify the binary by generating the sha256 hash of the downloaded file:
amd64
arm64
sha256sum archwayd_linux_amd64
Using the sha256sum command should generate a string (e.g., 4dd95ee0729b6593c9c390bde6e0c7bf3af0957d7f323e216b76ddb663fa7bc7). Next, you can download the sha256 checksum file corresponding to the release file using the command:
wget archwaysha256.txt https://github.com/archway-network/archway/releases/download/v9.0.0/archwayd_v9.0.0_checksums.txt
Then you can compare the two sha256 hash strings to ensure they match. By doing so, you confirm that the downloaded file matches the official release file.
Add executable permissions
After downloading the file, you can add executable permissions to it using the chmod command:
chmod +x archwayd_linux_amd64
The above command makes the binary executable.
Move the binary to the chosen directory
You can now move the binary to a directory in your PATH. The /usr/local/bin directory is commonly used for custom user programs not managed by the distribution package manager and is usually included in the PATH. You can move your file there with the mv command and also rename it to archwayd at the same time:
sudo mv archwayd_linux_amd64 /usr/local/bin/archwayd
Use homebrew tap
This is the recommended option for macOS users but can also be used by Linux users who use Homebrew. To quickly install the archwayd
binary locally using Homebrew, execute the following command:
brew install archway-network/tap/archway
Build from source
When all other options fail you can still install the archwayd
binary from source. Please make sure you have git and make
installed.
Clone the repository, checkout the main
branch and build:
cd archwaygit checkout mainmake install
This will install the archwayd
binary to your GOPATH
.