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(mainnet): support running examples on mainnet #189

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

re1ro
Copy link
Contributor

@re1ro re1ro commented Jun 17, 2024

  • mainnet: support running examples on mainnet

@re1ro re1ro requested review from Foivos, milapsheth and npty June 17, 2024 14:42
@re1ro re1ro self-assigned this Jun 17, 2024
@@ -187,7 +214,7 @@ function checkWallet() {
* @param {*} env - The environment to check. Available options are 'local' and 'testnet'.
*/
function checkEnv(env) {
if (env == null || (env !== 'testnet' && env !== 'local')) {
if (env == null || (env !== 'mainnet' && env !== 'testnet' && env !== 'local')) {
throw new Error('Need to specify testnet or local as an argument to this script.');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update error msg with mainnet as an option.

@@ -79,6 +79,33 @@ function getTestnetChains(chains = []) {
}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this temporary fix needed anymore? we expose the gas service address in the config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a fix just a refactoring the same path was already defined as a variable path

* @param {*} chains - The list of chains to get the chain objects for. If this is empty, the default chains will be used.
* @returns {Chain[]} - The chain objects.
*/
function getMainnetChains(chains = []) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code duplication. reuse the same function, just make the path derivation dependent on env

* @returns {Chain[]} - The chain objects.
*/
function getMainnetChains(chains = []) {
const _path = path.join(__dirname, '../../chain-config/mainnet-evm.json');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does this file come from? why don't we just import the info files the axelar-chain-configs package published in deployments repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It creates its own local config file and writes info for contracts deployed by examples.

@@ -79,6 +79,33 @@ function getTestnetChains(chains = []) {
}));
}

/**
* Get chains config for testnet.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testnet -> mainnet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants