Lightning Network (BOLT)
rm -rf db
).xx.xx.xx.xx
and yy.yy.yy.yy
respectively for lnd
and ptarmigan
.~/.bitcoin/bitcoin.conf
rpcuser=bitcoinuser
rpcpassword=bitcoinpassword
server=1
txindex=1
testnet=1
~/.btcd/btcd.conf
testnet=1
txindex=1
rpcuser=nayuta
rpcpass=nayuta
~/.btcctl/btcctl.conf
rpcuser=nayuta
rpcpass=nayuta
~/.lnd/lnd.conf
[Application Options]
debughtlc=true
maxpendingchannels=10
no-macaroons=true
debuglevel=trace
nobootstrap=1
[Bitcoin]
bitcoin.active=1
bitcoin.testnet=1
bitcoin.node=btcd
bitcoind
/btcd
bitcoind -daemon
btcd&
Waiting for synchronization
[ptarmigan] Running ptarmd
cd install
./new_nodedir.sh
cd node
../ptarmd --network=testnet&
lnd
rm -rf ~/.lnd/data
lnd
lnd --no-macaroons
lncli --no-macaroons unlock
next time.lncli --no-macaroons create
lncli --no-macaroons getinfo
../pay_fundin.py 1000000 0
pay_fundin.py
will create a file in fund_yyyymmddhhmmss.conf
format.../ptarmcli -c [PEER NODE_ID]@[IPv4 ADDR]:[PORT]
../ptarmcli -c [PEER NODE_ID] -f fund_yyyymmddhhmmss.conf
The channel is gererated after reaching three blocks.
When status is established in a result of ptarmcli -l
, we can confirm that if the channel is generated.
Combining watch
and jq
is also available for observing it.
watch -n 10 "../ptarmcli -l | jq '.result.client[].status'"
Now we will move on how to send payment.
ptarmigan
–> lnd
lncli --no-macaroons addinvoice --amt 100000
100000 satoshi
= 1 mBTC
../ptarmcli -r <BOLT11 invoice>
../showdb -w | jq
lnd
–> ptarmigan
../ptarmcli -i 20000
20000 msat
= 20 satoshi
lncli --no-macaroons payinvoice <BOLT11 invoice>
lncli --no-macaroons listchannels