【发布时间】:2018-06-20 20:52:01
【问题描述】:
我正在尝试使用以太坊钱包客户端 (mist) 在专用网络中部署智能合约。虽然我有足够的资金,但应用程序抱怨我没有足够的资金来支付 * gas price+value。
智能合约代码:
pragma solidity ^0.4.18;
contract HelloWorld {
uint256 counter = 0;
/* Constructor */
function Increase() public {
counter++;
}
function Decrease() public {
counter--;
}
function GetCounter() public constant returns(uint256){
return counter;
}
}
** genesis.json **
{
"config": {
"chainId": 0,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc" : {},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x20000",
"extraData" : "",
"gasLimit" : "0x2fefd8",
"nonce" : "0x0000000000000041",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00"
}
Geth 命令:
geth --datadir=./chaindata
注意:我是以太坊区块链开发的新手,所以试图通过创建私人网络来获得经验
【问题讨论】:
-
您能提供您的
geth和mist启动脚本吗?我怀疑您的 Mist 实例正在连接到不同的网络,而不是您的私有区块链。另外,请包括您的创世配置。 -
{ "config": { "chainId": 0, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "alloc" : {}, "coinbase" : “0x0000000000000000000000000000000000000000”, “看病难”: “地址0x20000”, “而额外”: “”, “gasLimit”: “0x2fefd8”, “随机数”: “0x0000000000000041”, “mixhash”: “0x0000000000000000000000000000000000000000000000000000000000000000”, “parentHash”: “0x0000000000000000000000000000000000000000000000000000000000000000” , "时间戳" : "0x00" }
-
打开geth客户端和区块链的步骤1:geth --datadir=./chaindata 打开新客户端的步骤2:geth attach 打开钱包的步骤3:Ehereum wallet(MIST) GUI
标签: ethereum go-ethereum