Geth

通过 remix 连接 web3provider 直接部署,为私链添加余额 miner.start() 然后 miner.stop()

How can I add some balance to the address in private blockchain testnet? - Ethereum Stack Exchange go ethereum - why did it returned null after call miner.start() - Ethereum Stack Exchange

remix 发起交易报错缺少 SHR 解决:go ethereum - Error: Returned error: invalid opcode: SHR - Ethereum Stack Exchange

remix 点击部署以后,可以看下方的部署日志来判断其在部署,还是有错误。

  • 创建私链: geth --datadir . init genesis.json
  • 创建新账户: geth account new
  • 进入交互窗口: geth --identity "user_id" --rpc --rpccorsdomain "*" --datadir "./" --port "30303" --nodiscover --rpcapi "personal,db,eth,net,web3,miner" --networkid 15 console 2>>geth.log --allow-insecure-unlock
  • 创建新钱包地址: personal.newAccount("123456")
  • 查看钱包地址: eth.accounts
  • 挖矿,获得 eth: miner.start()miner.stop()
  • unlock 地址,以便使用其部署合约: personal.unlockAccount(eth.accounts[0])
  • remix 连接 web3provider,部署到 geth。先点击 deploy 部署合约, 然后挖矿,对该交易进行打包:miner.start()miner.stop()

阅读

以太坊系列(二)之账户管理_胡伟煌的博客-CSDN 博客 【区块链】问题集锦(持续更新)_Damionew 的博客-CSDN 博客 HPB41:Web3j 实现智能合约 - 汪晓明对区块链、以太坊的思考 以太坊系列(二)之账户管理_胡伟煌的博客-CSDN 博客