node/pkg/ethereum: readiness status for bsc
Bug: certusone/wormhole#292 Change-Id: Ibb176dc70beeb2c00c7faf7d85395e93d53e9e4c
This commit is contained in:
parent
b28c76618a
commit
b77d408235
|
@ -418,12 +418,12 @@ func runBridge(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
|
||||
if err := supervisor.Run(ctx, "ethwatch",
|
||||
ethereum.NewEthBridgeWatcher(*ethRPC, ethContractAddr, "eth", vaa.ChainIDEthereum, lockC, setC).Run); err != nil {
|
||||
ethereum.NewEthBridgeWatcher(*ethRPC, ethContractAddr, "eth", common.ReadinessEthSyncing, vaa.ChainIDEthereum, lockC, setC).Run); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := supervisor.Run(ctx, "bscwatch",
|
||||
ethereum.NewEthBridgeWatcher(*bscRPC, bscContractAddr, "bsc", vaa.ChainIDBSC, lockC, nil).Run); err != nil {
|
||||
ethereum.NewEthBridgeWatcher(*bscRPC, bscContractAddr, "bsc", common.ReadinessBSCSyncing, vaa.ChainIDBSC, lockC, nil).Run); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -6,4 +6,5 @@ const (
|
|||
ReadinessEthSyncing readiness.Component = "ethSyncing"
|
||||
ReadinessSolanaSyncing readiness.Component = "solanaSyncing"
|
||||
ReadinessTerraSyncing readiness.Component = "terraSyncing"
|
||||
ReadinessBSCSyncing readiness.Component = "bscSyncing"
|
||||
)
|
||||
|
|
|
@ -67,6 +67,8 @@ type (
|
|||
bridge eth_common.Address
|
||||
// Human-readable name of the Eth network, for logging and monitoring.
|
||||
networkName string
|
||||
// Readiness component
|
||||
readiness readiness.Component
|
||||
// VAA ChainID of the network we're connecting to.
|
||||
chainID vaa.ChainID
|
||||
|
||||
|
@ -98,6 +100,7 @@ func NewEthBridgeWatcher(
|
|||
url string,
|
||||
bridge eth_common.Address,
|
||||
networkName string,
|
||||
readiness readiness.Component,
|
||||
chainID vaa.ChainID,
|
||||
messageEvents chan *common.MessagePublication,
|
||||
setEvents chan *common.GuardianSet) *EthBridgeWatcher {
|
||||
|
@ -105,6 +108,7 @@ func NewEthBridgeWatcher(
|
|||
url: url,
|
||||
bridge: bridge,
|
||||
networkName: networkName,
|
||||
readiness: readiness,
|
||||
chainID: chainID,
|
||||
msgChan: messageEvents,
|
||||
setChan: setEvents,
|
||||
|
@ -278,7 +282,7 @@ func (e *EthBridgeWatcher) Run(ctx context.Context) error {
|
|||
logger.Info("processing new header", zap.Stringer("block", ev.Number),
|
||||
zap.String("eth_network", e.networkName))
|
||||
currentEthHeight.WithLabelValues(e.networkName).Set(float64(ev.Number.Int64()))
|
||||
readiness.SetReady(common.ReadinessEthSyncing)
|
||||
readiness.SetReady(e.readiness)
|
||||
p2p.DefaultRegistry.SetNetworkStats(e.chainID, &gossipv1.Heartbeat_Network{
|
||||
Height: ev.Number.Int64(),
|
||||
BridgeAddress: e.bridge.Hex(),
|
||||
|
|
Loading…
Reference in New Issue