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

Locally funded channels #268

Merged
merged 8 commits into from
Sep 5, 2024
Merged

Locally funded channels #268

merged 8 commits into from
Sep 5, 2024

Conversation

Jasonvdb
Copy link
Collaborator

Fund channels locally from on chain wallet.
closes #30

Step 1: Create channel

const res = await lm.createChannel({
  counterPartyNodeId: 'abc123',
  channelValueSats: 20000,
  pushSats: 5000,
});

const { value_satoshis, output_script, temp_channel_id } = res.value;

Step 2: Create funding tx using on chain wallet (DO NOT BROADCAST)

  • Convert output_script to address
  • bitcoin-cli createrawtransaction '[{"txid":"<tx-id>","vout":<index>}]' '{"<address>":<btc>}'
  • bitcoin-cli signrawtransactionwithwallet <raw-transaction-hex>

Step 2: Fund channel

const res = await ldk.fundChannel({
  temporaryChannelId,
  counterPartyNodeId: peers.lnd.pubKey,
  fundingTransaction: signedTx,
 });

@Jasonvdb Jasonvdb force-pushed the local-funded-channels branch from 00133c0 to 6e19491 Compare August 30, 2024 13:18
ovitrif
ovitrif previously approved these changes Sep 3, 2024
@ovitrif
Copy link
Contributor

ovitrif commented Sep 3, 2024

@Jasonvdb @coreyphillips code looks ok by my judgement, I was eager to test it but it won't run the JS in the example app (android app starts, then shows red error screen)

was getting error:

Class private methods are not enabled. Please add @babel/plugin-proposal-private-methods to your configuration.

@ovitrif
Copy link
Contributor

ovitrif commented Sep 3, 2024

Added a PR with the changes I did, let's see if it also fixes e2e-android failing CI tests, as I was getting the same error:

coreyphillips
coreyphillips previously approved these changes Sep 4, 2024
…-fix

Fix Example app on Android for Local funded channels PR
@Jasonvdb Jasonvdb dismissed stale reviews from coreyphillips and ovitrif via a90b556 September 4, 2024 14:39
@Jasonvdb Jasonvdb merged commit 3767cc7 into master Sep 5, 2024
2 of 6 checks passed
@Jasonvdb Jasonvdb deleted the local-funded-channels branch September 5, 2024 06:44
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.

Fund channels
3 participants