보관함

ethereum geth

  • 환경
    • Ubuntu 20.04
  • 설치
    • 소스를 받아서 빌드하는 방법도 있겠지만 간편하게 시스템을 운영하기 위해 apt를 사용하는 방식으로 설치
sudo apt install ethereum
  • 개발 환경 구성
    • genesis.json 구성 : 특별히 eiplxxblock 부분은 ethereum이 발전되어 가면서 계속 항목이 추가 되는 것 같다. 만약 이 글을 보고 그 후에 돌리려 하는데 제대로 안 도는 경우 새로 생성된 부분이 있는지 확인이 필요
{
  "config": {
        "chainId": 8484,
        "homesteadBlock": 0,
        "eip150Block": 0,
        "eip155Block": 0,
        "eip158Block": 0,
	"byzantiumBlock": 0,
	"constantinopleBlock": 0,
	"petersburgBlock": 0,
	"istanbulBlock": 1000
    },
  "alloc"      : {},
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x2",
  "extraData"  : "",
  "gasLimit"   : "0x47e7c5",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}
  • geth 초기화 (최초 블록 생성 genesis.json 사용)
geth  --datadir  ethereum  init genesis.json
  • geth 실행
geth --networkid 8484 \
        --nodiscover \
        --maxpeers 0 \
        --http --http.corsdomain "*" \
        --http.api web3,miner,eth,debug,personal,net,admin,clique \
        --allow-insecure-unlock \
        --snapshot=false \
        --unlock 0xbaeea1f241f74a95e33db04a70c3c115868c58b9 \
        --password pword \
        --ethstats bootnode1:[email protected]:8080 \
        console 2>> eth.log

 

CR LF 처리

프로젝트 파일들 안에 CRLF 를 사용하는 파일과 LF 를 사용하는 파일이 혼재 되어 있을때…

git을 사용한다면…

lf 로만 처리를 하고 싶다면…

git config core.autocrlf false 
git rm --cached -r . 
git reset --hard

P.S. 이 처리 이후에 git이 연결이 안되는 상황이 발생했다. 근데 다시 해보니까 잘된다..

프로그램 실행시 로그를 날짜별로 자장하면서 콘솔상에 출력

command 2>&1 | tee "./result/$(date +%Y%m%d_%H%M%S).log”