geth基础操作

本文介绍了如何通过geth命令行工具进行区块链的基本操作,包括设置数据目录、配置身份、开启RPC服务,并提供了多个区块链资讯网站供参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

geth --datadir "%cd%\chain" init genesis.json


geth -datadir "%cd%\chain" console

geth --identity "PICCetherum" --rpc --rpccorsdomain "*" --datadir "%cd%\chain" --port "30303"  --rpcapi "db,eth,net,web3" --networkid 95518 console


eth.accounts
personal.newAccount("12345678")
personal.newAccount("87654321")
eth.getBalance(eth.accounts[0])
miner.start();admin.sleepBlocks(1);miner.stop()

eth.sendTransaction({from:eth.accounts[1],to:eth.accounts[0],value:web3.toWei(2,"ether"),gas:30000,gasPrice:100})
 var tx = {from: "0xe2fcbcd77c876d6d2805b46c735d453802e5bbde", to: "0x960Ce81df247f4050238FC7B95b6fc890813fe66", value: web3.toWei(1.23, "ether"),gas:30000}
 
 personal.unlockAccount("0xe2fcbcd77c876d6d2805b46c735d453802e5bbde","12345678")
 
  1. 巴比特:http://www.8btc.com/​
  2. 区块链铅笔:http://chainb.com/ 
  3. 比特头条:http://www.bitett.com/portal.php 
  4. 区块链中文社区:https://bitshuo.com/ 
  5. CNN:http://www.cryptocoinsnews.com/
  6. BTT论坛(需翻墙):http://www.bitcointalk.org/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值