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

[demo] in-process multinode demonstration #158

Open
wants to merge 2 commits into
base: rpcGraphSource
Choose a base branch
from

Conversation

ellemouton
Copy link
Owner

@ellemouton ellemouton commented Nov 11, 2024

Demonstrate in-process graph sharing between LND nodes

This PR adds a multinode binary that can be used to test this LND PR.

The binary starts 2 LND nodes: the graph node and the zane node. Zane will depend on Graph for its remote graph source.

This is how I start the binary on regtest. The flags here are used for the Zane node (note the gossip.no-sync option. The flags for the graph node are specified in the cmd/multinode/main.go file.

function start_graph() {
   cd $LND_DIR
   make tags="dev graphrpc chainrpc peersrpc walletrpc signrpc invoicesrpc autopilotrpc watchtowerrpc wtclientrpc monitoring routerrpc kvdb_postgres kvdb_sqlite"

   ./multinode-debug --bitcoin.regtest \
   --lnddir=$HOME/.lnd-dev-zane --bitcoind.rpchost=localhost:18443 \
   --bitcoin.node=bitcoind \
   --rpclisten=localhost:10019 \
   --bitcoind.rpcuser=lightning --bitcoind.rpcpass=lightning \
   --bitcoind.zmqpubrawblock=tcp://localhost:28332 \
   --bitcoind.zmqpubrawtx=tcp://localhost:28333 \
   --trickledelay=50 \
   --gossip.no-sync \
   --noseedbackup \
   --restlisten=localhost:11019 \
   --rpcmiddleware.enable \
   --listen=localhost:9735 \
   --logging.console.style \
   --bitcoin.active \
   --debuglevel=debug  "$@"
}   

Tests you can perform:

  1. Connect Zane to another node in the graph & verify that it only sees itself and the graph node (use lncli describegraph). The graph node should only see itself.
  2. Connect zane to another node in the graph & open a private channel with that node.
  3. see that zane now sees itself, that channel peer node, and the graph node. It should still not see other things in the graph.
  4. now connect the graph node to another peer in the network & wait for it to do gossip sync.
  5. now see that zane can see the rest of the network via describegraph BUT that it doesnt actually persist these things (use boltbrowser to confirm)
  6. show that zane is able to pay an invoice from a node that it doesnt actually have any persisted info about.

Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

@ellemouton ellemouton changed the base branch from master to moveGraphDBCode November 11, 2024 09:47
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11774822488

Details

  • 1230 of 2738 (44.92%) changed or added relevant lines in 75 files are covered.
  • 27897 unchanged lines in 434 files lost coverage.
  • Overall coverage decreased (-9.7%) to 49.181%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chainreg/no_chain_backend.go 0 1 0.0%
chanbackup/pubsub.go 3 4 75.0%
chanbackup/recover.go 3 4 75.0%
chanrestore.go 5 6 83.33%
lnrpc/devrpc/dev_server.go 0 1 0.0%
lnrpc/devrpc/driver.go 0 1 0.0%
lnrpc/routerrpc/router_backend.go 0 1 0.0%
routing/graph.go 3 4 75.0%
routing/localchans/manager.go 4 5 80.0%
routing/router.go 10 11 90.91%
Files with Coverage Reduction New Missed Lines %
graph/errors.go 1 94.74%
lnwire/typed_lease_expiry.go 2 78.95%
lnwire/typed_fee.go 2 66.67%
htlcswitch/linkfailure.go 2 58.62%
routing/graph.go 2 86.96%
channeldb/forwarding_policy.go 2 85.14%
record/hop.go 2 93.33%
rpcperms/interceptor.go 2 82.59%
lnwire/short_channel_id.go 2 89.74%
lnwallet/sigpool.go 2 65.63%
Totals Coverage Status
Change from base Build 11739445466: -9.7%
Covered Lines: 99114
Relevant Lines: 201531

💛 - Coveralls

@ellemouton ellemouton force-pushed the abstractGraph branch 5 times, most recently from 6cfa005 to 236f7ab Compare November 13, 2024 09:06
@ellemouton ellemouton changed the base branch from moveGraphDBCode to graphSourceAbstraction November 13, 2024 09:08
@ellemouton ellemouton changed the title Abstract graph [demo] in-process multinode demonstration Nov 13, 2024
@ellemouton ellemouton force-pushed the graphSourceAbstraction branch from 971cca9 to 2dc2543 Compare November 13, 2024 09:30
@ellemouton ellemouton force-pushed the graphSourceAbstraction branch 3 times, most recently from 9335ed9 to eea9022 Compare November 14, 2024 08:36
@ellemouton ellemouton changed the base branch from graphSourceAbstraction to rpcGraphSource November 14, 2024 08:40
@ellemouton ellemouton force-pushed the rpcGraphSource branch 7 times, most recently from afc8a84 to a087692 Compare November 19, 2024 05:36
This is an interface that the LND can provide to other callers systems
in the same process.
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