4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

이더리움 geth 명령어 모음

다른 터미널로 접속하여 json-rpc (web.js)를 이용하기

geth attach rpc:http://localhost:8545

다음은 attach이후에 javascript로 수행할수 있는 명령들의 모음

eth.accounts : 현재 생성된 계정 배열
eth.blockNumber : 현재 채굴된 블록의 번호
eth.hashrate : 현재 해시레이트
eth.coinbase : 채굴이 진행되면 보상을 받을 계정. 보통 이것을 eth.accounts[0]과 동일하게 셋팅한다.
eth.mining : 현재 채굴중인지 여부
eth.getBalance(account) : 계좌 잔고 조회
eth.getTranaction(tx) : 트랜잭션의 정보
eth.sendTransaction({from:account, to:account, value:wei}) : 트랜잭션 보내기
eth.sendTransaction({from:eth.accounts[0], to:eth.accounts[1], value:web3.toWei(1,"ether")})
eth.pendingTransactions : 현재 진행을 기다리고 있는 트랜잭션

<web3.js에서는 지원이 안되는 명령어>

miner.start() : 채굴 시작. geth 시작하면 자동으로 시작되어 있음.
miner.stop() : 채굴 중단
miner.setEtherbase() : 채굴 보상을 줄 계정을 등록

personal.newAcconut(passwd) : 계정 생성
personal.unlockAccount(account, passwd) : 계정 잠금 해제. 송금등의 트랜잭션을 발생시키기 위해서는 반드시 잠금해제가 되어야 한다.

2 upvotes $0.00

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: