3

I am trying to deploy a Contract from Solidity browser || geth. On my server machine, inside solidity browser || geth I am able to deploy a contract. But from my external node, which is connected into my private Ethereum blockchain; inside Solidity Browser || geth I won't able to deploy a contract. It halts and says: "Deploying and linking required libraries..."

[Q] How could I deploy a contract from Solidity Browser || geth inside an external node which is connected into the private ethereum blockchain?

On my client machine, the way I am connected into private Ethereum blockchain.

sudo ./geth --port 3000 --networkid 23422 --identity node1 --verbosity 3 
--nodiscover --nat none --datadir="/home/avatar/MyEthereumEbloc" 
--rpccorsdomain '*' --rpc --rpcaddr "localhost" 
--rpccorsdomain="*" --rpcport="8545"  --nodiscover --maxpeers=4 
  --bootnodes enode://<enode_id>@<ip>:3000 console

-

> admin.addPeer("enode://<enode_id>@<ip>:3000?discport=0")
true
> net
{
  listening: true,
  peerCount: 1,
  version: "23422",
  getListening: function(callback),
  getPeerCount: function(callback),
  getVersion: function(callback)
}

When I click into "create" button on Solidity Browser; on my on going geth console on client => I can see that transaction is created. But it never get mined. Basically contract's transaction get stuck inside pending transactions. The peer seems connected into private blockchain but the transaction never gets through.

I1015 19:19:44.002223 eth/api.go:1183] 
Tx(0x2995698a4662ad2cc688471c19b4ce1d8fe0d1536f3548f249dadf7c16431205) 
created: 0x91a81d46ee8844ab9e5dcf38a0aa37dd262fe4dd

enter image description here

  • what is the contract code?you are using a lib isn't it? – Badr Bellaj Oct 15 '16 at 17:46
  • I updated my question, it it not related to Lib. The same Contract get mined on my server machine without having any problem. Both contract or library does not get mined. Just think it as a simple contract updates a storage value. – alper Oct 15 '16 at 20:14
  • 1
    Just FYI this question and your answer could still be helpful to others; I would upvote it. Self-answers are ok. But I respect with whatever you decide to do. – eth Oct 15 '16 at 21:54
  • How to you connect the two nodes? Do you use a static IP address for each node, or each time you want to connect them together, you find their IP address manually and put it in admin.addPeer() and the other command line? – Ay. Oct 10 '17 at 17:18
3

Solution 1: As you can see when I connected to my private Ethereum Blockchain I did not use "--mine" flag. My blockchain was synchronised but client node was not doing any mining. So the problem was I did not start mining on my client node. When I start mining on my client node ( miner.start(1) or with "--mine" flag), I am able to deploy the contract from Solidity Browser and also from geth.

"Start mining

The transaction that has deployed the contract needs to be verified by the network, if we are running a private chain with a single node we will need to mine the transaction.

The transaction receipt

Waiting until transaction to be mined. Once we have started mining (or we know that are miners in the network) we can can attempt to retrieve the transaction receipt, we will need this as it contains our contract address.

The transaction might have not be mined yet, so when attempting to get the receipt it might return a null value, in this scenario we will continue trying until we get a not null result.

Stop mining (After we are done we can just stop mining.)" [1]

[1] https://nethereum.readthedocs.io/en/latest/contracts/deploying/

Solution 2: As you can see my node connecting to the network with --nodiscover flag, when I removed it, the problem has been solved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.