Skip to content

Commit

Permalink
remove resolve start block
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Feb 6, 2024
1 parent f35aa48 commit 176064c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.2

FROM ghcr.io/streamingfast/firehose-core:a4ba225 as core
FROM ghcr.io/streamingfast/firehose-core:b248423 as core

FROM ubuntu:20.04

Expand Down
21 changes: 1 addition & 20 deletions cmd/firesol/rpc/fetcher.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package rpc

import (
"errors"
"fmt"
"strconv"
"time"

"github.com/gagliardetto/solana-go/rpc"
"github.com/gagliardetto/solana-go/rpc/jsonrpc"
"github.com/spf13/cobra"
"github.com/streamingfast/bstream"
"github.com/streamingfast/cli/sflags"
firecore "github.com/streamingfast/firehose-core"
"github.com/streamingfast/firehose-core/blockpoller"
Expand Down Expand Up @@ -74,23 +71,7 @@ func fetchRunE(logger *zap.Logger, tracer logging.Tracer) firecore.CommandExecut

logger.Info("Found latest slot", zap.Uint64("slot_number", latestSlot))

var requestedBlock *rpc.GetBlockResult
for {
requestedBlock, err = rpcClient.GetBlockWithOpts(ctx, latestSlot, fetcher.GetBlockOpts)
if err != nil {
var rpcErr *jsonrpc.RPCError
if errors.As(err, &rpcErr) {
if rpcErr.Code == -32004 {
time.Sleep(latestBlockRetryInterval)
continue
}
}
return fmt.Errorf("getting requested block %d: %w", latestSlot, err)
}
break
}

err = poller.Run(ctx, startBlock, bstream.NewBlockRef(requestedBlock.Blockhash.String(), latestSlot), sflags.MustGetInt(cmd, "block-fetch-batch-size"))
err = poller.Run(ctx, startBlock, sflags.MustGetInt(cmd, "block-fetch-batch-size"))
if err != nil {
return fmt.Errorf("running poller: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ require (
github.com/streamingfast/binary v0.0.0-20240116152459-ebe30de95370
github.com/streamingfast/bstream v0.0.2-0.20240118123300-2bc69dde3598
github.com/streamingfast/cli v0.0.4-0.20230825151644-8cc84512cd80
github.com/streamingfast/derr v0.0.0-20230515163924-8570aaa43fe1
github.com/streamingfast/dstore v0.1.1-0.20230620124109-3924b3b36c77
github.com/streamingfast/firehose-core v1.0.1-0.20240131133941-a4ba225c6f6b
github.com/streamingfast/firehose-core v1.0.1-0.20240206200209-b248423346ea
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091
github.com/streamingfast/solana-go v0.5.1-0.20230622180848-8faf68a7cb1d
github.com/test-go/testify v1.1.4
Expand Down Expand Up @@ -154,7 +155,6 @@ require (
github.com/spf13/viper v1.15.0 // indirect
github.com/streamingfast/dauth v0.0.0-20231120142446-843f4e045cc2 // indirect
github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c // indirect
github.com/streamingfast/derr v0.0.0-20230515163924-8570aaa43fe1 // indirect
github.com/streamingfast/dgrpc v0.0.0-20240119162453-69517bcc1a7f // indirect
github.com/streamingfast/dhammer v0.0.0-20230125192823-c34bbd561bd4 // indirect
github.com/streamingfast/dmetering v0.0.0-20231120142327-a3405f0eed83 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,8 @@ github.com/streamingfast/dstore v0.1.1-0.20230620124109-3924b3b36c77 h1:u7FWLqz3
github.com/streamingfast/dstore v0.1.1-0.20230620124109-3924b3b36c77/go.mod h1:ngKU7WzHwVjOFpt2g+Wtob5mX4IvN90HYlnARcTRbmQ=
github.com/streamingfast/dtracing v0.0.0-20220305214756-b5c0e8699839 h1:K6mJPvh1jAL+/gBS7Bh9jyzWaTib6N47m06gZOTUPwQ=
github.com/streamingfast/dtracing v0.0.0-20220305214756-b5c0e8699839/go.mod h1:huOJyjMYS6K8upTuxDxaNd+emD65RrXoVBvh8f1/7Ns=
github.com/streamingfast/firehose-core v1.0.1-0.20240131133941-a4ba225c6f6b h1:KauLK86b2y2VmE+snS+EFYXbASOe2nr/f8e7dx1NgqI=
github.com/streamingfast/firehose-core v1.0.1-0.20240131133941-a4ba225c6f6b/go.mod h1:mwzlzxtjSqJy81zFv1X77+YoKhe59rBZopisrQTmaqo=
github.com/streamingfast/firehose-core v1.0.1-0.20240206200209-b248423346ea h1:meVzSjdDrnuutYUWu5cikQOF2XVdXEOxHe4bQhiKGuM=
github.com/streamingfast/firehose-core v1.0.1-0.20240206200209-b248423346ea/go.mod h1:mwzlzxtjSqJy81zFv1X77+YoKhe59rBZopisrQTmaqo=
github.com/streamingfast/gagliardetto-solana-go v0.0.0-20240115191424-05c37cd0760d h1:Db3yKJeN5DWPz8pesR9tuFXdbs0MnpRLmov+ttsHoTU=
github.com/streamingfast/gagliardetto-solana-go v0.0.0-20240115191424-05c37cd0760d/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8=
github.com/streamingfast/jsonpb v0.0.0-20210811021341-3670f0aa02d0 h1:g8eEYbFSykyzIyuxNMmHEUGGUvJE0ivmqZagLDK42gw=
Expand Down

0 comments on commit 176064c

Please sign in to comment.