From b0bb63bc2b38e572947fc70e8fffe97682355b6b Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 26 Feb 2020 08:00:55 -0500 Subject: [PATCH] Fabo/Use figment nodes (#362) * use api keys * add env variables for nodes --- .github/workflows/production.yml | 2 +- data/networks.js | 210 +++++++++++++++++++++++++++++++ data/networks.json | 206 ------------------------------ lib/networks.js | 2 +- 4 files changed, 212 insertions(+), 208 deletions(-) create mode 100644 data/networks.js delete mode 100644 data/networks.json diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index f775579143..9f63240190 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -25,6 +25,6 @@ jobs: - name: Installing Docker Compose run: ssh root@167.71.107.214 "sudo curl -L \"https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose; sudo chmod +x /usr/local/bin/docker-compose" - name: Run on Digital Ocean - run: ssh root@167.71.107.214 "docker image prune -a -f; docker load < lunieapi.tgz;export HASURA_URL="https://production-db.lunie.io/v1/graphql"; export HASURA_ADMIN_KEY="${{ secrets.LUNIE_PRODUCTION_DB_KEY }}"; export SENTRY_DSN="${{ secrets.SENTRY_DSN_PRODUCTION }}"; docker stack deploy -c docker-compose.yml lunieapi; docker service update --image lunieapi:latest --force lunieapi_lunieapi" + run: ssh root@167.71.107.214 "docker image prune -a -f; docker load < lunieapi.tgz;export HASURA_URL="https://production-db.lunie.io/v1/graphql"; export HASURA_ADMIN_KEY="${{ secrets.LUNIE_PRODUCTION_DB_KEY }}"; export SENTRY_DSN="${{ secrets.SENTRY_DSN_PRODUCTION }}"; export FIGMENT_COSMOS_HUB_API_KEY="${{ secrets.FIGMENT_COSMOS_HUB_API_KEY }}"; export FIGMENT_GAIA_13007_API_KEY="${{ secrets.FIGMENT_GAIA_13007_API_KEY }}"; docker stack deploy -c docker-compose.yml lunieapi; docker service update --image lunieapi:latest --force lunieapi_lunieapi" - name: Setting up cron job for pm2 metrics export run: ssh root@167.71.107.214 "mkdir /logs -p; touch /logs/show; line='*/1 * * * * docker exec lunieapi pm2 show 0 > /logs/show; perl /root/pm2metrics.pl'; crontab -l | grep -q 'lunieapi pm2' && true || (crontab -l; echo "$line" ) | crontab -" diff --git a/data/networks.js b/data/networks.js new file mode 100644 index 0000000000..38b54096f1 --- /dev/null +++ b/data/networks.js @@ -0,0 +1,210 @@ +module.exports = [ + { + id: 'cosmos-hub-testnet', + title: 'Gaia Testnet', + chain_id: 'gaia-13007', + rpc_url: 'wss://gaia-13007.lunie.io:26657/websocket', + api_url: + 'https://gaia-13007--lcd.datahub.figment.network/apikey/' + + process.env.FIGMENT_GAIA_13007_API_KEY, + bech32_prefix: 'cosmos', + address_prefix: 'cosmos', + address_creator: 'cosmos', + ledger_app: 'cosmos', + source_class_name: 'source/cosmosV2-source', + block_listener_class_name: 'block-listeners/cosmos-node-subscription', + testnet: true, + feature_session: true, + feature_explore: true, + feature_portfolio: true, + feature_validators: true, + feature_proposals: true, + feature_activity: true, + feature_explorer: true, + action_send: true, + action_claim_rewards: true, + action_delegate: true, + action_redelegate: true, + action_undelegate: true, + action_deposit: true, + action_vote: true, + action_proposal: true, + default: false, + stakingDenom: 'MUON', + enabled: true, + icon: 'https://app.lunie.io/img/networks/cosmos-hub-mainnet.png', + slug: 'cosmos-hub-testnet' + }, + { + id: 'cosmos-hub-mainnet', + title: 'Cosmos Hub', + chain_id: 'cosmoshub-3', + rpc_url: 'wss://cosmos-hub-3.lunie.io/websocket', + api_url: + 'https://cosmoshub-3--lcd.datahub.figment.network/apikey/' + + process.env.FIGMENT_COSMOS_HUB_API_KEY, + bech32_prefix: 'cosmos', + address_prefix: 'cosmos', + address_creator: 'cosmos', + ledger_app: 'cosmos', + source_class_name: 'source/cosmosV2-source', + block_listener_class_name: 'block-listeners/cosmos-node-subscription', + testnet: false, + feature_session: true, + feature_explore: true, + feature_portfolio: true, + feature_validators: true, + feature_proposals: true, + feature_activity: true, + feature_explorer: true, + action_send: true, + action_claim_rewards: true, + action_delegate: true, + action_redelegate: true, + action_undelegate: true, + action_deposit: true, + action_vote: true, + action_proposal: true, + default: true, + stakingDenom: 'ATOM', + enabled: true, + icon: 'https://app.lunie.io/img/networks/cosmos-hub-mainnet.png', + slug: 'cosmos-hub' + }, + { + id: 'terra-mainnet', + title: 'Terra', + chain_id: 'columbus-3', + api_url: 'https://fcd.terra.dev/', + rpc_url: 'ws://52.78.43.42:26657/websocket', + bech32_prefix: 'terra', + address_prefix: 'terra', + address_creator: 'cosmos', + ledger_app: 'cosmos', + source_class_name: 'source/terraV3-source', + block_listener_class_name: 'block-listeners/cosmos-node-subscription', + testnet: false, + feature_session: true, + feature_explore: true, + feature_portfolio: true, + feature_validators: true, + feature_proposals: true, + feature_activity: true, + feature_explorer: true, + action_send: true, + action_claim_rewards: true, + action_delegate: true, + action_redelegate: true, + action_undelegate: true, + action_deposit: false, + action_vote: false, + action_proposal: false, + default: false, + stakingDenom: 'LUNA', + enabled: true, + icon: 'https://app.lunie.io/img/networks/terra-mainnet.png', + slug: 'terra' + }, + { + id: 'terra-testnet', + title: 'Terra Testnet', + chain_id: 'soju-0013', + api_url: 'https://terra-testnet.lunie.io', + rpc_url: 'wss://terra-testnet.lunie.io/websocket', + bech32_prefix: 'terra', + address_prefix: 'terra', + address_creator: 'cosmos', + ledger_app: 'cosmos', + source_class_name: 'source/terraV3-source', + block_listener_class_name: 'block-listeners/cosmos-node-subscription', + testnet: true, + feature_session: true, + feature_explore: true, + feature_portfolio: true, + feature_validators: true, + feature_proposals: false, + feature_activity: true, + feature_explorer: true, + action_send: true, + action_claim_rewards: true, + action_delegate: true, + action_redelegate: true, + action_undelegate: true, + action_deposit: false, + action_vote: false, + action_proposal: false, + default: false, + stakingDenom: 'LUNA', + enabled: true, + icon: 'https://app.lunie.io/img/networks/terra-testnet.png', + slug: 'terra-testnet' + }, + { + id: 'emoney-testnet', + title: 'e-Money Testnet', + chain_id: 'lilmermaid-5', + api_url: 'http://lilmermaid.validator.network/light', + rpc_url: 'wss://lilmermaid.validator.network/websocket', + bech32_prefix: 'emoney', + address_prefix: 'emoney', + address_creator: 'cosmos', + ledger_app: 'cosmos', + source_class_name: 'source/emoneyV0-source', + block_listener_class_name: 'block-listeners/cosmos-node-subscription', + testnet: true, + feature_session: true, + feature_explore: true, + feature_portfolio: true, + feature_validators: true, + feature_proposals: false, + feature_activity: true, + feature_explorer: true, + action_send: true, + action_claim_rewards: true, + action_delegate: true, + action_redelegate: true, + action_undelegate: true, + action_deposit: false, + action_vote: false, + action_proposal: false, + default: false, + stakingDenom: 'NGM', + enabled: true, + icon: 'https://app.lunie.io/img/networks/emoney-testnet.png', + slug: 'emoney-testnet' + }, + { + id: 'livepeer-mainnet', + title: 'Livepeer', + chain_id: 'ethereum-1', + api_url: 'https://livepeer-mainnet.lunie.io/', + rpc_url: 'wss://livepeer-mainnet.lunie.io/websocket', + bech32_prefix: '0x', + address_prefix: '0x', + address_creator: 'ethereum', + ledger_app: 'ethereum', + source_class_name: 'source/livepeerV0-source', + block_listener_class_name: 'block-listeners/livepeer-node-polling', + testnet: false, + feature_session: false, + feature_explore: true, + feature_portfolio: false, + feature_validators: true, + feature_proposals: false, + feature_activity: false, + feature_explorer: false, + action_send: false, + action_claim_rewards: false, + action_delegate: false, + action_redelegate: false, + action_undelegate: false, + action_deposit: false, + action_vote: false, + action_proposal: false, + default: false, + stakingDenom: 'LPT', + enabled: false, + icon: 'https://app.lunie.io/img/networks/livepeer-mainnet.png', + slug: 'livepeer' + } +] diff --git a/data/networks.json b/data/networks.json deleted file mode 100644 index 5136cefc9b..0000000000 --- a/data/networks.json +++ /dev/null @@ -1,206 +0,0 @@ -[ - { - "id": "cosmos-hub-testnet", - "title": "Gaia Testnet", - "chain_id": "gaia-13007", - "rpc_url": "wss://gaia-13007.lunie.io:26657/websocket", - "api_url": "https://gaia-13007.lunie.io", - "bech32_prefix": "cosmos", - "address_prefix": "cosmos", - "address_creator": "cosmos", - "ledger_app": "cosmos", - "source_class_name": "source/cosmosV2-source", - "block_listener_class_name": "block-listeners/cosmos-node-subscription", - "testnet": true, - "feature_session": true, - "feature_explore": true, - "feature_portfolio": true, - "feature_validators": true, - "feature_proposals": true, - "feature_activity": true, - "feature_explorer": true, - "action_send": true, - "action_claim_rewards": true, - "action_delegate": true, - "action_redelegate": true, - "action_undelegate": true, - "action_deposit": true, - "action_vote": true, - "action_proposal": true, - "default": false, - "stakingDenom": "MUON", - "enabled": true, - "icon": "https://app.lunie.io/img/networks/cosmos-hub-mainnet.png", - "slug": "cosmos-hub-testnet" - }, - { - "id": "cosmos-hub-mainnet", - "title": "Cosmos Hub", - "chain_id": "cosmoshub-3", - "rpc_url": "wss://cosmos-hub-3.lunie.io/websocket", - "api_url": "https://lcd.nylira.net", - "bech32_prefix": "cosmos", - "address_prefix": "cosmos", - "address_creator": "cosmos", - "ledger_app": "cosmos", - "source_class_name": "source/cosmosV2-source", - "block_listener_class_name": "block-listeners/cosmos-node-subscription", - "testnet": false, - "feature_session": true, - "feature_explore": true, - "feature_portfolio": true, - "feature_validators": true, - "feature_proposals": true, - "feature_activity": true, - "feature_explorer": true, - "action_send": true, - "action_claim_rewards": true, - "action_delegate": true, - "action_redelegate": true, - "action_undelegate": true, - "action_deposit": true, - "action_vote": true, - "action_proposal": true, - "default": true, - "stakingDenom": "ATOM", - "enabled": true, - "icon": "https://app.lunie.io/img/networks/cosmos-hub-mainnet.png", - "slug": "cosmos-hub" - }, - { - "id": "terra-mainnet", - "title": "Terra", - "chain_id": "columbus-3", - "api_url": "https://fcd.terra.dev/", - "rpc_url": "ws://52.78.43.42:26657/websocket", - "bech32_prefix": "terra", - "address_prefix": "terra", - "address_creator": "cosmos", - "ledger_app": "cosmos", - "source_class_name": "source/terraV3-source", - "block_listener_class_name": "block-listeners/cosmos-node-subscription", - "testnet": false, - "feature_session": true, - "feature_explore": true, - "feature_portfolio": true, - "feature_validators": true, - "feature_proposals": true, - "feature_activity": true, - "feature_explorer": true, - "action_send": true, - "action_claim_rewards": true, - "action_delegate": true, - "action_redelegate": true, - "action_undelegate": true, - "action_deposit": false, - "action_vote": false, - "action_proposal": false, - "default": false, - "stakingDenom": "LUNA", - "enabled": true, - "icon": "https://app.lunie.io/img/networks/terra-mainnet.png", - "slug": "terra" - }, - { - "id": "terra-testnet", - "title": "Terra Testnet", - "chain_id": "soju-0013", - "api_url": "https://terra-testnet.lunie.io", - "rpc_url": "wss://terra-testnet.lunie.io/websocket", - "bech32_prefix": "terra", - "address_prefix": "terra", - "address_creator": "cosmos", - "ledger_app": "cosmos", - "source_class_name": "source/terraV3-source", - "block_listener_class_name": "block-listeners/cosmos-node-subscription", - "testnet": true, - "feature_session": true, - "feature_explore": true, - "feature_portfolio": true, - "feature_validators": true, - "feature_proposals": false, - "feature_activity": true, - "feature_explorer": true, - "action_send": true, - "action_claim_rewards": true, - "action_delegate": true, - "action_redelegate": true, - "action_undelegate": true, - "action_deposit": false, - "action_vote": false, - "action_proposal": false, - "default": false, - "stakingDenom": "LUNA", - "enabled": true, - "icon": "https://app.lunie.io/img/networks/terra-testnet.png", - "slug": "terra-testnet" - }, - { - "id": "emoney-testnet", - "title": "e-Money Testnet", - "chain_id": "lilmermaid-5", - "api_url": "http://lilmermaid.validator.network/light", - "rpc_url": "wss://lilmermaid.validator.network/websocket", - "bech32_prefix": "emoney", - "address_prefix": "emoney", - "address_creator": "cosmos", - "ledger_app": "cosmos", - "source_class_name": "source/emoneyV0-source", - "block_listener_class_name": "block-listeners/cosmos-node-subscription", - "testnet": true, - "feature_session": true, - "feature_explore": true, - "feature_portfolio": true, - "feature_validators": true, - "feature_proposals": false, - "feature_activity": true, - "feature_explorer": true, - "action_send": true, - "action_claim_rewards": true, - "action_delegate": true, - "action_redelegate": true, - "action_undelegate": true, - "action_deposit": false, - "action_vote": false, - "action_proposal": false, - "default": false, - "stakingDenom": "NGM", - "enabled": true, - "icon": "https://app.lunie.io/img/networks/emoney-testnet.png", - "slug": "emoney-testnet" - }, - { - "id": "livepeer-mainnet", - "title": "Livepeer", - "chain_id": "ethereum-1", - "api_url": "https://livepeer-mainnet.lunie.io/", - "rpc_url": "wss://livepeer-mainnet.lunie.io/websocket", - "bech32_prefix": "0x", - "address_prefix": "0x", - "address_creator": "ethereum", - "ledger_app": "ethereum", - "source_class_name": "source/livepeerV0-source", - "block_listener_class_name": "block-listeners/livepeer-node-polling", - "testnet": false, - "feature_session": false, - "feature_explore": true, - "feature_portfolio": false, - "feature_validators": true, - "feature_proposals": false, - "feature_activity": false, - "feature_explorer": false, - "action_send": false, - "action_claim_rewards": false, - "action_delegate": false, - "action_redelegate": false, - "action_undelegate": false, - "action_deposit": false, - "action_vote": false, - "action_proposal": false, - "default": false, - "stakingDenom": "LPT", - "enabled": false, - "icon": "https://app.lunie.io/img/networks/livepeer-mainnet.png", - "slug": "livepeer" - } -] \ No newline at end of file diff --git a/lib/networks.js b/lib/networks.js index 2fa6745dce..629614edf5 100644 --- a/lib/networks.js +++ b/lib/networks.js @@ -1,6 +1,6 @@ const { keyBy } = require('lodash') const config = require('../config') -const networksMain = require('../data/networks.json') +const networksMain = require('../data/networks.js') const networksLocal = require('../data/networks-local.js') let networks = networksMain