./autogen.sh
./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" --enable-cxx --with-zmq --without-gui --disable-shared --with-pic --disable-tests --disable-bench --enable-upnp-default --disable-wallet
make -j "$(($(nproc)+1))"
sudo make install
The parameters in this command are explained below:CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768"
This allows us to conserve memory.--enable-cxx
--with-zmq
ZMQ is used to stream data from bitcoind to LND.--without-gui
We will not need the graphical interface for our setup.--disable-shared
--with-pic
--disable-tests
--disable-bench
--enable-upnp-default
UPnP allows for automatic port mapping.--disable-wallet
As we will not be using the bitcoind wallet we can disable it.make -j "$(($(nproc)+1))"
might help to speed up the build on some machines compared to make.~/.lnd/lnd.conf
on MacOS /Users/[username]/Library/Application Support/Lnd/lnd.conf
and in Windows C:\Users\<username>\AppData\Local\Lnd
externalip=INSTANCE_IP
debuglevel=CNCT=debug,CRTR=debug,HSWC=debug,NTFN=debug,RPCS=debug
bitcoind.rpcpass=
bitcoind.rpcuser=
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
bitcoin.minhtlc=1
ignore-historical-gossip-filters=1
bitcoin.feerate=1
bitcoin.basefee=1000
db.bolt.auto-compact=1
channel.db
database at every startup, which will improve performance of your node.max-channel-fee-allocation=1.0
maxpendingchannels=10
bitcoin.defaultchanconfs=2
max-cltv-expiry=5000
routerrpc.apriorihopprob=0.5
routerrpc.aprioriweight=0.75
routerrpc.attemptcost=10
routerrpc.attemptcostppm=10
routerrpc.maxmchistory=10000
routerrpc.minrtprob=0.005
routerrpc.penaltyhalflife=6h0m0s
sudo iptables -N syn_flood
sudo iptables -A INPUT -p tcp --syn -j syn_flood
sudo iptables -A syn_flood -m limit --limit 1/s --limit-burst 3 -j RETURN
sudo iptables -A syn_flood -j DROP
sudo iptables -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j ACCEPT
sudo iptables -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j LOG --log-prefix PING-DROP:
sudo iptables -A INPUT -p icmp -j DROP
sudo iptables -A OUTPUT -p icmp -j ACCEPT
tlsextradomain=
externalhosts=my-node-domain.com