lnsocket

A minimal C library for connecting to the lightning network
git clone git://jb55.com/lnsocket
Log | Files | Refs | Submodules | README | LICENSE

node.js (409B)


      1 const LNSocket = require('../')
      2 
      3 async function go() {
      4 	const ln = await LNSocket()
      5 	
      6 	ln.genkey()
      7 	await ln.connect_and_init("03f3c108ccd536b8526841f0a5c58212bb9e6584a1eb493080e7c1cc34f82dad71", "24.84.152.187")
      8 	
      9 	const rune = "uQux-hID66AX5rFUpkt1p9CU_7DsTMyUC4G5yq7-dcw9MTMmbWV0aG9kPWdldGluZm8="
     10 	const res = await ln.rpc({ method: "getinfo", rune })
     11 	
     12 	ln.destroy()
     13 	console.log(res)
     14 	return res
     15 }
     16 
     17 go()