Skip to content

Commit

Permalink
Fix configs for API URL (#8)
Browse files Browse the repository at this point in the history
This now works out of the box with

```
go run cmd/main.go --blockchain-name byob --dune-api-url "https://api.dev.dune.com/api" --rpc-node-url "https://sepolia.rpc.zora.energy"
```

(assuming I have the `DUNE_API_KEY` env var set to a dune team api key
in dev)
  • Loading branch information
vegarsti committed Jun 6, 2024
1 parent 732e823 commit fdc05e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/duneapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ func (c *client) sendRequest(request BlockchainIngestRequest) error {
}
}()

url := fmt.Sprintf("%s/beta/blockchain/%s/chain", c.cfg.URL, c.cfg.BlockchainName)
url := fmt.Sprintf("%s/beta/blockchain/%s/ingest", c.cfg.URL, c.cfg.BlockchainName)
c.log.Debug("Sending request", "url", url)
req, err := retryablehttp.NewRequest("POST", url, bytes.NewReader(request.Payload))
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

type DuneClient struct {
APIKey string `long:"dune-api-key" env:"DUNE_API_KEY" description:"API key for DuneAPI"`
URL string `long:"dune-api-url" env:"DUNE_API_URL" description:"URL for DuneAPI" default:"https://api.dune.com/"`
URL string `long:"dune-api-url" env:"DUNE_API_URL" description:"URL for DuneAPI" default:"https://api.dune.com/api"`
}

func (d DuneClient) HasError() error {
Expand Down

0 comments on commit fdc05e0

Please sign in to comment.