A new Archway project involves creating a Rust-based application that compiles to WebAssembly (wasm), a binary instruction format optimized for efficient execution. Setting up a new Archway project is most straightforward when using the Archway Developer CLI. Let's begin the process of creating a new project with the help of this Developer CLI.
Use the command archway accounts list to view wallets in your key ring, or create a new wallet using:
archway accounts new
You will be asked to enter a name for the account.
Example output with certain sensitive details altered or omitted:
✅ Account testwallet successfully created!Address: archway1qs2qnjvzlkgt0gpekr2c3pld0eu3tq8yw2kwgcPublic Key Algo: secp256k1 Key: Ak++QeiMs4HhXQe3JLpM/R+nU2pzvOWT6GsJZacTfyr6Recovery phrase: <phrase removed>⚠️ Important: write this mnemonic phrase in a safe place. It is the only way to recover your account if you forget your password.Checking for updates...
The archway new command starts a new project.
Example output with certain details altered or omitted:
✔ Enter the name of the new project … Project 1✔ Select a chain to use › Archway✔ Choose a name for your contract … increment✔ Choose a starter template › IncrementCreating Archway project project-1...🔧 Destination: /Users/testuser/project-1 ...🔧 project-name: project-1 ...🔧 Generating template ...[ 1/19] Done: .cargo/config 💡 Initializing a fresh Git repository✨ Done! New project created /Users/testuser/project-1🔧 Destination: /Users/testuser/project-1/contracts/increment ...🔧 project-name: increment ...🔧 Generating template ...✔ 🤷 This template has 2 versions:- The full template includes example logic in case you're new to CosmWasm smart contracts.
When you have created a new project, navigate to the folder where the project was installed and print your config using the command:
archway config show
An example output:
Chain id: constantine-3Contracts path: ./contractsKeyring backend: osKeyring files path: /Users/testuser/.config/archway/keys
If this configuration isn't to your liking, you can always modify it by executing the archway config set with the key and value you would like to update.
$ archway config set KEY VALUE [--json] [--log-level debug|error|info|warn] [-g]
KEY (required) (chain-id|contracts-path|default-account|keyring-backend|keyring-path) The config key to setVALUE (required) The config value
In Chain ID specifies the chain the project is currently configured to interact with. You can use the following command to easily switch to a different chain:
$ config chains use <chain-id>
You will need to enter the Chain ID that you will want to switch to. Currently "constantine-3" for Testnet and "archway-1" for Mainnet.