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

testserver: Standalone Greenlight testserver for non-python projects #539

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

cdecker
Copy link
Collaborator

@cdecker cdecker commented Nov 7, 2024

This uses the gl-testing library, and builds a standalone server to
test against. We currently expose four interfaces:

  • The scheduler interface as the main entrypoint to the service
  • The GRPC-Web proxy to develop browser apps and extensions against
    Greenlight.
  • The bitcoind interface, so you can generate blocks and confirm
    transactions without lengthy wait times
  • The node's grpc interface directly to work against a single user's
    node

All of these will listen to random ports initially. We write a small
file metadata.json which contains the URIs and ports for the first
three, while the node's URI can be retrieved from the scheduler, since
these are spawned on demand as users register.

Depends #536

Fewer demands on the environments, better managed, should make it
simpler to use.
It turns out we were accessing the external `$PATH` which may or may
not contain a valid `lightningd`.`
`uv` gives us more control, and fewer failure opportunities, so let's
use it.
This proxy is used in the local testing environment to provide
node-access to browser based clients. It strips the transport
authentication, and replaces it with the payload authentication
already used for the signer context.
We create a standalone service and front it with the
grpc-web-proxy. Since the proxy must not rely on the payload to make
decisions we just implemented a simple test proto just for this case.
@cdecker cdecker force-pushed the 202445-gl-testing-standalone branch from 14f3da8 to ee301b7 Compare November 7, 2024 16:03
Besides the grpc-web proxy functionality, the node grpc-web-proxy also
needs the capability of locating and starting a node if it hasn't been
started yet. It also needs to be configured with the correct client
certificates. The `NodeHandler` class encapsulates that logic.

We also test it by running a `GetInfo` call through the
grpc-web-client, the node-grpc-web-proxy-, finally hitting the node,
and back again.
@cdecker cdecker force-pushed the 202445-gl-testing-standalone branch 2 times, most recently from b84c574 to 37c934d Compare November 7, 2024 16:50
@cdecker cdecker changed the title 202445 gl testing standalone testserver: Standalone Greenlight testserver for non-python projects Nov 7, 2024
This uses the `gl-testing` library, and builds a standalone server to
test against. We currently expose four interfaces:

 - The scheduler interface as the main entrypoint to the service
 - The GRPC-Web proxy to develop browser apps and extensions against
   Greenlight.
 - The `bitcoind` interface, so you can generate blocks and confirm
   transactions without lengthy wait times
 - The node's grpc interface directly to work against a single user's
   node

All of these will listen to random ports initially. We write a small
file `metadata.json` which contains the URIs and ports for the first
three, while the node's URI can be retrieved from the scheduler, since
these are spawned on demand as users register.
The TLD is the root for the tree of resources we are going to spawn,
so making this configurable allows us to run arbitrarily many
instances on a single developer machine. This is useful if we'd like
to run many tests in parallel.
@cdecker cdecker force-pushed the 202445-gl-testing-standalone branch from 37c934d to 35aa8eb Compare November 7, 2024 17:38
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.

1 participant