1. 우분투 패키지 매니저 업데이트
우분투 패키지매니저는 시간이 지남에따라서 패키지 의존성 등이 최신과 맞지 않을 수 있음
<shell />sudo apt-get update
2. Dependencies 설치
빌드 도구 설치
<shell />sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
선택 사항 (UPnP, ZeroMQ)
<shell />sudo apt-get install libminiupnpc-dev libzmq3-dev
버클리 DB 설치
지갑(wallet) 만들려면 필요하며, 예전 버전에 의존성을 갖기 때문에 4.8버전으로 설치합니다
<shell />sudo apt-get install software-properties-common sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install libdb4.8-dev libdb4.8++-dev
에러 발생 방지 설치
우분투 버전 및 패키지 매니저 혹은 여러 라이브러리들이 버전이 안맞을 경우 에러가 발생할 수 있다.
<shell />sudo apt install software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9
3. 소스코드 컴파일 및 설치
git 설치 소스코드 형상관리 도구 설치
<shell />sudo apt-get install git
소스코드 얻기
<shell />mkdir src cd src/ git clone https://github.com/bitcoin/bitcoin.git
설정 및 빌드
<shell />cd bitcoin ./autogen.sh ./configure make
멀티쓰레딩 옵션으로 make -j 4 컴파일 해보니, 중간에 메모리 부족으로 중단되는 현상 발생 (메모리 4G 기준)
./configure 명령어 실행 후 에러 발생 시
<shell />checking whether std::filesystem can be used without link library... no checking whether std::filesystem needs -lstdc++fs... no
아래의 명령어로 ./configure 재 실행
<shell />CC=gcc-8 CXX=g++-8 ./configure
설치 - 선택사항 bitcoin core 명령어들을 어디에서든 사용하고 싶은 경우
<shell />make install
testnet, regtestnet을 이용해서 테스트는 얼마든지 가능합니다.
용량도 적을뿐더러 하지만 mainnet을 이용하시려면 충분한 하드디스크 용량이 있어야합니다.
감사합니다.