Skip to content

Conversation

@NagyZoltanPeter
Copy link
Contributor

Description

In relation to #3432 we identified name clashes in nwaku implementation.
As now we are implementing waku-api as the only public interface for waku, we would like to "hide" the complex raw interface of the node.
Also we refered REST API interface as waku_api, that can cause misunderstanding.
In order to clean this up, with this PR I would like to suggest a more clarify namings throughout the code base.

Changes

This pr is not changing any functionality, every change is the result of renaming of directories and imports (and some adjustments to make everything compile).

  • waku/waku_api/rest renamed to waku/waku_rest/endpoint
  • waku/node/api renamed to waku/node/kernel_api - I found kernel as describing best that the underlying interfaces are internal and likely to be changed without notice.
  • waku/api remains the only top level public API for waku in the future.
    • with having waku/api.nim waku-api will be top level import for using waku as a nimble module.

Issue

#3432

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR performs a major refactoring by renaming the waku_api module to waku_rest, and reorganizing the internal API structure. The changes include:

  • Renaming waku_apiwaku_rest
  • Renaming node/apinode/kernel_api
  • Moving REST-related code into waku_rest/endpoint/
  • Updating import statements across the entire codebase
  • Minor comment updates (e.g., "Public API types" → "API types")

Reviewed Changes

Copilot reviewed 48 out of 89 changed files in this pull request and generated no comments.

Show a summary per file
File Description
waku/waku_rest/ (multiple files) New REST endpoint implementations moved from waku_api
waku/node/kernel_api/ (multiple files) Core node API functionality moved from node/api
waku/waku_store_legacy/common.nim Updated comment from "Public API types" to "API types"
waku/waku_store/common.nim Updated comment from "Public API types" to "API types"
Test files Updated imports to reflect new module structure
Application files Updated imports to reflect new module structure
waku/factory/waku_conf.nim Fixed trailing whitespace in comment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3637

Built from ef2af46

Copy link
Contributor

@fcecin fcecin left a comment

Choose a reason for hiding this comment

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

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.

LGTM! Thanks for it! 💯
Just added some suggestions that I hope you find interesting ( not blocking .)

results,
libp2p/peerid

from std/sugar import `=>`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting! What is it for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, LTP was not compiling as I found during working on this PR. Some former refactor moved things.
This operator was needed here, and I did not want to import all from sugar, which is an extensive module anyway.


import
../wakunode2/cli_args,
../../tools/confutils/cli_args,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Everything can be referenced from the repo's root folder. We can adopt that style as much as possible

Suggested change
../../tools/confutils/cli_args,
tools/confutils/cli_args,

Copy link
Contributor Author

@NagyZoltanPeter NagyZoltanPeter Nov 14, 2025

Choose a reason for hiding this comment

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

Addressed in ccf1141

# @TODO confutils.nim(775, 17) Error: can raise an unlisted exception: ref IOError
when isMainModule:
import waku/common/utils/nat, waku/waku_api/message_cache
import waku/common/utils/nat, waku/waku_rest/message_cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another possible option is naming it as "rest_api", to keep the consistency with othes like "kernel_api"

Suggested change
import waku/common/utils/nat, waku/waku_rest/message_cache
import waku/common/utils/nat, waku/rest_api/message_cache

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 can buy in this idea! I just wanted to name as less things possible as API.
But yes, rest interface is an api anyway.
I make the change!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in a07e502

@NagyZoltanPeter NagyZoltanPeter merged commit 1762548 into master Nov 15, 2025
11 of 12 checks passed
@NagyZoltanPeter NagyZoltanPeter deleted the chore-refactor-api-folders branch November 15, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants