현재 저희는 eth 노드를 GO-language 로 구현한 go eth 를 줄인 geth 라는 이더리움 노드를 사용하고 있습니다. 설치 방법은 비트코인계열과 마찬 가지로 제공 하는 방법을 그대로 따라합니다

 

Ex) https://github.com/ethereum/go-ethereum/blob/master/README.md

Git 주소 https://github.com/ethereum/go-ethereum

 

 

- 노드 설치

apt-get update && sudo apt-get upgrade -y
apt-get install make
apt-get install build-essential


wget https://dl.google.com/go/go1.16.linux-amd64.tar.gz
tar -xzf go1.16.linux-amd64.tar.gz
mv go /usr/local
echo 'GOPATH="/usr/local/go"' >> ~/.profile
echo 'PATH="$PATH:$GOPATH/bin"' >> ~/.profile
source .profile

 

1. 해당 코인 github 접속, releases 탭으로 이동, 받고자 하는 버전의 source code (tar.gz) 링크 주소 복사, 설치하고자 하는 서버에서 다운로드 합니다.

Ex) https://github.com/ethereum/go-ethereum/archive/v1.9.20.tar.gz
2.
압축 해제 후, 해당 디렉토리로 이동합니다.
ex) tar -xvzf v1.9.20.tar.gz

3. make geth

4. 빌드가 끝난 후 /build/bin 에 있는 geth 실행 파일을 /usr/local/bin 으로 복사합니다.

Ex) cp geth /usr/local/bin

5. screen –S ETH 명령어로 screen 을 생성 후 아래와 같은 명령어로 geth 를 실행시켜 줍니다.

geth --rpc --rpcaddr 0.0.0.0 --port 30303 console

6.     이후 ctrl + a, d 커맨드를 통해 스크린을 유지한 채 빠져 나옵니다.
(
스크린 재 접속시 screen –r ETH)

 

cd 자기 자신 경로

#vi .screenrc

defscrollback 5000
termcapinfo xterm* ti@:te@
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n*%t%{-}%+w %= %c ${USER}@%H"
bindkey -k k1 select 0
bindkey -k k2 select 1
bindkey -k k3 select 2

 

 

 

 

- 노드 업그레이드

1. 노드 설치에 있는 1~3 까지 진행 합니다.

 2. screen –r ETH screen 접근 후 exit 명령어를 통해 노드를을 멈추고 ctrl+a , d 를 통해 screen을 유지한 채 나옵니다.

3.  설치 방법 4번을 진행 후 screen –r ETH 통해 접근 후 아래의 명령어로 노드를 실행 시켜 줍니다.

geth --rpc --rpcaddr 0.0.0.0 --port 30303  --datadir /home/eth/data console

 

 

 

- 노드 운영방법

시작 : screen 세션 생성 후

geth --rpc --rpcaddr 0.0.0.0 --port 30303 --datadir /home/eth/data console

종료 : screen –r ETH 을 통해 세션에 접근 후 콘솔 창에서 exit 명령어로 종료

kill로 종료할 시 블록이 깨질 수 있으므로 exit을 이용합니다.

아래 명령어는 콘솔창 기준입니다.

블록 높이 확인 : eth.blockNumber

Peer 확인 : admin.peers

Node 정보 : admin.nodeInfo

이외에 명령어는 아래에서 확인할 수 있습니다.

 


 https://ethereum.stackexchange.com/questions/28703/full-list-of-geth-terminal-commands

추가적으로 ethetc가 블록을 못 받아올 경우 노드를 재시작 해주면 됩니다.

블로그 이미지

iesay

,