Skip to content

Commit df2ddd5

Browse files
authored
Merge pull request #44 from XLabs/assistant-component
Contract Configuration Assistant
2 parents 0eb3b9f + c6e0f71 commit df2ddd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+14933
-4976
lines changed

deploy/tbo.deployment.yaml deploy/assistant.deployment.yaml

+16-8
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@
33
apiVersion: apps/v1
44
kind: Deployment
55
metadata:
6-
name: token-bridge-oracle
6+
name: token-bridge-assistant
77
namespace: token-bridge-relayer
88
labels:
99
app: token-bridge-relayer
1010
spec:
1111
selector:
1212
matchLabels:
13-
app: token-bridge-oracle
13+
app: token-bridge-assistant
1414
replicas: 1
1515
template:
1616
metadata:
1717
labels:
18-
app: token-bridge-oracle
18+
app: token-bridge-assistant
1919
spec:
2020
restartPolicy: Always
2121
containers:
2222
- name: relayer
2323
image: $AWS_ACCOUNT.dkr.ecr.us-east-2.amazonaws.com/token-bridge-relayer:$TAG
24-
command: ["node", "offchain/src/oracle/index.js"]
24+
command: ["node", "offchain/src/assistant/index.js"]
2525
imagePullPolicy: Always
26-
# uncomment to explore filesystem during crash loop
27-
# command: [ "/bin/sh", "-c", "--" ]
28-
# args: [ "while true; do sleep 30; done;" ]
2926
resources:
3027
requests:
3128
memory: 600Mi
3229
limits:
3330
cpu: 1000m
3431
memory: 2000Mi
32+
volumeMounts:
33+
- name: wallet-monitor-config
34+
mountPath: /usr/src/app/config
3535
envFrom:
3636
- configMapRef:
37-
name: token-bridge-oracle-env
37+
name: token-bridge-assistant-env
3838
optional: false
3939
- configMapRef:
4040
name: sui-env
@@ -45,3 +45,11 @@ spec:
4545
- configMapRef:
4646
name: evm-env
4747
optional: false
48+
volumes:
49+
- name: wallet-monitor-config
50+
configMap:
51+
name: token-bridge-assistant-env
52+
defaultMode: 420
53+
items:
54+
- key: WALLET_MONITORING_CONFIG
55+
path: wallet_monitoring.json

deploy/tbo.service.yaml deploy/assistant.service.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: token-bridge-oracle
4+
name: token-bridge-assistant
55
namespace: token-bridge-relayer
66
annotations:
77
prometheus.io/scrape: "true"
88
spec:
99
selector:
10-
app: token-bridge-oracle
10+
app: token-bridge-assistant
1111
ports:
1212
- name: api
1313
protocol: TCP

