Skip to content

Dynamic node list - #474

Open
curupo wants to merge 3 commits into
NemProject:devfrom
curupo:feat/dynamic-node-list
Open

Dynamic node list#474
curupo wants to merge 3 commits into
NemProject:devfrom
curupo:feat/dynamic-node-list

Conversation

@curupo

@curupo curupo commented Jul 29, 2026

Copy link
Copy Markdown

No description provided.

@AnthonyLaw

AnthonyLaw commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Thanks for the update 🙏🏼 .
Fetching the node list from NodeWatch and caching the result looks good.

To make the implementation easier for the team to maintain in the future, I suggest moving this logic into the existing services:

  • Implement a loadNetworkNodes(network) method in nodes.service.js. This service should remain the single place responsible for loading, validating, caching, and providing node lists.

  • Call and await loadNetworkNodes(Wallet.network) inside the connect() method in dataBridge.service.js, since this is where the wallet begins selecting a node and establishing its connection.

  • If the NodeWatch request fails or times out, use the cached node list and then fall back to the bundled static nodes.

Keeping the logic inside the existing service structure should make the behavior clearer and easier to test and maintain. This is the suggested direction rather than a required implementation. Please feel free to propose another approach that keeps node-loading responsibility within nodes.service.js.

Comment thread nanowallet/src/vendors/dynamic-nodes.js Outdated
}
}

function loadNetworkNodes(key, url) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can move this logic into nodes.service.js.

Comment thread nanowallet/src/vendors/dynamic-nodes.js Outdated
}

Promise.all([
loadNetworkNodes('mainnet', NODEWATCH_URLS.mainnet).then(function (n) { freshByNetwork.mainnet = n; }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This method can be used in the connect() method in dataBridge.service.js, since this is where the wallet begins selecting a node and establishing its connection.

Comment thread nanowallet/src/start.html Outdated
Comment on lines +29 to +31
<!-- Dynamic node list (nodewatch.symbol.tools; falls back to bundled defaults on any failure) -->
<script src="vendors/dynamic-nodes.js"></script>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Once it moves into existing services, we no longer need it here.

curupo pushed a commit to curupo/miscellaneous that referenced this pull request Jul 30, 2026
curupo pushed a commit to curupo/miscellaneous that referenced this pull request Jul 30, 2026
@curupo
curupo force-pushed the feat/dynamic-node-list branch from e409edf to 5a2776e Compare July 30, 2026 01:37
@curupo

curupo commented Jul 30, 2026

Copy link
Copy Markdown
Author

Thanks for the review.
I've addressed the points you raised.
What do you think?

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.

2 participants