- Docs
- Developers
- Installation
Installation
To get started developing on the Archway Network, you will need to have the the following dependencies installed.
Dependencies
Required
Optional
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 here.
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 here.
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-opensslcargo 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
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 here.
Info
@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.
Docker
Docker is needed for the Developer CLI to use the rust optimizer. Make sure to follow all the steps with root access to prevent conflicts and confusions on the deployment process which requires root permission. You can use Docker Desktop or Docker Engine.
Warning
For Linux users, it's recommended to run the Docker daemon in Rootless Mode
Archway Developer CLI
You can install the Archway CLI by using npm
npm install -g @archwayhq/cli
Info
Since the release of Archway CLI v2, archwayd is no longer a dependency for the Developer CLI.
Archwayd (optional)
archwayd is an implementation of a Cosmos zone with wasm smart contracts enabled, and which adds new modules for developer rewards and for executing wasm.
To build archwayd, you can download the latest release, as building archwayd from source is not recommended.
You can download the latest release of the pre-built binary from the releases page.
For Linux, and depending on your architecture:
amd64
arm64
wget https://github.com/archway-network/archway/releases/download/v4.0.2/archwayd_linux_amd64
Verify the integrity of the binary
You can now verify the download by generating the sha256 hash for the downloaded file:
amd64
arm64
sha256sum archwayd_linux_amd64
Using the sha256sum should give you a string (i.e. 4dd95ee0729b6593c9c390bde6e0c7bf3af0957d7f323e216b76ddb663fa7bc7).
You can then download the sha256 checksum file relative to the release file:
wget archwaysha256.txt https://github.com/archway-network/archway/releases/download/v4.0.2/archwayd_v4.0.2_checksums.txt
and you can compare that the sha256 hash strings match, By doing so, you are ensuring that the downloaded file matches the actual 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