split program source file

This commit is contained in:
thloyi
2026-01-28 14:11:34 +08:00
parent 35c5c83f4b
commit dab77c0b61
25 changed files with 2597 additions and 2179 deletions

View File

@@ -76,7 +76,7 @@ func main() {
cancel()
}()
// async read from shreder
txCh := make(chan shreder.TxSignalBatch, 1000)
txCh := make(chan shreder.TxSignal, 1000)
go func() {
err := shrederClient.ReadSync(ctx, txCh)
if err != nil {
@@ -90,14 +90,10 @@ func main() {
select {
case <-ctx.Done():
return
case txBatch := <-txCh:
//jsonData, _ := json.MarshalIndent(txBatch, "", " ")
for _, tx := range txBatch {
if tx.Label == "okxdexroutev2" || tx.Label == "jupiterv6" || tx.Label == "dflow" {
fmt.Println("===============", tx.TxHash, tx.Label, tx.Event, tx.Token0Address, "token:", tx.Token0Amount, "parse time:", tx.ParseEnd.Sub(tx.ParseStart))
}
case tx := <-txCh:
if tx.Label == "okxdexroutev2" || tx.Label == "jupiterv6" || tx.Label == "dflow" {
fmt.Println("===============", tx.TxHash, tx.Label, tx.Event, tx.Token0Address, "token:", tx.Token0Amount, "parse time:", tx.ParseEnd.Sub(tx.ParseStart))
}
//fmt.Println(txBatch[0].TxHash)
}
}
}