Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add live testnet testing instructions to readme #242

Merged
merged 13 commits into from
Sep 21, 2023
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ See [this doc](./DESIGN.md) for more design info.

## Build

We recommend using the current Node.js [LTS version](https://nodejs.org/en/about/releases/) for satisfying the hardhat compiler
We recommend using the current Node.js [LTS version](https://nodejs.org/en/about/releases/) for satisfying the hardhat compiler

Run in your terminal

```bash
npm ci

Expand All @@ -24,6 +25,63 @@ npm run build
npm run test
```

## Live testnet testing

1. Check if the contract deployments repository supports the testnet you will be using. Supported chains can be found [here](https://github.com/axelarnetwork/axelar-contract-deployments/blob/main/info/testnet.json). If the testnet is not already supported, proceed to steps 2-4, otherwise you may skip to step 5.
2. Navigate to the contract deployments repo [here](https://github.com/axelarnetwork/axelar-contract-deployments/) and clone the repository locally.
3. Within the info folder in the [testnet](https://github.com/axelarnetwork/axelar-contract-deployments/blob/main/info/testnet.json) file, add the configuration of the new testnet as shown in the example below with correct values:

```json
{
"chains": {
"example": {
"name": "Example",
"id": "example",
"chainId": 123,
"rpc": "PROVIDER_RPC",
"tokenSymbol": "EXM",
"gasOptions": {
"gasLimit": 8000000
}
}
}
}
```

4. In the root directory of this repository navigate to the `hardhat.config.js` file and modify the chains import line as shown below:

```javascript
const chains = require(`@axelar-network/axelar-contract-deployments/info/${env}.json`);
const chains = require(`[LOCAL_PATH]/axelar-contract-deployments/info/${env}.json`);
```

5. In the root folder of this repository create a new file named `keys.json`
milapsheth marked this conversation as resolved.
Show resolved Hide resolved
6. Within `keys.json` provide your private key for the account you will be using for testing. For some tests, such as the Axelar gateway tests, you may need to provide more than one private key. Next, you may optionally provide an API key for the testnet you will be using.

At this point the `keys.json` file should resemble the example file below:

```json
{
"accounts": ["PRIVATE_KEY1", "PRIVATE_KEY2", "PRIVATE_KEY3"]
}
```
milapsheth marked this conversation as resolved.
Show resolved Hide resolved

7. Ensure that your accounts corresponding to the private keys provided have sufficient native value on the testnet you will be using.
8. Run in your terminal

```bash
npm ci

npx hardhat test --network NETWORK_NAME
```

9. To run specific tests you may modify the test scripts by adding `.only` to `describe` and/or `it` blocks as shown below:

```javascript
describe.only();
it.only();
```

## Example flows

See Axelar [examples](https://github.com/axelarnetwork/axelar-examples) for concrete examples.
Expand Down
Loading