Skip to content

Instantly share code, notes, and snippets.

@dougvk
Last active January 24, 2018 06:25
Show Gist options
  • Save dougvk/8d1ae818e43a105941ab32f70319995d to your computer and use it in GitHub Desktop.
Save dougvk/8d1ae818e43a105941ab32f70319995d to your computer and use it in GitHub Desktop.
Route and pay Bolt 11

Find a route to the node

root@docker-s-6vcpu-16gb-nyc3-01:~# lightning-cli getroute 02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432 200000000 0
{ "route" :
    [
        { "id" : "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432", "channel" : "505231:2001:1", "msatoshi" : 200000000, "delay" : 9 } ] }

Pay the BOLT11 address

root@docker-s-6vcpu-16gb-nyc3-01:~# lightning-cli pay lnbc1712393610p1pdx8n8mpp5c72tc40vzyf9deqm5lzn76404heejady02l494ykke3vm3x44y8qdy2gfkx7cmtwd68yetpd5azqv339cunvgz42dzzqen0wgsyymr0vd4hxarjv4sk6gznv96x2mrvd96x2grnw35kx6m9wgs8sgp5ypskuepqf35kw6r5de5kueeqwd6xjcmtv4ezq7pqxvcqpggq86huylgdcd4st0d8thgdlw67tefjkhrnssyf8zk2s9cu37hdanwm6q96llg5zgjckwe7jamsmxnp4vy4q7vyulv57d9yg0wm7df0cpgwgu2m
{ "preimage" : "79f88fe9765997d2005e012ff32bc5dceeb99b111b81aa5087b815f2e4cdc59a" }

Check how much is left in the channel

root@docker-s-6vcpu-16gb-nyc3-01:~# lightning-cli getpeers
{ "peers" :
	[
		{ "state" : "CHANNELD_NORMAL", "netaddr" :
			[ "104.198.32.198:9735" ], "peerid" : "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432", "connected" : true, "owner" : "lightning_channeld", "channel" : "505231:2001:1", "msatoshi_to_us" : 28760639, "msatoshi_total" : 200000000 }]}
@cndaniel
Copy link

Hi @dougvk:
This is a typo in command line of the Check how much is left in the channel. Instea d of lightning-cli getpeers, shouldn't it be lightning-cli listpeers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment