question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

refactor Addressbook proposal

See original GitHub issue

The 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:

  1. Load seed nodes from the network’s config.toml file.
  2. Load more nodes that were saved to disk during the previous session.
  3. Filter out nodes that don’t respond to a simple query.
  4. Discover new nodes by asking a node for its peers.
  5. 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
NodeGuycommented, Sep 13, 2018

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.

0reactions
fabowebcommented, Sep 13, 2018

Right. So should we archive the addressbook code then? In the future we probably want to have this again.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found