This repo provides a basic template to quickly bootstrap your application using the Axelar Local Development Environment, which simulates the relay of messages cross-chain, on the backend.
The code provides a basic scaffold for:
- Solidity contract templates (
contract_templates
directory) - a web interface (
web
directory)
Once ready, you can use this repo to deploy your contracts to testnet.
Install nodejs version 16. Run node -v
to check your installation. If needed you can switch your node version via
sudo npm i -g n
n v16.15.0
Clone this repo:
git clone https://github.com/axelarnetwork/axelar-dapp-starter-kit.git
Install dependencies:
npm update && npm install
First, set up a .env
file based on the .env.sample
template in the root directory and update your local wallet for testing. Use either EVM_MNEMONIC or EVM_PRIVATE_KEY, but not both!
- cd to the root directory of this project and run the command below.
- NOTE: Leave this node running on a separate terminal before deploying and testing the dApps.
npm run run-local-env
Then, from a separate terminal, run the following command:
npm run build
npm run deploy <TEMPLATE_DIRECTORY> <ENVIRONMENT>
# e.g.
npm run deploy CallContractWithToken local
This will build your contracts in the build
folder and the web
directory for the UI build.
info
for contract addresses by environmentweb/abi
for relevant ABIs, abdweb/info
for the network info for the UI
Option 1: Via command line, run:
npm run invoke-contract <TEMPLATE_DIRECTORY> <ENVIRONMENT> <SRC_CHAIN> <DEST_CHAIN> <AMOUNT> <ADDR_1> <ADDR_2> <OTHER_ADDRESSES>
# e.g.
npm run invoke-contract CallContractWithToken local Ethereum Avalanche 40 0x74Ccd7d9F1F40417C6F7fD1151429a2c44c34e6d 0x3B94CbD6d0f09db75435d6E3c9449a6B70BB55E2
Option 2: run your UI in the following steps:
- In a separate terminal window, cd to the
web
directory - Set up a
.env.local
file based on the.env.sample
template in theweb
directory and update either a NEXT_PUBLIC_EVM_MNEMONIC or NEXT_PUBLIC_EVM_PRIVATE_KEY (but not both) used for testing. - run
npm install
, thennpm run dev
- open browser at
http://localhost:3000
- enter params in the UI. in the text input, be sure to hit the "Enter" key after each destination address!
Once you are comfortable with your local dev scripts, deploying it to testnet should be simple:
npm run deploy <TEMPLATE_DIRECTORY> testnet
# e.g.
npm run deploy CallContractWithToken testnet
Ensure that the account tied to your EVM_MNEMONIC has enough funds to deploy to all supported EVM chains!