Skip to content

Commit 189c4df

Browse files
committed
Adding simnet instructions to README
1 parent ee130ad commit 189c4df

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

README.md

+72
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,75 @@ If you want Prettier to help you by applying changes on save you have to change
4040
### LND
4141

4242
We are using the [LND](https://github.com/lightningnetwork/lnd) REST [API](https://app.swaggerhub.com/apis/lnd-rest/rpc-proto/master)
43+
44+
#### Run you LND with btcd simnet
45+
46+
Simnet is a development/test network run locally that allows us to generate blocks at will, so we can avoid the time-consuming process of waiting for blocks to arrive for any on-chain functionality.
47+
48+
In order to work with [`lnd`](https://github.com/lightningnetwork/lnd), the following build dependencies are required:
49+
50+
- **Go:** `lnd` and `btcd` are written in Go. To install, run one of the following commands:
51+
52+
```
53+
sudo apt-get install golang-1.11-go
54+
```
55+
56+
And adding the environment variables to your user's .profile::
57+
58+
```
59+
export PATH=$PATH:/usr/local/go/bin
60+
export PATH=$PATH:$(go env GOPATH)/bin
61+
export GOPATH=$(go env GOPATH)
62+
```
63+
64+
- [`btcd`](https://github.com/btcsuite/btcd)
65+
Run the following commands to obtain btcd, all dependencies, and install it:
66+
67+
```bash
68+
go get -u github.com/Masterminds/glide
69+
git clone https://github.com/btcsuite/btcd $GOPATH/src/github.com/btcsuite/btcd
70+
cd $GOPATH/src/github.com/btcsuite/btcd
71+
glide install
72+
go install . ./cmd/...
73+
```
74+
75+
- [`lnd`](https://github.com/lightningnetwork/lnd)
76+
Run the following commands to obtain and install lnd:
77+
78+
```
79+
go get -d github.com/lightningnetwork/lnd
80+
cd $GOPATH/src/github.com/lightningnetwork/lnd
81+
make && make install
82+
```
83+
84+
Once you have `lnd` and `btcd` you can continue:
85+
86+
- Running simnet
87+
88+
```
89+
btcd --simnet --txindex --rpcuser=kek --rpcpass=kek
90+
```
91+
92+
- Generate bloks using btcctl cli
93+
94+
```
95+
btcctl --simnet --rpcuser=kek --rpcpass=kek generate 400
96+
```
97+
98+
- Run LND
99+
100+
```bash
101+
lnd --restlisten=localhost:8001 --datadir=~/.lnd/data --logdir=~/.lnd/log --debuglevel=info --bitcoin.simnet --bitcoin.active --bitcoin.node=btcd --btcd.rpcuser=kek --btcd.rpcpass=kek
102+
```
103+
104+
- Test if it works:
105+
106+
```bash
107+
lncli --macaroonpath=~/.lnd/data/chain/bitcoin/simnet/admin.macaroon getinfo
108+
```
109+
110+
- Use the REST API
111+
112+
```bash
113+
curl --insecure --header "Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 ~/.lnd/data/chain/bitcoin/simnet/admin.macaroon)" https://localhost:8001/v1/getinfo
114+
```

0 commit comments

Comments
 (0)