3

尝试遵循欢迎教程,虽然我回避了一些问题(无法在本地安装 solC),但这个问题让我陷入了困境。

我在这里在线编译了solidity https://ethereum.github.io/browser-solidity/#version=soljson-latest.js

结果是右边有两个不同的部分,一个是“greeter”,一个是“mortal”。

我在本地启动 geth 控制台并使用“personal.unlockAccount”解锁我的帐户。粘贴来自欢迎合同的“Web3 部署”部分的文本后,我 null [object Object] 从 geth 控制台获得响应,控制台冻结并且不显示另一个提示。这是粘贴:

var _greeting = "yellow";
var greeterContract = web3.eth.contract([{"constant":false,"inputs":[],"name":"kill","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"greet","outputs":[{"name":"","type":"string"}],"type":"function"},{"inputs":[{"name":"_greeting","type":"string"}],"type":"constructor"}]);
var greeter = greeterContract.new(
_greeting,
{
 from: web3.eth.accounts[0], 
 data: '606060405260405161023e38038061023e8339810160405280510160008054600160a060020a031916331790558060016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10609f57805160ff19168380011785555b50608e9291505b8082111560cc57600081558301607d565b50505061016e806100d06000396000f35b828001600101855582156076579182015b82811115607657825182600050559160200191906001019060b0565b509056606060405260e060020a600035046341c0e1b58114610026578063cfae321714610068575b005b6100246000543373ffffffffffffffffffffffffffffffffffffffff908116911614156101375760005473ffffffffffffffffffffffffffffffffffffffff16ff5b6100c9600060609081526001805460a06020601f6002600019610100868816150201909416939093049283018190040281016040526080828152929190828280156101645780601f1061013957610100808354040283529160200191610164565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b565b820191906000526020600020905b81548152906001019060200180831161014757829003601f168201915b505050505090509056', 
gas: 3000000
}, function(e, contract){
console.log(e, contract);
if (typeof contract.address != 'undefined') {
     console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
}
})

任何人都有线索,因为我肯定不知道

4

1 回答 1

2

我猜 null[object Object] 一定不会有任何问题。

开始挖矿,miner.start(),等待合约挖出的地址回退,获取地址取决于CPU速度。所以等待它。

尝试从比欢迎程序更简单的示例开始检查此链接,可能会有用

http://billmarino2.github.io/general/2015/12/09/JURIX-2015-setting-up-an-ethereum-testnet.html

于 2016-08-22T07:24:08.860 回答