refactor Addressbook proposal
See original GitHub issueThe main process is horribly complex.
Addressbook is a class in the main process that discovers and keeps a stateful collection of node addresses. A node is chosen randomly from the pool when starting Gaia Lite.
The usage of the address book is essentially as follows:
- Load seed nodes from the network’s
config.toml
file. - Load more nodes that were saved to disk during the previous session.
- Filter out nodes that don’t respond to a simple query.
- Discover new nodes by asking a node for its peers.
- Save nodes to disk for the next session.
I propose that we replace this complex, stateful class with a single stateless function. The function will:
- take a set of seed nodes, discover new ones, and return a combined set of nodes known to respond
- combine the aliveness query with peer discovery to reduce the amount of network traffic
- make the network queries in parallel for increased performance
- not talk to the disk to eliminate the need to mock file system calls in tests
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Addressbook refactoring proposal - Mozilla.org
This document explains the process underway to modify the existing code of the Mozilla address book to enable support many types of address...
Read more >refactor Addressbook proposal · Issue #1195 · luniehq/lunie · GitHub
I propose that we replace this complex, stateful class with a single stateless function. The function will: take a set of seed nodes,...
Read more >2.1.2.1 - Address Book, Movie Tickets, Bank Account
Goal: The goal for this lesson is to practice creating objects using constructors and prototypes. Practice adding properties and methods to ...
Read more >Canvas Inbox Refactor Update_ 11/22/2022 & 12/8/20...
Good afternoon, I am pleased to announce that the Observers functionality is now available in the Inbox Refactor in Beta.
Read more >Announcing Our New Address Book Widget - CloudSponge
A Completely Refactored Skinning Engine. Over the years our customers have spoken loud and clear. They want to be able to customize our...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree we’ll probably want to have it again and I don’t see any harm in leaving it as it is since it can handle the case of a single node already.
Right. So should we archive the addressbook code then? In the future we probably want to have this again.