bitcoin 빌드해보기

오미희·2021년 12월 8일
0

blockchain

목록 보기
11/13

🌞 설명서

https://github.com/bitcoin/bitcoin
위 주소에 들어간 후 doc 폴더 들어감
> doc
> build-windows.md
// 위의 build-windows.md를 보면 window 환경에서 bitcoin 빌드해보는 방법 설명되어 있음
// 개인적으로 정리한 곳
https://github.com/ohmihee/block_chain/blob/litecoin/srcCopy_0907/bitcoin.md

bitcoin 빌드해보기

// window terminal에서
> wsl
> cd ~ --> 홈디렉토리에서 작업시작
> sudo apt update
> sudo apt upgrade
// do you want to continue ==> y
> sudo apt install build-essentail libtool autotools-dev automake pkg-config bsdmainutils curl git

build-essential -> c나 c++에 필요한 라이브러리 기본적으로 제공
libtool -> 라이브러리 총괄적으로 스크립트로 지원
autotools-dev -> // automake -> Makefile을 자동적으로 생성해주는 라이브러리
pkg-config -> 위랑 비슷
bsdmainutils (bsd-main-utils) -> 유닉스계열 운영체제인 bsd의 유틸프로그램을 모음.
curl -> http의 요청을 보내줌
git -> git 설치해줌  --> 나중에 git clone 하기 위함.

> sudo apt install nsis
> mkdir workspace
> cd workspace
// workspace 폴더에 들어가서 bitcoin 빌드를 위해 필요한 git clone
> git clone https://github.com/bitcoin/bitcoin.git
> ls -al --> 폴더 생성된 것 확인
> cd bitcoin --> 생성된 폴더로 이동
> sudo apt install g++-mingw-w64-x86-64
// g++-mingw-w64-x86-64 -> c언어 컴파일해주는 프로그램
> sudo update-alternatives --config x86_64-w64-mingw32-g++ --> 실질적으로 c++로 빌드해줌.
// 위의 명령어 입력후 나오는 거에 1 입력
> PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')

// 현재 나의 PATH값을 알 수 있다. // echo "$PATH" | grep /usr -> 필터로 usr를 보여줌 // sed -e 's/:/mnt.//g' -> 뒤의 것으로 바꾸어줌 // sed는 찾아바꾸기 기능과 비슷.

> sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status"
> ls -al --> depends 폴더가 존재하는지 확인
> cd depends
> ls -al --> depends폴더 내부에 makefile이 존재하는지 확인
> make HOST=x86_64-w64-mingw32 --> 빌드를 시작하는 명령어
// 위의 명령어 입력 후 작업이 엄청 오랫동안 진행됨...
> cd .. --> depends 폴더에서 나옴
> ls --> // 해당 위치에서 autogen.sh 파일이 존재하는지 확인
> ./autogen.sh --> autogen.sh 파일 실행
> CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
> ls -al --> makefile 생성된 것 확인
> make -j 4
// make -j n --> n개의 프로세스로 처리 ex) make -j 4
// make -> 뒤에 다른 옵션 주지 않고 make만 입력하면 1개의 프로세스로만 처리
> sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status"
// install 파일을 넣을 디렉토리 만들고
> make isntall DESTDIR=/mnt/c/work...
--> window에서 클론한 폴더를 넣으려는 경로
ex) make install DESTDIR=/mnt/c/Users/오미희/Desktop/bitcoin_build
// 나의 경우 Desktop내의 bitcoin_build 폴더
// 해당 위치에서 make deploy
> make deploy
// window 터미널에서 bitcoin_build 폴더로 가서 bin / include / lib / share 안에 data 파일 생성
// window 터미널에서 다시 bin폴더에 가서
// pwd --> C:\Users\오미희\Desktop\bitcoin_build\bin
> ./bitcoin-qt.exe -datadir=c:\work\data
-->bitcoin core 실행함. // 계속 켜두면 컴퓨터 성능 저하됨. 빨리 끌 것.
// 나의 경우는
ex) > ./bitcoin-qt.exe -datadir=c:\Users/오미희/Desktop/bitcoin_build

‼ ERROR ‼

1) /bin/sh : 1: File/nodejs/:/mnt/c/Program: not found

==> 경로문제 -> PATH=(echo"(echo "PATH" | sed -e 's/:/mnt.*//g')

2) B2_TOOLSET is gcc, but the 'gcc' command connect be executed. Make sure 'gcc' is in PATH, or use a different toolsest, gcc

gcc설치가 안 되어 있는 것 같아서
==> sudo apt install gcc

profile
안녕하세요

0개의 댓글