-
Notifications
You must be signed in to change notification settings - Fork 12
node client as blockchain-provider #90
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
base: master
Are you sure you want to change the base?
Conversation
Node client
Node client to blockchain-providers
|
arobsn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that it's not an exhaustive review as the requested changes are big enough.
| /** | ||
| * Limit the number of outputs when applicable. | ||
| * @default 0 | ||
| */ | ||
| limit?: number; | ||
|
|
||
| /** | ||
| * Amount of result to skip from the begining. | ||
| * @default 0 | ||
| */ | ||
| offset?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limit and offset should not be accepted by getBoxes
getBoxesis meant to fetch all queried boxes over all pagesstreamBoxesis meant to fetch and yeld query pages by pages, thus querying logic should be implemented bystreamBoxes(abstractinglimitandoffset), andgetBoxeswill simply call it until the end of stream, see GraphQL implementation as a reference: https://github.com/fleet-sdk/fleet/blob/master/packages/blockchain-providers/src/ergo-graphql/ergoGraphQLProvider.ts#L169-L176
| export function getErgoNodeProvider( | ||
| url: URL | string, | ||
| parser: ResponseParser = JSON, | ||
| fetcher: Fetcher = fetch, | ||
| headers: Headers = DEFAULT_HEADERS | ||
| ): ErgoNodeProvider { | ||
| const nodeOptions: RequestOptions = { | ||
| url: url, | ||
| parser: parser, | ||
| fetcher: fetcher, | ||
| headers: headers | ||
| }; | ||
|
|
||
| return new ErgoNodeProvider(nodeOptions); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this functions is necessary, new ErgoNodeProvider(...) should be enougth
…boxes, remove the get node helper function
|
Thanks, I've made the requested changes to align the getBoxes behavior and implements the streamBoxes. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #90 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 104 107 +3
Lines 15184 17755 +2571
Branches 1394 1492 +98
===========================================
+ Hits 15184 17755 +2571 ☔ View full report in Codecov by Sentry. |
Provide client for node running with the extra indexes.
It implements the blockchain-providers standard interface and several node REST API end points.
Returns the blockchain objects typed for fleet SDK when applicable.