티스토리 뷰

블록체인

Geth) Geth 콘솔

LHOIKTN 2021. 12. 27. 00:47

예전에 litecoin에서 했던거랑 비슷

 

 

geth 콘솔 들어가기

geth attach ipc:\\.\pipe\geth.ipc
PS C:\Users\kdch0\geth_practice> geth attach ipc:\\.\pipe\geth.ipc
Welcome to the Geth JavaScript console!

instance: Geth/v1.10.14-stable-11a3a350/windows-amd64/go1.17.5
coinbase: 0xfb33f05afd6ce086b01437a1ad146a0209f5981c
at block: 149 (Mon Dec 27 2021 00:24:27 GMT+0900 (KST))
 datadir: C:\Users\kdch0\geth_practice
 modules: admin:1.0 debug:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

To exit, press ctrl-d or type exit

 

 

코인베이스 확인

> eth.coinbase
"0xfb33f05afd6ce086b01437a1ad146a0209f5981c"

 

계정 확인

> eth.accounts
["0xfb33f05afd6ce086b01437a1ad146a0209f5981c", "0xcff6beb5e4eaf1bca9c68a7a54847942b0d9d2fe", "0x69cd9b5a71bbe84c866d161a62cd508ccda293d9"]

 

계정 잔액 확인

> eth.getBalance(eth.accounts[1])
0
> eth.getBalance(eth.accounts[0])
334000000000000000000

 

wei를 eth로 변환해서 보기

> web3.fromWei(eth.getBalance(eth.coinbase),"ether")
350

 

채굴 종료

 miner.stop()

 

채굴 시작(스레드 수)

 miner.start(2)

 

계정 unlock(주소,"비밀번호",시간(ms))

personal.unlockAccount(eth.coinbase,"940823",200)

 

전송

eth.sendTransaction({from:eth.coinbase,to:eth.accounts[1],value:web3.toWei(20,"ether")})
"0xbb8bc0ebc3b979605c886b9c31e5ca2f262609733f2a6ee1328fbd766bc49792"
> eth.getBalance(eth.accounts[1])
20000000000000000000
> web3.fromWei(eth.getBalance(eth.accounts[1]),"ether")
20

 

728x90
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함