Skip to content

Commit

Permalink
Rename ethwatch to ethlockup and run it in a runnable group with the …
Browse files Browse the repository at this point in the history
…watcher

This ensures that we re-fetch the guardian set when ethlockup dies.
  • Loading branch information
Leo committed Aug 21, 2020
1 parent eca9f62 commit d317164
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
File renamed without changes.
13 changes: 6 additions & 7 deletions bridge/cmd/guardiand/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,18 @@ func main() {
return err
}

if err := supervisor.Run(ctx, "eth",
ethereum.NewEthBridgeWatcher(*ethRPC, ethContractAddr, *ethConfirmations, lockC, setC).Run); err != nil {
return err
}
// We need to re-fetch the initial initiator set when ethwatch dies, so we want to restart the watcher as well.
// TODO: on-demand fetching of guardian set to avoid restarting ethwatch?
supervisor.RunGroup(ctx, map[string]supervisor.Runnable{
"ethwatch": ethereum.NewEthBridgeWatcher(*ethRPC, ethContractAddr, *ethConfirmations, lockC, setC).Run,
"ethlockup": ethLockupProcessor(lockC, setC, gk, sendC, ethObsvC, vaaC),
})

if err := supervisor.Run(ctx, "solana",
solana.NewSolanaBridgeWatcher(*agentRPC, lockC, vaaC).Run); err != nil {
return err
}

if err := supervisor.Run(ctx, "ethwatch", ethLockupProcessor(lockC, setC, gk, sendC, ethObsvC, vaaC)); err != nil {
return err
}

logger.Info("Started internal services")
supervisor.Signal(ctx, supervisor.SignalHealthy)
Expand Down

0 comments on commit d317164

Please sign in to comment.