|
2 | 2 |
|
3 | 3 | You can order a fully operational `c-lightning` node
|
4 | 4 |
|
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) |
6 | 6 |
|
7 | 7 | After first login, consider to replace default issued ssh access key and set password for user *freebsd* and/or root if required.
|
8 | 8 |
|
9 | 9 | SSH password authentication is disabled by default
|
10 | 10 |
|
11 | 11 | Inside instance you can execute `lightning-cli` commands
|
12 | 12 |
|
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` |
14 | 16 |
|
15 | 17 | ```
|
16 | 18 | {
|
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 | + |
| 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" |
56 | 40 | }
|
57 |
| -
|
58 | 41 | ```
|
59 | 42 |
|
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 |
63 | 44 |
|
| 45 | +`muphrid:/root@[13:28] # ls -la /usr/local/etc/` |
64 | 46 | ```
|
65 | 47 | ...
|
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 |
68 | 50 | ...
|
69 | 51 | ```
|
70 | 52 |
|
71 |
| -To apply configuration, stop and start `bitcoind` |
| 53 | +To apply configuration, stop and start `lightningd` |
72 | 54 |
|
73 | 55 | ```
|
74 |
| -aladfar:/root@[13:09] # bitcoin-cli stop |
75 |
| -Bitcoin Core stopping |
| 56 | +muphrid:/root@[13:29] # lightning-cli stop |
| 57 | +"Shutdown complete" |
76 | 58 | ```
|
77 | 59 |
|
78 | 60 | ```
|
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/ |
83 | 72 | ```
|
84 | 73 |
|
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'` |
86 | 79 |
|
87 | 80 | ```
|
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 | + |
| 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 | +} |
91 | 103 | ```
|
92 | 104 |
|
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` |
94 | 109 |
|
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 | +... |
96 | 117 |
|
97 | 118 | ```
|
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