@@ -0,0 +1,25 @@
+package arbitrage
+
+import (
+ "github.com/ethereum/go-ethereum/node"
+ "github.com/urfave/cli/v2"
+)
+type HistoryArbitrage struct {
+ Stack *node.Node
+ Context *cli.Context
+}
+func (h HistoryArbitrage) Register() {
+ h.Stack.RegisterLifecycle(h)
+func (h HistoryArbitrage) Start() error {
+ HistoryLog("Hi, I am history arbitrage bot.")
+ return nil
+func (h HistoryArbitrage) Stop() error {
@@ -0,0 +1,7 @@
+import "github.com/ethereum/go-ethereum/log"
+func HistoryLog(msg string) {
+ log.Info("~~~~~~~~~~~~~~HistoryLog~~~~~~~~~~~~~~ " + msg)
@@ -19,6 +19,7 @@ package main
import (
"fmt"
+ "github.com/ethereum/go-ethereum/arbitrage"
"os"
"sort"
"strconv"
@@ -350,6 +351,12 @@ func geth(ctx *cli.Context) error {
stack, backend := makeFullNode(ctx)
defer stack.Close()
+ // 历史记录套利系统注入到系统生命周期
+ arbitrage.HistoryArbitrage{
+ Stack: stack,
+ Context: ctx,
+ }.Register()
startNode(ctx, stack, backend, false)
stack.Wait()
return nil