New to Nutbox?

[Bitcoin] Lightning Network Node 설정

8 comments

happyberrysboy
83
last year2 min read

Bitcoin Lightning Node 설정 방법에 대해서 알아봅니다.

설치 한 곳은 Ubuntu 20.04 입니다.
그리고 Bitcoin Full Node가 설정되어 있다는 가정하에 작성을 합니다.(어제 포스팅 한 내용에 있습니다.)


golang 설치

// 메뉴얼에는 go 1.15 버전을 받았었는데, 개인적으로는 그냥 1.19 최신버전을 설치 했었습니다.
wget https://dl.google.com/go/go1.15.6.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.15.6.linux-amd64.tar.gz

// go 명령어 PATH에 추가
// Shell 종류에 따라서 저장해야 할 파일명이 다를 수 있습니다..!!
echo "export PATH=$PATH:~/go/bin:/usr/local/go/bin" >> ~/.bashrc

// github 소스 다운로드
git clone https://github.com/lightningnetwork/lnd

// branch 선택 
git checkout tags/v0.12.0-beta

// build
make install

// .lnd 폴더 생성  및 conf 파일 생성
mkdir ~/.lnd
cd ~/.lnd
nano lnd.conf

// 아래 내용을 lnd.conf에 추가
## LND Settings
# Lets LND know to run on top of Bitcoin (as opposed to Litecoin)
bitcoin.active=true
bitcoin.mainnet=true
# Lets LND know you are running Bitcoin Core (not btcd or Neutrino)
bitcoin.node=bitcoind
## Bitcoind Settings
# Tells LND what User/Pass to use to RPC to the Bitcoin node
bitcoind.rpcuser=원하는이름설정
bitcoind.rpcpass=원하는암호설정
# Allows LND & Bitcoin Core to communicate via ZeroMQ
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
## Zap Settings
# Tells LND to listen on all of your computer's interfaces
# This could alternatively be set to your router's subnet IP
tlsextraip=0.0.0.0
# Tells LND where to listen for RPC messages
# This could also be set to your router's subnet IP
rpclisten=0.0.0.0:10009

// bitcoin.conf 에도 설정 추가
// 전에 설치 했던 ~/.bitcoin/bitcoin.conf 파일에 아래와 같이 설정을 추가해야합니다.
# Allows LND to connect to the Bitcoin node via an RPC user & pass
rpcuser=lnd.conf에서 설정했던 이름과 동일하게 설정
rpcpassword=lnd.conf에서 설정했던 암호와 동일하게 설정
# Allows LND & Bitcoin Core to communicate via ZeroMQ
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

// bitcoind 재실행
// bitcoind가 기존에 작동중이라면 kill -15 sessionid 로 중단하고 다시 재실행
bitcoind &

// bitcoind 쪽에 1분 정도 보다가 로그가 어느정도 쌓이기 시작하면 lnd 실행
lnd &

// 지갑생성
// lnd 실행후 로그를 보면 지갑설정이 필요하다는 메세지가 마지막에 뜹니다.
// 그래서 지갑을 생성해주어야 됩니다.(seed 는 당연히 잘 저장해주셔야하구요!)
lncli create

// 새 주소 생성
lncli newaddress np2wkh

// 위의 명령어를 입력하면 주소가 하나 주어지는데, 해당 주소로 비트코인을 전송을 해주어야 그 다음 부분이 작동합니다.
// 다음 부터는.. 다음 시간...

참조사이트 : https://stopanddecrypt.medium.com/a-complete-beginners-guide-to-installing-a-lightning-node-on-linux-2021-edition-ece227cfc35d#675f

Comments

Sort byBest