Files

27 lines
594 B
Go
Raw Permalink Normal View History

2025-07-26 01:25:48 +08:00
package task
import (
"context"
"time"
2025-07-26 01:25:48 +08:00
"github.com/smallnest/chanx"
"github.com/v03413/bepusdt/app/conf"
"github.com/v03413/bepusdt/app/utils"
2025-07-26 01:25:48 +08:00
)
func arbitrumInit() {
ctx := context.Background()
2025-07-27 16:11:16 +08:00
arb := evm{
2025-10-13 11:27:38 +08:00
Network: conf.Arbitrum,
2025-07-26 01:25:48 +08:00
Block: block{
ConfirmedOffset: 40,
},
Client: utils.NewHttpClient(),
blockScanQueue: chanx.NewUnboundedChan[evmBlock](ctx, 30),
2025-07-26 01:25:48 +08:00
}
2025-10-13 11:27:38 +08:00
Register(Task{Callback: arb.blockDispatch})
Register(Task{Callback: arb.syncBlocksForward, Duration: time.Second * 5})
2025-10-13 11:27:38 +08:00
Register(Task{Callback: arb.tradeConfirmHandle, Duration: time.Second * 5})
2025-07-26 01:25:48 +08:00
}