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

Make lightning gateway optional #200

Closed
wants to merge 2 commits into from

Conversation

justinmoon
Copy link
Contributor

Builds on #174. Just look at 2nd commit.

Our README on master right now claims that the gateway is optional, but our code doesn't. Instead, we just generate a random node pubkey! But this isn't a problem because it would only be used in an invoice and we haven't done that, yet.

So this PR attempt to make the gateway optional. It also stops having the gateway code generate client.json and instead adds a new command to configgen to do this. Along the way I added a /info endpoint to the gateway HTTP server so you can look up gateway public keys.

- mint-clint-cli gets command to generate invoices
- Gateway plugin automatically generates gateway.json if it isn't
there. Removed gw_configgen bin script.
- Add route hint to invoices we generate
- Gateway uses channels to concurrency between webserver, plugin
and background fetching
- Had to add more features to tracing dependency for the gateway
crate because Core Lightning communicates to plugins via stdin/
stdout. Logging is routed via JSON-RPC. These feature flags helped
make that work.
-
- Lightning gateway no longer generates `client.json`. `configgen`
does that now.
- `run_webserver` reads gateway port from config, doesn't hard-code
- Gateway API endpoint to fetch node pubkey and ecash pubkey
@@ -46,5 +46,5 @@ impl<CO> OwnedClientContext<CO> {
#[derive(Debug, Serialize, Deserialize)]
pub struct ClientAndGatewayConfig {
pub client: ClientConfig,
pub gateway: LightningGateway,
pub gateway: Option<LightningGateway>,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a Vec

Copy link
Contributor

@elsirion elsirion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Just noticed the dependency on the GW plugin, hope to merge soon.

# Send bitcoin to gateway lightning address
bitcoin-cli -regtest -rpcuser=bitcoin -rpcpassword=bitcoin sendtoaddress <LN_ADDRESS> <AMOUNT>
# Send bitcoin to gateway lightning address, and mine a block to confirm it
bitcoin-cli -regtest -rpcuser=bitcoin -rpcpassword=bitcoin sendtoaddress <LN_ADDRESS> 1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have large enough denominations for this to not take days (e.g. if the server had to issue 100'000 tokens)

@justinmoon
Copy link
Contributor Author

Closing in favor of #269

@justinmoon justinmoon closed this Jul 14, 2022
@justinmoon justinmoon deleted the client-config branch July 31, 2022 11:20
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