Installation
To get started developing on the Archway Network, you will need to have the below dependencies installed.
Required Dependencies
Optional Dependencies
IMPORTANT: For local installations, you need root access to run docker
. Make sure to follow all the steps with root
access to prevent conflicts and confusions on the deployment process which requires root permission.
- Docker (for Linux users, it's recommended to run the Docker daemon in Rootless Mode)
Rustc
rustc
, provided by the Rust project maintainers, is the compiler for the Rust programming language. rustc
takes your Rust source code and produces binary code as a library or an executable.
To install Rust, follow the instructions for your operating system at https://www.rust-lang.org/tools/install.
Cargo
Cargo is the Rust package manager, like go get
for Golang or npm
is for JavaScript. Cargo comes with Rust if you installed rustc
using rustup
.
If you did not already install rustc
with rustup
, or don't have cargo
in your command line path, see the instructions for installing Cargo at https://doc.rust-lang.org/cargo/getting-started/installation.html.
Cargo Generate
The cargo-generate
tool creates a new Rust project quickly by leveraging a pre-existing code base.
Archway 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 commands:
cargo install cargo-generate --features vendored-openssl
cargo install cargo-run-script
wasm32
The wasm32
rustup target is a 32-bit "bare wasm" module for producing WebAssembly output that makes zero assumptions about your host machine and environment (hence the -unknown-unkown
suffix). It's required by the Developer CLI, as of version 1.2.1
, for optimizing wasm
output for on-chain storage of binaries.
Install wasm32
using the following command:
rustup target add wasm32-unknown-unknown
Binaryen
As of version 1.2.1
of the Developer CLI, Binaryen replaces the need to use Docker for optimizing wasm
binaries for storage on-chain—allowing developers to run the CosmWasm Rust Optimizer natively from the Developer CLI.
Building binaryen from source
To install binaryen
clone the git repository then initialize the submodules and update them:
git submodule init
git submodule update
After that you can build it with CMake
cmake . && make
make install
Installing binaryen with Homebrew
MacOS users can install the binaryen package from Homebrew
brew install binaryen
Archwayd
archwayd
is an implementation of a Cosmos zone with wasm
smart contracts enabled.
Originally forked from the cosmos/gaia repository, archwayd
adds new modules for developer rewards and for executing wasm
, but otherwise the archwayd
binary functions just like gaiad
.
To build archwayd
, install it from source or use the archwaynetwork/archwayd
Docker container.
Install Archwayd from Source
Get source code:
git clone [email protected]:archway-network/archway.git
cd archway
Build and install:
make install
Note: Building archwayd from source requires Go 1.17+
For full installation and configuration parameters, see https://github.com/archway-network/archway/blob/main/README.md.
Install Archwayd Using Docker
Get source code:
git clone [email protected]:archway-network/archway.git
cd archway
Build and install:
docker build -t archway-network/archwayd:latest .
Or pull from Docker Hub:
docker pull archwaynetwork/archwayd:latest
To simplify using the Docker container, set an alias with the home path and the proper image tag (replacing <network-name>
), like:
alias archwayd="docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:<network-name>"
After setting this alias, you can use the other archwayd
commands without typing the verbose Docker run command.
For more information on running archwayd
with the archway-network/archwayd
Docker container, see https://github.com/archway-network/archway#dockerized.
As of version 1.2.1
of the Developer CLI Docker is no longer a required dependency for optimizing smart contracts for upload to the blockchain.
Node.js and Npm
npm
is a package manager for JavaScript and Node.js. Archway uses npm
for installing and updating the developer CLI.
For installing node.js
and npm
, see instructions for your operating system at https://docs.npmjs.com/downloading-and-installing-node-js-and-npm.
@archwayhq/cli
requires Node.js version 14 or higher, but some older versions in the beta
release track required Node.js version 17. You can check which version you have installed using the command archway --version
.
Archway Developer CLI
Install the Archway developer CLI using npm
, see Downloading and installing Node.js and npm.
npm install -g @archwayhq/cli
Note: If you are running archwayd
using Docker, and not running in Rootless Mode, you may need to install the Archway developer CLI as root
, or give yourself permissions to the directory on your file system (for example, sudo chown YOUR_USERNAME:YOUR_GROUPNAME -R ~/.archway
).