-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.ts
119 lines (111 loc) · 2.79 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import * as dotenv from 'dotenv';
dotenv.config();
import { initDb } from './databases/utils';
import { Mode, getNetwork, getMode } from '@wormhole-foundation/wormhole-monitor-common';
import { startSupervisor } from './workers/supervisor';
import { Chain, Network } from '@wormhole-foundation/sdk-base';
import { FTEVMMainnetChains, FTEVMTestnetChains } from './fastTransfer/consts';
initDb();
const network: Network = getNetwork();
const mode: Mode = getMode();
// NOTE: supportedChains is in chainId order
const supportedChains: Chain[] =
network === 'Testnet'
? [
// NOTE: The commented out chains are left in there to easily
// identify which chains are not supported on testnet.
'Solana',
// 'Ethereum',
// 'Terra',
'Bsc',
// 'Polygon',
'Avalanche',
'Oasis',
'Algorand',
'Fantom',
// 'Karura',
// 'Acala',
'Klaytn',
'Celo',
// 'Near',
'Moonbeam',
// 'Terra2',
// 'Injective',
'Sui',
'Aptos',
// 'Arbitrum',
// 'Optimism',
'Xpla',
// 'Base',
// 'Sei',
'Blast',
'Scroll',
'Wormchain',
'Sepolia',
'ArbitrumSepolia',
'BaseSepolia',
'OptimismSepolia',
'Holesky',
'PolygonSepolia',
'Berachain',
'Seievm',
'Snaxchain',
'Unichain',
'Worldchain',
'Monad',
'Ink',
// 'HyperEVM',
'Movement',
'Mezo',
]
: [
// This is the list of chains supported in MAINNET.
'Solana',
'Ethereum',
'Terra',
'Bsc',
'Polygon',
'Avalanche',
'Oasis',
'Algorand',
'Fantom',
'Karura',
'Acala',
'Klaytn',
'Celo',
'Near',
'Moonbeam',
'Terra2',
'Injective',
'Sui',
'Aptos',
'Arbitrum',
'Optimism',
'Xpla',
'Base',
'Sei',
'Scroll',
'Mantle',
'Blast',
'Xlayer',
'Berachain',
'Snaxchain',
'Unichain',
'Worldchain',
'Wormchain',
];
const supportedNTTChains: Chain[] =
network === 'Testnet'
? ['Solana', 'Sepolia', 'ArbitrumSepolia', 'BaseSepolia', 'OptimismSepolia']
: ['Solana', 'Ethereum', 'Fantom', 'Arbitrum', 'Optimism', 'Base'];
const supportedFTChains: Chain[] =
network === 'Testnet' ? ['Solana', ...FTEVMTestnetChains] : ['Solana', ...FTEVMMainnetChains];
if (mode === 'vaa') {
startSupervisor(supportedChains);
} else if (mode === 'ntt') {
startSupervisor(supportedNTTChains);
} else if (mode === 'ft') {
startSupervisor(supportedFTChains);
} else {
throw new Error(`Unknown mode: ${mode}`);
}