Skip to content

Commit c81f6fc

Browse files
author
bebebe-cmd
committed
manpages bitcoin & cln
1 parent 5b83fbc commit c81f6fc

File tree

2 files changed

+85
-75
lines changed

2 files changed

+85
-75
lines changed

how-tos/bitcoind.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ After first login, consider to replace default issued ssh access key and set pas
88

99
SSH password authentication is disabled by default
1010

11+
Before you start, you may want to install text editor with `pkg install -y nano`
12+
1113
Inside instance you can execute `bitcoin-cli` commands
1214

1315
`aladfar:/root@[13:08] # bitcoin-cli getblockchaininfo`
@@ -57,7 +59,7 @@ Inside instance you can execute `bitcoin-cli` commands
5759
5860
```
5961

60-
And edit the configuration of `bitcoind` in `
62+
Edit with text editor (i.e. `nano`) the configuration of `bitcoind` in `
6163

6264
`aladfar:/root@[13:08] # ls -la /usr/local/etc/`
6365

how-tos/clightning.md

+82-74
Original file line numberDiff line numberDiff line change
@@ -2,110 +2,118 @@
22

33
You can order a fully operational `c-lightning` node
44

5-
c-lightning in FreeBSD jail with `root` access and completely dedicated datadir (but shared bitcoind)
5+
[c-lightning](https://github.com/ElementsProject/lightning) in FreeBSD jail with `root` access and completely dedicated datadir (but shared bitcoind)
66

77
After first login, consider to replace default issued ssh access key and set password for user *freebsd* and/or root if required.
88

99
SSH password authentication is disabled by default
1010

1111
Inside instance you can execute `lightning-cli` commands
1212

13-
`aladfar:/root@[13:08] # bitcoin-cli getblockchaininfo`
13+
Before you start, you may want to install text editor with `pkg install -y nano`
14+
15+
`muphrid:/root@[13:28] # lightning-cli getinfo`
1416

1517
```
1618
{
17-
"chain": "main",
18-
"blocks": 661744,
19-
"headers": 661744,
20-
"bestblockhash": "000000000000000000020f29eb5c90e6e48ce687b546d3fb499ab6d977af1c07",
21-
"difficulty": 18670168558399.59,
22-
"mediantime": 1608206293,
23-
"verificationprogress": 0.9999949501179342,
24-
"initialblockdownload": false,
25-
"chainwork": "000000000000000000000000000000000000000016f90c9acb758a775a014c77",
26-
"size_on_disk": 359058733092,
27-
"pruned": false,
28-
"softforks": {
29-
"bip34": {
30-
"type": "buried",
31-
"active": true,
32-
"height": 227931
33-
},
34-
"bip66": {
35-
"type": "buried",
36-
"active": true,
37-
"height": 363725
38-
},
39-
"bip65": {
40-
"type": "buried",
41-
"active": true,
42-
"height": 388381
43-
},
44-
"csv": {
45-
"type": "buried",
46-
"active": true,
47-
"height": 419328
48-
},
49-
"segwit": {
50-
"type": "buried",
51-
"active": true,
52-
"height": 481824
53-
}
54-
},
55-
"warnings": ""
19+
"id": "02a6db7b91ba805687eb668d3d776b1ef5c4b90118992feb172e6a7b297179410d",
20+
"alias": "[email protected]",
21+
"color": "02a6db",
22+
"num_peers": 0,
23+
"num_pending_channels": 0,
24+
"num_active_channels": 0,
25+
"num_inactive_channels": 0,
26+
"address": [
27+
{
28+
"type": "ipv4",
29+
"address": "85.241.9.25",
30+
"port": 9735
31+
}
32+
],
33+
"binding": [],
34+
"version": "0.8.2.1",
35+
"blockheight": 661746,
36+
"network": "bitcoin",
37+
"msatoshi_fees_collected": 0,
38+
"fees_collected_msat": "0msat",
39+
"lightning-dir": "/var/db/c-lightning/bitcoin"
5640
}
57-
5841
```
5942

60-
And edit the configuration of `bitcoind` in `
61-
62-
`aladfar:/root@[13:08] # ls -la /usr/local/etc/`
43+
Edit the with text editor (i.e. `nano`) your configuration of `lightningd` in
6344

45+
`muphrid:/root@[13:28] # ls -la /usr/local/etc/`
6446
```
6547
...
66-
-rw-r--r-- 1 root wheel 1232 Dec 17 13:06 bitcoin.conf
67-
-rw-r--r-- 1 root wheel 704 Oct 4 21:15 bitcoin.conf.sample
48+
-r-------- 1 c-lightning c-lightning 2155 Dec 17 13:27 lightningd-bitcoin.conf
49+
-r-------- 1 c-lightning c-lightning 730 Dec 12 05:25 lightningd-bitcoin.conf.sample
6850
...
6951
```
7052

71-
To apply configuration, stop and start `bitcoind`
53+
To apply configuration, stop and start `lightningd`
7254

7355
```
74-
aladfar:/root@[13:09] # bitcoin-cli stop
75-
Bitcoin Core stopping
56+
muphrid:/root@[13:29] # lightning-cli stop
57+
"Shutdown complete"
7658
```
7759

7860
```
79-
aladfar:/root@[13:10] # service bitcoind start
80-
Performing sanity check on bitcoind configuration:
81-
Bitcoind is not running
82-
Starting bitcoind:
61+
muphrid:/root@[13:33] # service lightningd start
62+
Waiting for bitcoind to start serving RPC, lightningd cannot start without it 20
63+
...
64+
Waiting for bitcoind to start serving RPC, lightningd cannot start without it 1
65+
eval: bitcoin-cli: not found
66+
Failed: bitcoind did not start serving RPC, starting lightningd anyway
67+
Starting lightningd.
68+
plugin-sparko initialized plugin v2.5
69+
plugin-sparko Login credentials read: qzuoulyjtm:rghpxycumm (full-access key: cUNipCvymI5SVgC9u0C1rGYOS0qb9S22xBUMaMwuM)
70+
plugin-sparko 2 keys read: skdoukezwd (full-access), pzkebdmluz (3 permission)
71+
plugin-sparko HTTP server on http://0.0.0.0:9737/
8372
```
8473

85-
Check status:
74+
Your `c-lightning` node is powered with [Sparko plugin](https://github.com/fiatjaf/sparko),
75+
so you have HTTP API for `c-lighning` out of the box.
76+
Simply `curl` you public IP from your local terminal:
77+
78+
`you@laptop # curl -k https://85.241.9.25/rpc -d '{"method": "getinfo"}' -H 'X-Access: cUNipCvymI5SVgC9u0C1rGYOS0qb9S22xBUMaMwuM'`
8679

8780
```
88-
aladfar:/root@[13:11] # ps -aux | grep bitcoin
89-
bitcoin 32845 172.3 1.3 2529252 855236 - SNsJ 13:11 0:15.17
90-
/usr/local/bin/bitcoind -conf=/usr/local/etc/bitcoin.conf -datadir=/var/db/bitcoin
81+
{
82+
"id":"02a6db7b91ba805687eb668d3d776b1ef5c4b90118992feb172e6a7b297179410d",
83+
"alias":"[email protected]",
84+
"color":"02a6db",
85+
"num_peers":0,
86+
"num_pending_channels":0,
87+
"num_active_channels":0,
88+
"num_inactive_channels":0,
89+
"address":[
90+
{
91+
"type":"ipv4",
92+
"address":"85.241.9.25",
93+
"port":9735}
94+
],
95+
"binding":[],
96+
"version":"0.8.2.1",
97+
"blockheight":661746,
98+
"network":"bitcoin",
99+
"msatoshi_fees_collected":0,
100+
"fees_collected_msat":"0msat",
101+
"lightning-dir":"/var/db/c-lightning/bitcoin"
102+
}
91103
```
92104

93-
Access `bitcoind` datadir
105+
You may want to use your own dedicated bitcoin RPC, to do so, order a bitclouds `bitcoind`
106+
or point your `lightnind` to existing `bitcoind` node:
107+
108+
`muphrid:/root@[13:47] # nano /usr/local/etc/lightningd-bitcoin.conf`
94109

95-
`aladfar:/root@[13:11] # ls -la /var/db/bitcoin/`
110+
```
111+
...
112+
bitcoin-rpcconnect=10.15.0.1
113+
bitcoin-rpcpassword=Hszd_4vr53634345vvsdFLLNnfw422f5a2f6=
114+
bitcoin-rpcport=8332
115+
bitcoin-rpcuser=845Fd332
116+
...
96117
97118
```
98-
-rw------- 1 bitcoin bitcoin 0 Nov 3 17:14 .lock
99-
-rw------- 1 bitcoin bitcoin 0 Nov 3 17:15 .walletlock
100-
-rw------- 1 bitcoin bitcoin 37 Nov 3 17:15 banlist.dat
101-
-rw------- 1 bitcoin bitcoin 6 Dec 17 13:11 bitcoind.pid
102-
drwx------ 3 bitcoin bitcoin 4735 Dec 17 08:10 blocks
103-
drwx------ 2 bitcoin bitcoin 2142 Dec 17 13:11 chainstate
104-
drwx------ 2 bitcoin bitcoin 3 Dec 17 13:11 database
105-
-rw------- 1 bitcoin bitcoin 0 Nov 3 17:15 db.log
106-
-rw------- 1 bitcoin bitcoin 10312426 Dec 17 13:12 debug.log
107-
-rw------- 1 bitcoin bitcoin 247985 Dec 17 13:10 fee_estimates.dat
108-
-rw------- 1 bitcoin bitcoin 32179889 Dec 17 13:10 mempool.dat
109-
-rw------- 1 bitcoin bitcoin 4140208 Dec 17 13:10 peers.dat
110-
-rw------- 1 bitcoin bitcoin 1490944 Dec 17 13:11 wallet.dat
111-
```
119+

0 commit comments

Comments
 (0)