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

feat: /admin rest api endpoint #2094

Merged
merged 6 commits into from
Oct 5, 2023
Merged

Conversation

NagyZoltanPeter
Copy link
Contributor

Description

/admin rest api endpoint implementation and test

Changes

  • Added new /admin directory for endpoint implementation
  • Added new test_rest_admin
  • common code from json-rpc implementation is extracted and moved to waku_core

How to test

  1. run tests/wakunode_rest/test_rest_admin.nim

Issue

#2075

/admin rest api implementation and tests
@NagyZoltanPeter NagyZoltanPeter added the E:REST API service node See https://github.com/waku-org/pm/issues/82 for details label Sep 29, 2023
@NagyZoltanPeter NagyZoltanPeter self-assigned this Sep 29, 2023
@github-actions
Copy link

github-actions bot commented Sep 29, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2094

Built from c821fea

Copy link
Contributor

@SionoiS SionoiS left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks.

tests/wakunode_rest/test_rest_admin.nim Show resolved Hide resolved
waku/waku_core/multiaddrstr.nim Show resolved Hide resolved
Copy link
Member

@vpavlin vpavlin left a comment

Choose a reason for hiding this comment

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

Some comments, but generaly LGTM

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

This PR is super beautiful! Thanks for it! I've added a few comments/questions :)

tests/wakunode_rest/test_rest_admin.nim Outdated Show resolved Hide resolved
waku/waku_api/jsonrpc/admin/handlers.nim Show resolved Hide resolved
waku/waku_api/rest/admin/handlers.nim Show resolved Hide resolved
Comment on lines +48 to +51
'400':
description: Cannot connect to one or more peers.
'5XX':
description: Unexpected error.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if would it make sense to test this at this point or maybe we already are testing this in another tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would rather add such case, with adding one false peer out of three or sthg.

waku/waku_core/multiaddrstr.nim Outdated Show resolved Hide resolved
waku/waku_core/multiaddrstr.nim Outdated Show resolved Hide resolved
waku/waku_core/multiaddrstr.nim Outdated Show resolved Hide resolved
waku/waku_api/rest/admin/client.nim Outdated Show resolved Hide resolved
waku/waku_api/rest/admin/types.nim Outdated Show resolved Hide resolved
Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Great to see the last of the "legacy" APIs now in REST.

waku/waku_api/rest/admin/client.nim Outdated Show resolved Hide resolved
waku/waku_api/rest/admin/handlers.nim Outdated Show resolved Hide resolved
waku/waku_api/rest/admin/handlers.nim Outdated Show resolved Hide resolved
Co-authored-by: Simon-Pierre Vivier <simvivier@status.im>
Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

Wonderful PR! Thanks!
Just added a couple of comments.

tests/wakunode_rest/test_rest_admin.nim Outdated Show resolved Hide resolved
tests/wakunode_rest/test_rest_admin.nim Show resolved Hide resolved
waku/waku_api/jsonrpc/admin/handlers.nim Show resolved Hide resolved
@NagyZoltanPeter NagyZoltanPeter merged commit 7b5c36b into master Oct 5, 2023
10 checks passed
@NagyZoltanPeter NagyZoltanPeter deleted the feat-2075-admin-endpoint branch October 5, 2023 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:REST API service node See https://github.com/waku-org/pm/issues/82 for details
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants