Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up epoch loading, and cleanup log verbosity #85

Merged
merged 7 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ The RPC server provides a proxy mode which allows it to forward traffic it can't

The `proxyFailedRequests` flag will make the RPC server proxy not only RPC methods that it doesn't support, but also retry requests that failed to be served from the archives (e.g. a `getBlock` request that failed to be served from the archives because that epoch is not available).

### Log Levels

You can set the desired log verbosity level by using the `-v` flag. The levels are from 0 to 5, where 0 is the least verbose and 5 is the most verbose. The default level is 2.

Example:

```bash
faithful-cli rpc -v=5 455.yml
```

### RPC server from old-faithful.net

We are hosting data on old-faithful.net for testing and cloning purposes. This allows you to run a sample test server without downloading any data. You can run a fully remote server like this:
Expand Down
3 changes: 1 addition & 2 deletions car-dag-traverser.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ func FindSubsets(
}
decoded, err := iplddecoders.DecodeSubset(block.RawData())
if err != nil {
// TODO: log error, or return error?
continue
return fmt.Errorf("failed to decode Subset with CID %s: %w", block.Cid(), err)
}
err = callback(block.Cid(), decoded)
if err != nil {
Expand Down
18 changes: 9 additions & 9 deletions cmd-check-deals.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ func newCmd_check_deals() *cli.Command {
klog.Infof("Provider allowlist: <empty>")
}

lotusAPIAddress := "https://api.node.glif.io"
cl := jsonrpc.NewClient(lotusAPIAddress)
dm := splitcarfetcher.NewMinerInfo(
cl,
24*time.Hour,
5*time.Second,
)

// Check deals:
for _, config := range configs {
epoch := *config.Epoch
Expand All @@ -134,21 +142,13 @@ func newCmd_check_deals() *cli.Command {
return fmt.Errorf("failed to read deals: %w", err)
}

lotusAPIAddress := "https://api.node.glif.io"
cl := jsonrpc.NewClient(lotusAPIAddress)
dm := splitcarfetcher.NewMinerInfo(
cl,
5*time.Minute,
5*time.Second,
)

err = checkAllPieces(
c.Context,
epoch,
metadata,
dealRegistry,
providerAllowlist,
&dm,
dm,
)
if err != nil {
return fmt.Errorf(
Expand Down
Loading
Loading