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

Add script to setup two gl nodes with one local CLN node #574

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShahanaFarooqui
Copy link
Collaborator

@ShahanaFarooqui ShahanaFarooqui commented Feb 12, 2025

How to Test:

  • Run make gltestserver in first terminal
  • Run cd examples/javascript && npm install
  • Run cd ../.. && . setup-nodes.sh after installation is finished.

@ShahanaFarooqui ShahanaFarooqui force-pushed the setup-gl-testing-nodes branch 9 times, most recently from 76d5fae to 0b7d5f5 Compare February 18, 2025 03:42
@cdecker
Copy link
Collaborator

cdecker commented Feb 22, 2025

Very good 👍

I have a bit more scaffolding in mind to make controlling the mock LN network a bit more comfortable from outside the docker image. I have the following graph in mind:

flowchart LR
    classDef planned fill:#fcc
    classDef mock fill:#AAA
    subgraph Host
    direction LR
      cli
      IDE
      client-app
      browser
    end


    subgraph Docker
      S["grpc-interface"]
      subgraph gl-testserver
      direction LR
      S --> cln-nodes:::planned
      
        mock-scheduler:::mock
        bitcoind
        grpc-web-proxy:::mock
        S --> mock-scheduler
      end
    client-app & cli & IDE --> S 
    client-app & cli & IDE--> mock-scheduler
    cli --> bitcoind
    browser --> grpc-web-proxy --> cln1 & cln2 & cln3
    browser --> grpc-web-proxy --> mock-scheduler
    subgraph "Virtual Network"
        direction LR
        cln-nodes -- JSON-RPC --> cln1
        cln-nodes -- JSON-RPC --> cln2
        cln-nodes -- JSON-RPC --> cln3
        cln-nodes -- JSON-RPC --> lsp1:::planned
      end
      subgraph gl-nodes
        direction LR
        gl1
        gl2
        gl3 
      end
      mock-scheduler --> gl1 & gl2 & gl3
    end
Loading

The two grey boxes being the mock services that emulate GL, and the red highlights are the parts that I hope we can build out. It essentially exposes the CLN JSON-RPC over a web address, and multiplexes multiple CLN nodes into one server. This way you'll be able to say things like cln-cli my-lsp-node exec getinfo to connect to the multiplexer, which locates the my-lsp-node, connects to it, executes the RPC command, and ships the result back. This way we have a unified API to setup, control and tear down networks at will, even automatically in CI testing for example.

@ShahanaFarooqui ShahanaFarooqui force-pushed the setup-gl-testing-nodes branch from 0b7d5f5 to 0f7361f Compare March 6, 2025 05:11
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