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

Implement node endpoints #226

Merged
merged 24 commits into from
Aug 24, 2020
Merged

Implement node endpoints #226

merged 24 commits into from
Aug 24, 2020

Conversation

emostov
Copy link
Contributor

@emostov emostov commented Aug 21, 2020

Closes #225
Closes #168
Closes #220

Overview

This PR implements the node endpoints as specified in the openapi-proposal.yaml. This includes node/version, node/transaction-pool, and node/network.

For each, the code lightly wraps RPC calls. For system_peers, it was found that Parity public nodes do not support the RPC call, so it was wrapped in a try/catch block, and puts in a message if the RPC method does not work.

Bare bones unit tests are implemented to have some degree of a user contract that can be used to show regressions. So far though I have not been able to fully test node/transaction-pool as there has been no pending extrinsic.

Follow up PRs

  • UI for swagger docs, showing the currently implemented v1 routes

Copy link
Collaborator

@joepetrowski joepetrowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we need to get the latest block and metadata, except maybe for tx pool to decode calls. Could use docs on what is being returned.

src/services/node/NodeNetworkService.ts Outdated Show resolved Hide resolved
src/controllers/node/NodeNetworkController.ts Outdated Show resolved Hide resolved
src/services/node/NodeTransactionPoolService.ts Outdated Show resolved Hide resolved
@emostov emostov mentioned this pull request Aug 21, 2020
19 tasks
Copy link
Contributor

@danforbes danforbes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly nitpicks...this will be a great addition 🚗

src/controllers/node/NodeNetworkController.ts Outdated Show resolved Hide resolved
src/controllers/node/NodeNetworkController.ts Outdated Show resolved Hide resolved
src/controllers/node/NodeNetworkController.ts Outdated Show resolved Hide resolved
src/controllers/node/NodeNetworkController.ts Outdated Show resolved Hide resolved
src/controllers/node/NodeNetworkController.ts Outdated Show resolved Hide resolved
src/controllers/node/NodeTransactionPoolController.ts Outdated Show resolved Hide resolved
src/controllers/node/NodeVersionController.ts Outdated Show resolved Hide resolved
Comment on lines 11 to 13
* - `clientImplVersion` Node's implementation's version.
* - `clientImplName` Node's implementation name.
* - `chain` Chain's spec name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make these a little jazzier.

src/controllers/node/NodeVersionController.ts Outdated Show resolved Hide resolved
src/services/node/NodeNetworkService.ts Outdated Show resolved Hide resolved
@emostov emostov added the B3 - API Noteworthy API is not broken, but worth noting label Aug 23, 2020
@joepetrowski joepetrowski merged commit 651601c into master Aug 24, 2020
@joepetrowski joepetrowski deleted the zeke-node-1 branch August 24, 2020 06:01
@emostov emostov mentioned this pull request Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B3 - API Noteworthy API is not broken, but worth noting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement node/version Implement node/network Add api to query pending extrinsics status
3 participants