lightning icon indicating copy to clipboard operation
lightning copied to clipboard

Please clarify "multifundchannel"

Open hMsats opened this issue 3 years ago • 6 comments

The option multifundchannel is totally unclear (to me). I know it's still experimental, but still.

To use it:

"destinations is an array of objects, with the fields". What does an "array of objects" look like? I have no idea. PLEASE ADD AN EXAMPLE! For example, somewhere here.

Is it:

lightning-cli id=123 amount=100000 id=456 amount=150000 feerate=5000perkb

or something like this

lightning-cli destinations={123 100000 456 150000} feerate=5000perkb

Is it JSON related? A simple example would clear it all up.

Also, in the lightning-cli help add an example. The use of the "=" is also not obvious, could just as well have been a space. I know that now but in the past I had to find that out by googling.

Finally: thanks for all the hard work 😀

hMsats avatar Jul 11 '21 11:07 hMsats

@rustyrussell

manreo avatar Jul 22 '21 22:07 manreo

@ZmnSCPxj ?

manreo avatar Sep 17 '21 10:09 manreo

Should look something like that: https://github.com/ElementsProject/lightning/issues/4100#issuecomment-701004517 @cdecker

manreo avatar Sep 20 '21 20:09 manreo

Such an example is indispensable in: lightning-cli help multifundchannel

hMsats avatar Sep 20 '21 21:09 hMsats

I agree..

manreo avatar Sep 20 '21 23:09 manreo

My favourite format (also json autoformatting tools help - like CTRL+SHIFT+i in VSCode):

₿ lightning-cli multifundchannel '[
    {
        "id": "nodeID1",
        "amount": "amount_in_sats"
    },
    {
        "id": "nodeID2",
        "amount": "amount_in_sats"
    },
    {
        "id": "nodeID3",
        "amount": "amount_in_sats"
    },
    {
        "id": "nodeID4",
        "amount": "amount_in_sats",
    }
]' 1000perkb

Returned output:

{
    "tx": "RAW............TX",
    "txid": "TX................ID",
    "channel_ids": [
        {
            "id": "nodeID1",
            "channel_id": "CHANNEL_ID2",
            "outnum": 3
        },
        {
            "id": "nodeID2",
            "channel_id": "CHANNEL_ID1",
            "outnum": 4
        },
        {
            "id": "nodeID3",
            "channel_id": "CHANNEL_ID4",
            "outnum": 1
        },
        {
            "id": "nodeID4",
            "channel_id": "CHANNEL_ID3",
            "outnum": 2
        }
    ],
    "failed": []
}

openoms avatar Jun 08 '22 09:06 openoms