노드 설치
계정을 생성하였으면 다음으로 Gesia 네트워크를 구성하고 있는 genesis 파일이 필요합니다.
Genesis JSON 파일 생성
각 네트워크별 genesis.json 파일은 아래와 같습니다.
emission genesis.json
{
"config": {
"chainId": 5555,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"clique": {
"period": 15,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x65852297",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000420784628828c485950fd9a3594682b394fe4b280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1C9C380",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"420784628828c485950fd9a3594682b394fe4b28": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFeePerGas": null
}
neutral genesis.json
{
"config": {
"chainId": 5555,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"clique": {
"period": 15,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x65852297",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000ea9c97bda3f40ef86e90c84dc05554b661fbbafee4E7714903967388770A39746e9A6e8C744E5f890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1C9C380",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"ea9c97bda3f40ef86e90c84dc05554b661fbbafe": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFeePerGas": null
}
offset genesis.json
{
"config": {
"chainId": 5555,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"clique": {
"period": 15,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x65852297",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000232a028cc31da413a024ac579f4fe18c653c289f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1C9C380",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"232a028cc31da413a024ac579f4fe18c653c289f": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFeePerGas": null
}
네트워크 초기화
이제 네트워크를 초기화하기 위해 아래와 같은 Docker Compose 파일을 생성합니다.
docker-compose-geth-init.yml
version: '3'services: init: image: ethereum/client-go command: init /root/.ethereum/genesis.json volumes: - ./node:/root/.ethereum
파일을 생성한 후, 아래 명령어로 실행합니다.
$ docker-compose -f docker-compose-geth-init.yml up
파일을 실행하면 geth 디렉토리가 생성되며, 이 디렉토리에는 genesis 블록과 초기 네트워크 구성이 저장됩니다.
Geth 실행
이제 geth를 실행하기 위해 아래와 같은 Docker Compose 파일을 생성합니다.
unlock과 miner.etherbase 옵션에는 기존에 생성한 지갑 주소를 입력합니다.
docker-compose.yml
version: '3.8'services: node: image: ethereum/client-go:v1.13.11 container_name: node command: --datadir="/root/.ethereum" --syncmode="full" --gcmode="archive" --port=30303 --http --http.addr="0.0.0.0" --http.port=8501 --http.corsdomain="*" --http.api="personal,miner,eth,net,txpool,debug,clique" --http.vhosts="*" --ws --ws.addr="0.0.0.0" --ws.port=8502 --ws.api="personal,miner,eth,net,txpool,debug,clique" --networkid=5555 --verbosity=5 --unlock="88bA2E9BC988506C3F588493EdC53Acaf52a9Faf" --password=/root/.ethereum/password --miner.gasprice=0 --miner.etherbase="88bA2E9BC988506C3F588493EdC53Acaf52a9Faf" --allow-insecure-unlock --nodiscover --mine volumes: - ./node:/root/.ethereum:rw ports: - '30303:30303' - '8501:8501' - '8502:8502' networks: - gesia-networknetworks: gesia-network: driver: bridge
파일을 생성한 후, 아래 명령어로 실행합니다.
$ docker-compose up
여기까지 실행을 완료하였으면, 정상적으로 노드 설치가 마무리 되었습니다.
Last updated