我通过go-ethereum建立了一个私有的以太网网络,我将Ethereumj的配置配置为连接到私有网络,我可以在go-ethereum的控制台中看到Ethereumj的信息:
> admin.peers
[{
caps: ["eth/62", "eth/63"],
id: "e084894a3b72e8a990710a8f84b2d6f99ac15c0a1d0d7f1a6510769633b64067f9c2df2074e920a4e46fc7d7eb1b211c06f189e5325f0856d326e32d87f49d20",
name: "Ethereum(J)/v1.5.0/Windows/Dev/Java/Dev",
network: {
localAddress: "127.0.0.1:30303",
remoteAddress: "127.0.0.1:18499"
},
protocols: {
eth: {
difficulty: 7746910281,
head: "0x97568a8b38cce14776d5daee5169954f76007a79d7329f71e48c673e6e533215",
version: 63
}
}
}]
>
然后我运行部署合同(CreateContractSample.java)的样本,go-ethereum正在私有网络上挖掘,但我得到了输出:
14:10:37.969 INFO [sample] [v] Available Eth nodes found.
14:10:37.969 INFO [sample] Searching for peers to sync with...
14:10:40.970 INFO [sample] [v] At least one sync peer found.
14:10:40.970 INFO [sample] Current BEST block: #10105 (0fc0c0 <~ e6a78f) Txs:0, Unc: 0
14:10:40.970 INFO [sample] Waiting for blocks start importing (may take a while)...
14:10:46.973 INFO [sample] [v] Blocks import started.
14:10:46.973 INFO [sample] Waiting for the whole blockchain sync (will take up to several hours for the whole chain)...
14:10:56.974 INFO [sample] [v] Sync complete! The best block: #10109 (90766e <~ 46ebc3) Txs:0, Unc: 0
14:10:56.974 INFO [sample] Compiling contract...
14:10:57.078 INFO [sample] Sending contract to net and waiting for inclusion
cd2a3d9f938e13cd947ec05abc7fe734df8dd826
14:10:57.093 INFO [sample] <=== Sending transaction: TransactionData [hash= nonce=00, gasPrice=104c533c00, gas=2dc6c0, receiveAddress=, sendAddress=cd2a3d9f938e13cd947ec05abc7fe734df8dd826, value=, data=6060604052346000575b6096806100176000396000f300606060405263ffffffff60e060020a600035041663623845d88114602c5780636d4ce63c14603b575b6000565b3460005760396004356057565b005b3460005760456063565b60408051918252519081900360200190f35b60008054820190555b50565b6000545b905600a165627a7a72305820f4c00cf17626a18f19d4bb01d62482537e347bbc8c2ae2b0a464dbf1794f7c260029, signatureV=28, signatureR=33b12df9ac0351f1caa816161f5cc1dec30e288d97c02aedd3aafc59e9faafd1, signatureS=457954d2d34e88cdd022100dde72042c79e918ff6d5ddd372334a614a03a331a]
''''''some Unnecessary output''''''
java.lang.RuntimeException: The transaction was not included during last 16 blocks: ed2b6b59
at org.ethereum.samples.CreateContractSample.waitForTx(CreateContractSample.java:142)
at org.ethereum.samples.CreateContractSample.sendTxAndWait(CreateContractSample.java:116)
at org.ethereum.samples.CreateContractSample.onSyncDone(CreateContractSample.java:73)
at org.ethereum.samples.BasicSample.run(BasicSample.java:148)
at java.lang.Thread.run(Thread.java:745)