|
|
@@ -75,6 +75,9 @@ var (
|
|
|
ethRopstenRPC *string
|
|
|
ethRopstenContract *string
|
|
|
|
|
|
+ fantomRPC *string
|
|
|
+ fantomContract *string
|
|
|
+
|
|
|
avalancheRPC *string
|
|
|
avalancheContract *string
|
|
|
|
|
|
@@ -155,6 +158,9 @@ func init() {
|
|
|
oasisRPC = NodeCmd.Flags().String("oasisRPC", "", "Oasis RPC URL")
|
|
|
oasisContract = NodeCmd.Flags().String("oasisContract", "", "Oasis contract address")
|
|
|
|
|
|
+ fantomRPC = NodeCmd.Flags().String("fantomRPC", "", "Fantom Websocket RPC URL")
|
|
|
+ fantomContract = NodeCmd.Flags().String("fantomContract", "", "Fantom contract address")
|
|
|
+
|
|
|
terraWS = NodeCmd.Flags().String("terraWS", "", "Path to terrad root for websocket connection")
|
|
|
terraLCD = NodeCmd.Flags().String("terraLCD", "", "Path to LCD service root for http calls")
|
|
|
terraContract = NodeCmd.Flags().String("terraContract", "", "Wormhole contract address on Terra blockchain")
|
|
|
@@ -281,6 +287,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
|
|
readiness.RegisterComponent(common.ReadinessOasisSyncing)
|
|
|
if *testnetMode {
|
|
|
readiness.RegisterComponent(common.ReadinessEthRopstenSyncing)
|
|
|
+ readiness.RegisterComponent(common.ReadinessFantomSyncing)
|
|
|
}
|
|
|
|
|
|
if *statusAddr != "" {
|
|
|
@@ -324,6 +331,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
|
|
*polygonContract = devnet.GanacheWormholeContractAddress.Hex()
|
|
|
*avalancheContract = devnet.GanacheWormholeContractAddress.Hex()
|
|
|
*oasisContract = devnet.GanacheWormholeContractAddress.Hex()
|
|
|
+ *fantomContract = devnet.GanacheWormholeContractAddress.Hex()
|
|
|
}
|
|
|
|
|
|
// Verify flags
|
|
|
@@ -371,6 +379,12 @@ func runNode(cmd *cobra.Command, args []string) {
|
|
|
if *ethRopstenContract == "" {
|
|
|
logger.Fatal("Please specify --ethRopstenContract")
|
|
|
}
|
|
|
+ if *fantomRPC == "" {
|
|
|
+ logger.Fatal("Please specify --fantomRPC")
|
|
|
+ }
|
|
|
+ if *fantomContract == "" {
|
|
|
+ logger.Fatal("Please specify --fantomContract")
|
|
|
+ }
|
|
|
} else {
|
|
|
if *ethRopstenRPC != "" {
|
|
|
logger.Fatal("Please do not specify --ethRopstenRPC in non-testnet mode")
|
|
|
@@ -378,6 +392,12 @@ func runNode(cmd *cobra.Command, args []string) {
|
|
|
if *ethRopstenContract != "" {
|
|
|
logger.Fatal("Please do not specify --ethRopstenContract in non-testnet mode")
|
|
|
}
|
|
|
+ if *fantomRPC == "" {
|
|
|
+ logger.Fatal("Please do not specify --fantomRPC in non-testnet mode")
|
|
|
+ }
|
|
|
+ if *fantomContract == "" {
|
|
|
+ logger.Fatal("Please do not specify --fantomContract in non-testnet mode")
|
|
|
+ }
|
|
|
}
|
|
|
if *nodeName == "" {
|
|
|
logger.Fatal("Please specify --nodeName")
|
|
|
@@ -462,6 +482,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
|
|
ethRopstenContractAddr := eth_common.HexToAddress(*ethRopstenContract)
|
|
|
avalancheContractAddr := eth_common.HexToAddress(*avalancheContract)
|
|
|
oasisContractAddr := eth_common.HexToAddress(*oasisContract)
|
|
|
+ fantomContractAddr := eth_common.HexToAddress(*fantomContract)
|
|
|
solAddress, err := solana_types.PublicKeyFromBase58(*solanaContract)
|
|
|
if err != nil {
|
|
|
logger.Fatal("invalid Solana contract address", zap.Error(err))
|
|
|
@@ -546,6 +567,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
|
|
chainObsvReqC[vaa.ChainIDAvalanche] = make(chan *gossipv1.ObservationRequest)
|
|
|
chainObsvReqC[vaa.ChainIDOasis] = make(chan *gossipv1.ObservationRequest)
|
|
|
if *testnetMode {
|
|
|
+ chainObsvReqC[vaa.ChainIDFantom] = make(chan *gossipv1.ObservationRequest)
|
|
|
chainObsvReqC[vaa.ChainIDEthereumRopsten] = make(chan *gossipv1.ObservationRequest)
|
|
|
}
|
|
|
|
|
|
@@ -684,12 +706,15 @@ func runNode(cmd *cobra.Command, args []string) {
|
|
|
ethereum.NewEthWatcher(*oasisRPC, oasisContractAddr, "oasis", common.ReadinessOasisSyncing, vaa.ChainIDOasis, lockC, nil, 1, chainObsvReqC[vaa.ChainIDOasis]).Run); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
-
|
|
|
if *testnetMode {
|
|
|
if err := supervisor.Run(ctx, "ethropstenwatch",
|
|
|
ethereum.NewEthWatcher(*ethRopstenRPC, ethRopstenContractAddr, "ethropsten", common.ReadinessEthRopstenSyncing, vaa.ChainIDEthereumRopsten, lockC, setC, 1, chainObsvReqC[vaa.ChainIDEthereumRopsten]).Run); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+ if err := supervisor.Run(ctx, "fantomwatch",
|
|
|
+ ethereum.NewEthWatcher(*fantomRPC, fantomContractAddr, "fantom", common.ReadinessFantomSyncing, vaa.ChainIDFantom, lockC, nil, 1, chainObsvReqC[vaa.ChainIDFantom]).Run); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Start Terra watcher only if configured
|