parallel parsing

This commit is contained in:
thloyi
2026-01-07 21:15:54 +08:00
parent b82b7d9b0e
commit d9aea3e8d7
8 changed files with 290 additions and 163 deletions

View File

@@ -75,7 +75,7 @@ func main() {
<-exitSignal
cancel()
}()
shrederClient.EnableClientStats = true
// async read from shreder
txCh := make(chan shreder.TxSignalBatch, 1000)
go func() {
@@ -94,8 +94,8 @@ func main() {
case txBatch := <-txCh:
//jsonData, _ := json.MarshalIndent(txBatch, "", " ")
for _, tx := range txBatch {
if tx.Label == "dflow" {
fmt.Println("===============", tx.TxHash, tx.Event, tx.Token0Address, "token:", tx.Token0Amount)
if tx.Label == "okxdexroutev2" {
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)