Rename ethwatch to ethlockup and run it in a runnable group with the watcher

This ensures that we re-fetch the guardian set when ethlockup dies.
This commit is contained in:
Leo 2020-08-21 11:17:55 +02:00
parent eca9f6214a
commit d317164345
2 changed files with 6 additions and 7 deletions

View File

@ -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)