deploy/deploy-assistant.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
if [ $# -ne 2 ]; then
2+
echo "Please specify the tag as the second parameter"
3+
exit 1
4+
fi
5+
6+
if [[ "$1" == "--testnet" ]]; then
7+
kubectl apply -f testnet/assistant.configmap.yaml
8+
kubetpl render ./assistant.deployment.yaml -s AWS_ACCOUNT="$AWS_ACCOUNT_STAGING" -s TAG="$2" | kubectl apply -f -
9+
elif [[ "$1" == "--mainnet" ]]; then
10+
kubectl apply -f mainnet/assistant.configmap.yaml
11+
kubetpl render ./assistant.deployment.yaml -s AWS_ACCOUNT="$AWS_ACCOUNT_PRODUCTION" -s TAG="$2" | kubectl apply -f -
12+
else
13+
echo "Invalid argument. Please use --testnet or --mainnet. and the tag as a positional parameter. Example: ./deploy.sh --testnet 2.0.1"
14+
exit 1
15+
fi
16+
17+
kubectl apply -f assistant.service.yaml

deploy/deploy-oracle.sh

-19
This file was deleted.
+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: token-bridge-assistant-env
5+
namespace: token-bridge-relayer
6+
data:
7+
NODE_ENV: staging
8+
BLOCKCHAIN_ENV: mainnet
9+
DRY_RUN_ENABLED: "true"
10+
FETCH_PRICE_INTERVAL_IN_MS: "60000"
11+
MIN_FEE_CHANGE_PCT: "5"
12+
MAX_FEE_CHANGE_PCT: "40"
13+
MIN_SWAP_RATE_CHANGE_PCT: "2"
14+
MAX_SWAP_RATE_CHANGE_PCT: "20"
15+
MIN_FLAT_FEE: "100000000"
16+
MAX_FLAT_FEE: "200000000"
17+
SOLANA_RPC_HTTP: "https://rpc.ankr.com/solana/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
18+
ETH_RPC_HTTP: "https://rpc.ankr.com/eth/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
19+
AVAX_RPC_HTTP: "https://rpc.ankr.com/avalanche/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
20+
BSC_RPC_HTTP: "https://rpc.ankr.com/bsc/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
21+
FTM_RPC_HTTP: "https://rpc.ankr.com/fantom/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
22+
CELO_RPC_HTTP: "https://rpc.ankr.com/celo/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
23+
MOONBEAM_RPC_HTTP: "https://rpc.ankr.com/moonbeam/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
24+
POLYGON_RPC_HTTP: "https://rpc.ankr.com/polygon/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
25+
BASE_RPC_HTTP: "https://rpc.ankr.com/base/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
26+
WALLET_MONITORING_CONFIG_PATH: "/usr/src/app/wallet_monitoring.json"
27+
WALLET_MONITORING_CONFIG: |
28+
{
29+
"rewardAddress": {
30+
"1": ["AdAVF5KmmGmpNQhjY7FL96wZLEynD6Mx3VXJTZf2yFps"],
31+
"2": ["0x53207E216540125e322CdA8A693b0b89576DEb46"],
32+
"4": ["0x53207E216540125e322CdA8A693b0b89576DEb46"],
33+
"5": ["0x53207E216540125e322CdA8A693b0b89576DEb46"],
34+
"6": ["0x53207E216540125e322CdA8A693b0b89576DEb46"],
35+
"10": ["0x53207E216540125e322CdA8A693b0b89576DEb46"],
36+
"14": ["0x53207E216540125e322CdA8A693b0b89576DEb46"],
37+
"16": ["0x53207E216540125e322CdA8A693b0b89576DEb46"],
38+
"21": ["0xaf5a8efe63a4e53622efcbb981293b3ef01b7ce73ae3fbd72779e41f18d2a68a"],
39+
"30": ["0x53207E216540125e322CdA8A693b0b89576DEb46"]
40+
},
41+
"walletConfig": {
42+
"1": {
43+
"network": "mainnet-beta"
44+
},
45+
"2": {
46+
"network": "mainnet"
47+
},
48+
"4": {
49+
"network": "mainnet"
50+
},
51+
"5": {
52+
"network": "mainnet"
53+
},
54+
"6": {
55+
"network": "mainnet"
56+
},
57+
"10": {
58+
"network": "mainnet"
59+
},
60+
"14": {
61+
"network": "mainnet"
62+
},
63+
"16": {
64+
"network": "moonbeam-mainnet"
65+
},
66+
"21": {
67+
"network": "mainnet"
68+
},
69+
"30": {
70+
"network": "mainnet"
71+
}
72+
}
73+
}

deploy/mainnet/tbo.configmap.yaml

-15
This file was deleted.
+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: token-bridge-assistant-env
5+
namespace: token-bridge-relayer
6+
data:
7+
NODE_ENV: staging
8+
BLOCKCHAIN_ENV: testnet
9+
FETCH_PRICE_INTERVAL_IN_MS: "60000"
10+
MIN_FEE_CHANGE_PCT: "2"
11+
MAX_FEE_CHANGE_PCT: "25"
12+
API_PORT: "3500"
13+
DRY_RUN_ENABLED: "true"
14+
LOG_LEVEL: "debug"
15+
SOLANA_RPC_HTTP: "https://rpc.ankr.com/solana_devnet/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
16+
ETH_RPC_HTTP: "https://rpc.ankr.com/eth_goerli/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
17+
AVAX_RPC_HTTP: "https://rpc.ankr.com/avalanche_fuji/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
18+
BSC_RPC_HTTP: "https://rpc.ankr.com/bsc_testnet_chapel/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
19+
FTM_RPC_HTTP: "https://rpc.ankr.com/fantom_testnet/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
20+
# CELO_RPC_HTTP:
21+
POLYGON_RPC_HTTP: "https://rpc.ankr.com/polygon_mumbai/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
22+
BASE_RPC_HTTP: "https://rpc.ankr.com/base_goerli/cc709e78c0f29cc0b40ecca0db99f91878e57bdf68daa27653882adef5bc8e14"
23+
WALLET_MONITORING_CONFIG_PATH: "/usr/src/app/config/wallet_monitoring.json"
24+
WALLET_MONITORING_CONFIG: |
25+
{
26+
"rewardAddress": {
27+
"1": ["7erdYqdCRC6KaWebtCbg14nPecN8Yib7xyfayXQhQ1dQ"],
28+
"2": ["0xF76528C059C8A1a503D6cD891646CE91221838B6"],
29+
"4": ["0xF76528C059C8A1a503D6cD891646CE91221838B6"],
30+
"5": ["0xF76528C059C8A1a503D6cD891646CE91221838B6"],
31+
"6": ["0xF76528C059C8A1a503D6cD891646CE91221838B6"],
32+
"10": ["0xF76528C059C8A1a503D6cD891646CE91221838B6"],
33+
"14": ["0xF76528C059C8A1a503D6cD891646CE91221838B6"],
34+
"16": ["0xF76528C059C8A1a503D6cD891646CE91221838B6"],
35+
"21": ["0xad3543ba687c79b591304723e76e05074a64eea3d80372776c2d5b069f952b60"],
36+
"30": ["0xF76528C059C8A1a503D6cD891646CE91221838B6"]
37+
},
38+
"walletConfig": {
39+
"1": {
40+
"network": "solana-devnet"
41+
},
42+
"2": {
43+
"network": "goerli"
44+
},
45+
"4": {
46+
"network": "testnet"
47+
},
48+
"5": {
49+
"network": "mumbai"
50+
},
51+
"6": {
52+
"network": "testnet"
53+
},
54+
"10": {
55+
"network": "testnet"
56+
},
57+
"14": {
58+
"network": "alfajores"
59+
},
60+
"16": {
61+
"network": "moonbase-alpha"
62+
},
63+
"21": {
64+
"network": "testnet"
65+
},
66+
"30": {
67+
"network": "goerli"
68+
}
69+
}
70+
}
71+

deploy/testnet/tbo.configmap.yaml

-12
This file was deleted.

0 commit comments

Comments
 (0)