Skip to content

Commit

Permalink
enable compression by default, fix odd printing of usage --help menu
Browse files Browse the repository at this point in the history
  • Loading branch information
msf committed Jun 19, 2024
1 parent ed570b3 commit 1f8bb9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ func init() {
}

func main() {
logger := slog.New(slog.NewTextHandler(os.Stderr, nil))
slog.SetDefault(logger)
cfg, err := config.Parse()
if err != nil {
stdlog.Fatal(err)
}
logger := slog.New(slog.NewTextHandler(os.Stderr, nil))
slog.SetDefault(logger)

duneClient, err := duneapi.New(logger, duneapi.Config{
APIKey: cfg.Dune.APIKey,
URL: cfg.Dune.URL,
BlockchainName: cfg.BlockchainName,
Stack: cfg.RPCStack,
DisableCompression: !cfg.EnableCompression,
DisableCompression: cfg.DisableCompression,
})
if err != nil {
stdlog.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (r RPCClient) HasError() error {
type Config struct {
BlockHeight int64 `long:"block-height" env:"BLOCK_HEIGHT" description:"block height to start from" default:"-1"` // nolint:lll
BlockchainName string `long:"blockchain-name" env:"BLOCKCHAIN_NAME" description:"name of the blockchain" required:"true"` // nolint:lll
EnableCompression bool `long:"enable-compression" env:"ENABLE_COMPRESSION" description:"enable compression when pushing payload to Dune"` // nolint:lll
DisableCompression bool `long:"disable-compression" env:"DISABLE_COMPRESSION" description:"disable compression when sending data to Dune"` // nolint:lll
Dune DuneClient
PollInterval time.Duration `long:"rpc-poll-interval" env:"RPC_POLL_INTERVAL" description:"Interval to poll the blockchain node" default:"300ms"` // nolint:lll
ReportProgressInterval time.Duration `long:"report-progress-interval" env:"REPORT_PROGRESS_INTERVAL" description:"Interval to report progress" default:"30s"` // nolint:lll
Expand Down

0 comments on commit 1f8bb9a

Please sign in to comment.