0

I'm struggling to work out how I can setup a channel between two lightning nodes so that I can send a single payment from one node to the other.

I have set up two separate c-lightning nodes connected to two separate bitcoind testnet nodes.

The steps I've taken are:

  1. Node 1 - lightning-cli connect node2id
  2. Node 2 - lightning-cli connect node1id
  3. Node 1 - lightning-cli fundchannel node2-channelid 10000
  4. Node 2 - lightning-cli fundchannel node1-channelid 10000 (fails with "Peer already CHANNELD_AWAITING_LOCKIN")
  5. Node 2 - lightning-cli invoice 1000 i1 i1 (fails with "No channels have sufficient incoming capacity")

How can I set up two lightning nodes so that I can send payments from one to the other? It seems like only the first node can fund the channel (I have read there is work in progress to allow dual funded channels but can't say I completely grasp that). But then it seems as if the channel is only funded from one side there's no way payments can be made?

1 Answer 1

1

They payment is failing because you have opened a channel where node 1 has 10000 sat, and node 2 has 0 sat, and then you are trying to make node 2 pay node 1.

From what I understand, in point 4 you are attempting to have node 2 ‘add funds’ to the channel you opened in step 3. This is not how a lightning channel works: a lightning channel is a bitcoin UTXO, and you cannot ‘add bitcoins’ to an already existing UTXO. Each channel is defined when it is created, and then resolved when closed (the appropriate balance is sent to each participant).

Considering your setup, you can make a payment from node 1 to node 2. Once that is done, you’ll be able to make payments from node 2 back to node 1 (until the whole balance is pushed back to one side).

What you could also do to achieve a similar result is opening a new channel from node 2 to node 1. I’m not familiar with c-lightning, but I know that LND let’s you open two channels with the same peer. As you mentioned, dual-funding is possible but has not yet been implemented.

2
  • But how can I make a payment from node1 to node2 if I'm unable to create an invoice on node2? I'm attempting to do what's described in this article medium.com/lightwork/… in the "Opening channel between the two LND nodes" section. In my case using c-lightning.
    – sipsorcery
    Commented Nov 24, 2018 at 18:19
  • You can create an invoice on node 2 without opening up a channel from 2 to 1. Note that c-lightning at the moment is not supported to multiple channels with the same peers.
    – ogw_yuya
    Commented Apr 3, 2019 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.