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

Persist DHT nodes #1431

Open
wants to merge 9 commits into
base: master
from
Open
Commits on Jul 14, 2018
  1. Persist DHT nodes

    bookmoons committed Jul 14, 2018
    Persists DHT nodes to disk every 15 minutes.
    Loads persisted nodes on construction.
    Enabled by default.
    
    Default save file is dht.json,
    under crossplatform app data folder provided by app-data-folder.
    
    Adds option dhtState to configure:
    * false disables
    * true enables with default path
    * String specifies path to custom save file
Commits on Jul 30, 2018
  1. Move DHT persistence logic into lib/ module

    bookmoons committed Jul 30, 2018
    Increases cleanliness of index.js.
  2. Add save DHT state test

    bookmoons committed Jul 30, 2018
  3. Distinguish addresses in DHT persistence test

    bookmoons committed Jul 30, 2018
    Uses loopback for the test DHT server, a local address provided
    by the network-address module for the client. This is the pattern
    used in other tests.
  4. Correct DHT state loading

    bookmoons committed Jul 30, 2018
    Saved node data and the bootstrap list use different formats.
    Converts to the bootstrap format.
  5. Allow DHT state loading when bootstrap disabled

    bookmoons committed Jul 30, 2018
    Prior logic disabled DHT state load with any bootstrap value,
    including a false to disable. Changes to allowing DHT state load
    if bootstrap is explicitly disabled with a falsy value.
  6. Add load DHT state test

    bookmoons committed Jul 30, 2018
Commits on Aug 6, 2018
  1. Split DHT persistence options

    bookmoons committed Aug 6, 2018
    Splits from single option dhtState into 2 options:
    * persistDht - Boolean. Flag to enable.
    * persistDhtPath - String. Optional custom path for save file.
You can’t perform that action at this time.