Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brucexc committed Jun 4, 2024
1 parent 00a8568 commit d78664f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/node/monitor/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Client interface {
CurrentState(state CheckpointState) uint64
// TargetState checks if the target block number/height is set in the parameters.
TargetState(param *config.Parameters) uint64
// LatestState returns the latest block number (ethereum), height (arweave) or event id (farcaster) of the client from network rpc/api.
// LatestState returns the latest block number (ethereum), height (arweave) or event id (farcaster) or err (rss) of the client from network rpc/api.
LatestState(ctx context.Context) (uint64, error)
}

Expand Down Expand Up @@ -163,6 +163,7 @@ func NewFarcasterClient() (Client, error) {
return &farcasterClient{}, nil
}

// rssClient is a client implementation for rss.
type rssClient struct {
httpClient httpx.Client
url string
Expand All @@ -179,6 +180,7 @@ func (c *rssClient) TargetState(_ *config.Parameters) uint64 {
return 0
}

// LatestState requests a URL to check if it can be accessed correctly.
func (c *rssClient) LatestState(ctx context.Context) (uint64, error) {
_, err := c.httpClient.Fetch(ctx, c.url)

Expand Down

0 comments on commit d78664f

Please # to comment.