eth-blob-indexer/cmd/beacon-blob-collector/main.go
Roy Crihfield 1d1ee73ff2
Some checks failed
Tests / Run Blobscan scraper tests (push) Successful in 2m23s
Tests / Run Beacon collector tests (push) Failing after 22m23s
Implement Blobscan scraper (#2)
New utility to backfill data from Blobscan.

Reviewed-on: #2
2024-07-01 14:01:27 +00:00

36 lines
778 B
Go

package main
import (
"context"
"log/slog"
"github.com/cerc-io/eth-blob-indexer/cmd"
"github.com/cerc-io/eth-blob-indexer/pkg/beacon"
"github.com/cerc-io/eth-blob-indexer/pkg/storage"
"github.com/go-redis/redis/v8"
)
const (
defaultBeaconAddr = "https://localhost:5052"
)
func main() {
var BeaconAddress string
cmd.Flags.StringVar(&BeaconAddress, "beacon-addr", defaultBeaconAddr, "Address of the beacon node")
cmd.ParseFlags()
indexer := &beacon.BeaconClient{URL: BeaconAddress}
rdb := redis.NewClient(&redis.Options{
Addr: cmd.RedisAddress,
})
db := storage.NewRedisStorage(rdb)
slog.Info("Starting indexer", "beacon", BeaconAddress, "redis", cmd.RedisAddress)
err := indexer.CollectBlobs(context.Background(), db)
if err != nil {
panic(err)
}
}