txcount: adapt to recent library updates

This commit is contained in:
Leopold Schabel 2022-06-12 20:32:24 +02:00
parent 797cfda565
commit a4927f9ef7
1 changed files with 8 additions and 6 deletions

View File

@ -6,13 +6,15 @@ import (
"errors" "errors"
"flag" "flag"
"fmt" "fmt"
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"
"github.com/gagliardetto/solana-go/rpc/jsonrpc"
"k8s.io/klog/v2"
"os" "os"
"sync" "sync"
"time" "time"
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"
"github.com/gagliardetto/solana-go/rpc/jsonrpc"
"k8s.io/klog/v2"
) )
const localRPC = "http://localhost:8899" const localRPC = "http://localhost:8899"
@ -75,7 +77,7 @@ func main() {
klog.Infof("Current slot: %d", current) klog.Infof("Current slot: %d", current)
sched := *resp sched := resp
slots := sched[our] slots := sched[our]
klog.Infof("%d slots for %s", len(slots), our) klog.Infof("%d slots for %s", len(slots), our)
@ -112,7 +114,7 @@ func main() {
continue continue
} }
bt := time.Unix(*block.BlockTime, 0) bt := time.Unix(int64(*block.BlockTime), 0)
out.Lock() out.Lock()
json.NewEncoder(os.Stdout).Encode(logLine{TS: bt, Slot: slot, NumTx: len(block.Transactions)}) json.NewEncoder(os.Stdout).Encode(logLine{TS: bt, Slot: slot, NumTx: len(block.Transactions)})