Skip to content

Commit

Permalink
Merge pull request #53 from axelarnetwork/feat/vmChains
Browse files Browse the repository at this point in the history
feat: add vm chains config for devnet-*
  • Loading branch information
nrsirapop authored Jun 6, 2024
2 parents 416cf58 + 480ba80 commit 8930b07
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 942 deletions.
1,080 changes: 153 additions & 927 deletions config/chains.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axelarscan-api",
"version": "0.0.25",
"version": "0.0.26",
"description": "Axelarscan API",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion terraform/devnet-amplifier/variables.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variable "log_level" {

variable "app_version" {
description = "App version, same as docker image version"
default = "0.0.25"
default = "0.0.26"
validation {
error_message = "Must be valid semantic version. $Major.$Minor.$Patch"
condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))
Expand Down
2 changes: 1 addition & 1 deletion terraform/devnet-verifiers/variables.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variable "log_level" {

variable "app_version" {
description = "App version, same as docker image version"
default = "0.0.25"
default = "0.0.26"
validation {
error_message = "Must be valid semantic version. $Major.$Minor.$Patch"
condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))
Expand Down
2 changes: 1 addition & 1 deletion terraform/mainnet/variables.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variable "log_level" {

variable "app_version" {
description = "App version, same as docker image version"
default = "0.0.25"
default = "0.0.26"
validation {
error_message = "Must be valid semantic version. $Major.$Minor.$Patch"
condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))
Expand Down
2 changes: 1 addition & 1 deletion terraform/stagenet/variables.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variable "log_level" {

variable "app_version" {
description = "App version, same as docker image version"
default = "0.0.25"
default = "0.0.26"
validation {
error_message = "Must be valid semantic version. $Major.$Minor.$Patch"
condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))
Expand Down
2 changes: 1 addition & 1 deletion terraform/testnet/variables.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variable "log_level" {

variable "app_version" {
description = "App version, same as docker image version"
default = "0.0.25"
default = "0.0.26"
validation {
error_message = "Must be valid semantic version. $Major.$Minor.$Patch"
condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))
Expand Down
22 changes: 13 additions & 9 deletions utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { get, write } = require('../services/indexer');
const { request } = require('./http');
const { toJson, toArray } = require('./parser');
const { equalsIgnoreCase, capitalize, removeDoubleQuote } = require('./string');
const { isNumber } = require('./number');
const { timeDiff } = require('./time');

const { methods, chains, assets, its_assets, endpoints, tokens, supply, tvl } = { ...config };
Expand All @@ -22,15 +23,18 @@ const getChains = (chainTypes = [], env = ENVIRONMENT) => {
let no_tvl;
switch (k) {
case 'evm':
provider_params = [{
chainId: toBeHex(_v.chain_id).replace('0x0', '0x'),
chainName: `${_v.name} ${capitalize(env)}`,
rpcUrls: toArray(_v.endpoints?.rpc),
nativeCurrency: _v.native_token,
blockExplorerUrls: toArray([_v.explorer?.url]),
}];
no_inflation = !_v.maintainer_id || !!_v.deprecated;
no_tvl = _v.no_tvl || !!_v.deprecated;
case 'vm':
if (isNumber(_v.chain_id)) {
provider_params = [{
chainId: toBeHex(_v.chain_id).replace('0x0', '0x'),
chainName: `${_v.name} ${capitalize(env)}`,
rpcUrls: toArray(_v.endpoints?.rpc),
nativeCurrency: _v.native_token,
blockExplorerUrls: toArray([_v.explorer?.url]),
}];
no_inflation = !_v.maintainer_id || !!_v.deprecated;
no_tvl = _v.no_tvl || !!_v.deprecated;
}
break;
default:
break;
Expand Down

0 comments on commit 8930b07

Please sign in to comment.