geth常用命令更多技术博客 http://vilins.top/初始化私链geth --datadir /path/to/datadir init /path/to/genesis.json启动私链geth --identity TestNode --rpc --rpcport 8545 --datadir /path/to/datadir --port 30303 --nodiscover consol创建账户可直接在括号加密码personal.newAccount()获取账户余额eth.getBalance(myAddress)编译solc --bin testContract.sol solc --abi testContract.sol解锁账户personal.unlockAccount(myAddress)发送部署的合约myContract eth.contract(abi) contract myContract.new({from:myAddress,data:code,gas:1000000})获取正在等待确认的交易eth.getBlock(pending,true).transactions调用智能合约contract.multiply.sendTransaction(10, {from:myAddress})本地测试合约contract.multiply.call(10)获取区块eth.getBlock()获取交易eth.getTransaction()更多技术博客 http://vilins.top/
geth常用命令
发布时间:2026/6/2 3:30:00
geth常用命令更多技术博客 http://vilins.top/初始化私链geth --datadir /path/to/datadir init /path/to/genesis.json启动私链geth --identity TestNode --rpc --rpcport 8545 --datadir /path/to/datadir --port 30303 --nodiscover consol创建账户可直接在括号加密码personal.newAccount()获取账户余额eth.getBalance(myAddress)编译solc --bin testContract.sol solc --abi testContract.sol解锁账户personal.unlockAccount(myAddress)发送部署的合约myContract eth.contract(abi) contract myContract.new({from:myAddress,data:code,gas:1000000})获取正在等待确认的交易eth.getBlock(pending,true).transactions调用智能合约contract.multiply.sendTransaction(10, {from:myAddress})本地测试合约contract.multiply.call(10)获取区块eth.getBlock()获取交易eth.getTransaction()更多技术博客 http://vilins.top/