셋팅방법
1. https://geth.ethereum.org/downloads/
[최신버전은 버그가 있어 그 아래 버전 1.9.25 다운받았습니다.]
2. geth 폴더 생성
3. genesis.json 폴더 안에 적용할것! C:\geth\
4. 시작-> 실행 -> cmd
5. cd D:\geth\
6. geth --datadir test0630 init genesis.json
7. geth --allow-insecure-unlock --networkid 119 --datadir test0630 --rpc --rpcport 8545 --rpccorsdomain "*" --rpcapi "admin,eth,miner,net,txpool,web3,personal" console
[networkid 같은경우 제네시스 파일에 숫자 똑같이 적어주기]
[geth 옛날버전에는personal 존재 해야하나 최신버전에서는 명령어로 입력해도 출력은 된다.]
8. 시작 -> 실행 -> cmd
9. geth attach http://localhost:8545
계정만들기
10. personal.newAccount("1234")
[지갑과 함께 C:\geth\test0630\keystore 폴더에 파일이 생긴것을 볼수 있다.]
계정 확인 하기
11. eth.accounts or eth.accounts[0] or eth.coinbase
계정 마이너 적용 및 마이너 시작 및 멈춤 하기
12. miner.setEtherbase(eth.accounts[0]) [miner.start() miner.stop()]
지갑 이더 확인 명령어
13. eth.getBalance(eth.accounts[0])
블록넘버 명령어
14. eth.blockNumber
이더 확인 하고 싶을때
web3.fromWei(110000000000000000000,"ether")
web3.toWei(110)
해시레이트 확인 : 연산 처리능력을 측정하는 단위로 해시 속도를 의미한다.
eth.hashrate
계정 이더 확인 하기
web3.fromWei(eth.getBalance(eth.accounts[2]))
계정간 이더 전송하기
personal.unlockAccount(eth.accounts[1], "1234", 10)
eth.sendTransaction({from:eth.accounts[1], to:eth.accounts[2], value:web3.toWei(1)})
eth.sendTransaction({from:eth.accounts[1], to:eth.accounts[2], value:web3.toWei(1), data:web3.toHex("Hello World!")})
[https://codebeautify.org/hex-string-converter]
eth.sendTransaction({from:"0xe53f3f356178e0c07b19bbb8c7c23a39bbf4b310", to:"0x16b200744a740b0ca4379d57fc1b468d83a0382e", value:web3.toWei(10,"ether"), data:web3.toHex("Hello World!")})
eth.sendTransaction({from:eth.accounts[0], to:eth.accounts[1], value:web3.toWei(10,"ether"), data:web3.toHex("Hello World!")})
eth.sendTransaction({from:eth.accounts[0], to:eth.accounts[1], value:web3.toWei(10,"ether"), data:"0x68656c6c6f20776f726c6421"})
genesis.json 파일 생성하기
{
"config": {
"chainId": 119,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0,
"eip150Block": 0
},
"difficulty" : "0x20000",
"gasLimit" : "0x2fefd8",
"alloc" : {},
"coinbase" : "0x0000000000000000000000000000000000000000",
"extraData" : "",
"nonce" : "0x0000000000000000",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00"
}
genesis.json 파일 생성하기 2
{
"config": {
"chainId": 1234,
"homesteadBlock": 1,
"eip150Block": 2,
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"constantinopleBlock": 5,
"ethash": {}
},
"nonce": "0x00",
"timestamp": "0x00",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x47b760",
"difficulty": "0x50000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
'복붙 노트' 카테고리의 다른 글
윈도우 XAMPP 서버 운영 방법! (0) | 2021.08.02 |
---|---|
프라이빗 블록체인 이더리움 멀티 서버 셋팅 방법 (0) | 2021.07.16 |
메타마스크 & 카이카스 사용안하고 디앱 개발 결정!! (0) | 2021.07.02 |
트러플 스위트 가나쉬 와 메타마스크 연동하는 방법을 알아보자 (0) | 2021.06.21 |
이더리움 영지식증명 조크라테스 정리 해보았다. (0) | 2021.06.14 |
댓글