Skip to content

Commit

Permalink
Fix asset service for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy committed Nov 12, 2020
1 parent 9db5f43 commit 1a6a193
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT=3000
NETWORK=testnet
API_MODE=REMOTE
BASE_URL=http://localhost:3000
BACKEND_PASSWORD=secret
Expand All @@ -10,6 +11,7 @@ ETH_GAS_PRICE=100000000000
ETH_GAS_LIMIT=4712388

HMY_NODE_URL='https://api.s0.b.hmny.io'
HMY_CHAIN_ID=2
GAS_LIMIT=6721900
GAS_PRICE=1000000000

Expand All @@ -29,6 +31,8 @@ HMY_LINK_MANAGER_CONTRACT=0x32b473d012bea1a7b54df2fa4d9451fc2e37d5e9
ETH_EXPLORER_URL=https://kovan.etherscan.io
HMY_EXPLORER_URL=https://explorer.testnet.harmony.one/#

ASSETS_INFO_SERVICE=https://testnet.bridge.hmny.io:8084

ETH_GAS_API_KEY=babbb3d37bf13922c3c0cd578aa97b97116930b18461d1db2663059edeb1

THRESHOLD=2
Expand Down
3 changes: 3 additions & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT=3000
NETWORK=mainnet
API_MODE=REMOTE
BASE_URL=http://localhost:3000
BACKEND_PASSWORD=secret
Expand Down Expand Up @@ -30,6 +31,8 @@ HMY_LINK_MANAGER_CONTRACT=0xc0c7b147910ef11f6454dc1918ecde9a2b64a3a8
ETH_EXPLORER_URL=https://etherscan.io
HMY_EXPLORER_URL=https://explorer.harmony.one/#

ASSETS_INFO_SERVICE=https://be4.bridge.hmny.io

ETH_GAS_API_KEY=babbb3d37bf13922c3c0cd578aa97b97116930b18461d1db2663059edeb1

THRESHOLD=2
Expand Down
3 changes: 3 additions & 0 deletions .env.testnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT=3000
NETWORK=testnet
API_MODE=REMOTE
BASE_URL=http://localhost:3000
BACKEND_PASSWORD=secret
Expand Down Expand Up @@ -30,6 +31,8 @@ HMY_LINK_MANAGER_CONTRACT=0x32b473d012bea1a7b54df2fa4d9451fc2e37d5e9
ETH_EXPLORER_URL=https://kovan.etherscan.io
HMY_EXPLORER_URL=https://explorer.testnet.harmony.one/#

ASSETS_INFO_SERVICE=https://testnet.bridge.hmny.io:8084

ETH_GAS_API_KEY=babbb3d37bf13922c3c0cd578aa97b97116930b18461d1db2663059edeb1

THRESHOLD=2
Expand Down
5 changes: 5 additions & 0 deletions appengine-servers.testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
"https://testnet.bridge.hmny.io:8081",
"https://testnet.bridge.hmny.io:8082",
"https://testnet.bridge.hmny.io:8083"
]
3 changes: 3 additions & 0 deletions config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ function getClientEnvironment(publicUrl) {

ETH_GAS_API_KEY: process.env.ETH_GAS_API_KEY,

ASSETS_INFO_SERVICE: process.env.ASSETS_INFO_SERVICE,
NETWORK: process.env.NETWORK,

ETH_NODE_URL: process.env.ETH_NODE_URL,
ETH_GAS_PRICE: process.env.ETH_GAS_PRICE,
ETH_GAS_LIMIT: process.env.ETH_GAS_LIMIT,
Expand Down
8 changes: 6 additions & 2 deletions src/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { IOperation, ITokenInfo } from '../stores/interfaces';
import * as agent from 'superagent';

const servers = require('../../appengine-servers.json');
let servers = require('../../appengine-servers.json');

if(process.env.NETWORK === 'testnet') {
servers = require('../../appengine-servers.testnet.json');
}

const threshold = process.env.THRESHOLD;

Expand Down Expand Up @@ -116,7 +120,7 @@ export const getTokensInfo = async (
params: any,
): Promise<{ content: ITokenInfo[] }> => {
const res = await agent.get<{ body: ITokenInfo[] }>(
'https://be4.bridge.hmny.io' + '/tokens/',
process.env.ASSETS_INFO_SERVICE + '/tokens/',
params,
);

Expand Down
2 changes: 1 addition & 1 deletion src/themes/baseTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const baseTheme: any = {
inputTextColor: 'black',
inputBorderRadius: 4,

brandTitle: 'Rusal classic theme',
brandTitle: 'Bridge base theme',
brandUrl: 'https://example.com',
brandImage: 'https://placehold.it/350x150',

Expand Down

0 comments on commit 1a6a193

Please sign in to comment.