mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-18 04:40:03 +02:00
ship_processor.go: also publish transactions to redis.
This commit is contained in:
parent
93c9f8a721
commit
6cdb596b41
1 changed files with 11 additions and 1 deletions
|
|
@ -17,8 +17,18 @@ func processBlock(block *ship.GetBlocksResultV0) {
|
||||||
func processTraces(traces []*ship.TransactionTraceV0) {
|
func processTraces(traces []*ship.TransactionTraceV0) {
|
||||||
|
|
||||||
for _, trace := range traces {
|
for _, trace := range traces {
|
||||||
//log.Println("Trace ID:", trace.ID)
|
|
||||||
|
|
||||||
|
payload, err := json.Marshal(trace)
|
||||||
|
if err == nil {
|
||||||
|
channel := RedisKey("transactions")
|
||||||
|
if err := RedisPublish(channel, payload).Err(); err != nil {
|
||||||
|
log.Printf("Failed to post to channel '%s': %s", channel, err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.Println("Failed to encode transaction:", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Actions
|
||||||
for _, actionTraceVar := range trace.ActionTraces {
|
for _, actionTraceVar := range trace.ActionTraces {
|
||||||
trace := actionTraceVar.Impl.(*ship.ActionTraceV0)
|
trace := actionTraceVar.Impl.(*ship.ActionTraceV0)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue