노드 실행

MEVerse는 Github(https://github.com/meverselabs/meverse)에 오픈 소스로 공개 되어 있습니다. github 페이지에서 누구나 코드를 다운 받을 수 있습니다.

실행환경

Linux

Golang 1.18.2

C compiler(gcc 4.9.0 or later, mingw etc.)

Genesis 블록부터 동기화를 시작한다면 아래와 같이 노드를 실행할 수 있습니다.

$ git clone https://github.com/meverselabs/meverse
$ cd ./meverse/cmd/node
$ go build
$ ./node

MEVerse에서는 매일 한번씩 context 스냅샷을 저장하고 있습니다. 최신 데이터를 다운 받아 비교적 최근 높이부터 노드를 실행할 수도 있습니다. 방법은 아래와 같습니다.

  1. https://rpc.meversemainnet.io/zipcontext 에서 context 파일을 다운로드 받는다.

  2. zipcontext 파일을 압축해제하면 data 폴더와 _config.toml 파일이 나온다.

  3. ./meverse/cmd/node/ndata 폴더를 생성하고 그 안에 data/context 파일을 위치 시킨다.

  4. _config.toml 파일의 InitGenesisHash, InitHeight, InitHash, InitTimestamp 값을 ./meverse/cmd/node/config.toml 파일에 덮어 쓴다.

  5. 빌드 후 실행

간략하게 스크립트를 작성하면 아래와 같습니다.

zipcontext.sh
git clone https://github.com/meverselabs/meverse
cd ./meverse/cmd/node
wget https://rpc.meversemainnet.io/zipcontext
unzip zipcontext
mv ./data ./ndata
sed -e "s/InitGenesisHash = \"\"/$(sed '1!d' _config.toml)/" config.toml > config.toml_ && mv config.toml_ config.toml
sed -e "s/InitHeight = 0/$(sed '2!d' _config.toml)/" config.toml > config.toml_ && mv config.toml_ config.toml
sed -e "s/InitHash = \"\"/$(sed '3!d' _config.toml)/" config.toml > config.toml_ && mv config.toml_ config.toml
sed -e "s/InitTimestamp = 0/$(sed '4!d' _config.toml)/" config.toml > config.toml_ && mv config.toml_ config.toml
# sed -e "s/RPCPort = 8541/RPCPort = 8541/" config.toml > config.toml_ && mv config.toml_ config.toml
rm -r _config.toml
rm -r zipcontext
go build
./node

RPC 서비스가 기본으로 추가되어 있으며, RPC를 통해 메인넷과 데이터를 주고 받을 수 있습니다. 8541 포트가 기본 포트로 지정되어 있으며 /cmd/node/config.toml 에서 RPCPort 필드로 수정 가능합니다.

Last updated