Question

Dmitrii Fotesco on Tue, 24 Oct 2017 21:23:04


I deployed a private Ethereum network on Azure. Here are some network details: ADMIN-SITE: http://smartcewj.eastus.cloudapp.azure.com

ETHEREUM-RPC-ENDPOINT: http://smartcewj.eastus.cloudapp.azure.com:8545

ETHEREUMNETWORKID: 72

I’m having an issue with deploying a smart contract through Truffle.

When I SSH into the first TX node, I am able to attach to geth by running: geth attach http://smartcewj.eastus.cloudapp.azure.com:8545

I get my personal accounts listed and I’m able to successfully unlock it, see below:

instance: Geth/smartcewj-tx0/v1.6.7-stable-ab5646c5/linux-amd64/go1.8.3

coinbase: 0x115e21cc148385eecb2f9e8b6c463d7da8e68b4a

at block: 34596 (Tue, 24 Oct 2017 17:33:05 UTC)

 datadir: /home/gethadmin/.ethereum

 modules: admin:1.0 eth:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0

> personal

{

  listAccounts: ["0x115e21cc148385eecb2f9e8b6c463d7da8e68b4a", "0x6222be80f9fa5127bcf8874b683e8990b7178763"],

  listWallets: [{

      accounts: [{...}],

      status: "Locked",

      url: "keystore:///home/gethadmin/.ethereum/keystore/UTC--2017-10-19T18-26-32.786737266Z--115e21cc148385eecb2f9e8b6c463d7da8e68b4a"

  }, {

      accounts: [{...}],

      status: "Locked",

      url: "keystore:///home/gethadmin/.ethereum/keystore/UTC--2017-10-23T20-10-03.055613287Z--6222be80f9fa5127bcf8874b683e8990b7178763"

  }],

  deriveAccount: function(),

  ecRecover: function(),

  getListAccounts: function(callback),

  getListWallets: function(callback),

  importRawKey: function(),

  lockAccount: function(),

  newAccount: function github.com/ethereum/go-ethereum/console.(*bridge).NewAccount-fm(),

  sendTransaction: function(),

  sign: function github.com/ethereum/go-ethereum/console.(*bridge).Sign-fm(),

  unlockAccount: function github.com/ethereum/go-ethereum/console.(*bridge).UnlockAccount-fm()

}

> personal.unlockAccount(eth.coinbase)

Unlock account 0x115e21cc148385eecb2f9e8b6c463d7da8e68b4a

Passphrase:

True

Now, once my account is unlocked, I’m attempting to deploy my smart contract through truffle. Here is my truffle.js file:

module.exports = {

  networks: {

    demo: {

      host: "http://smartcewj.eastus.cloudapp.azure.com",

      port: 8545,

      network_id: "72" // Match any network id

    }

  }

};

After I try to deploy a smart contract and run truffle migrate –-network demo

I get the following error: Could not connect to your Ethereum client. Please check that your Ethereum client:

    - is running

    - is accepting RPC connections (i.e., "--rpc" option is used in geth)

    - is accessible over the network

    - is properly configured in your Truffle configuration file (truffle.js)

I know that geth is running since I could attach to it and unlock one of the eth accounts. What am I missing?

Thank you,

Dmitrii


Sponsored



Replies

Microsoft Azure Blockchain Team on Wed, 25 Oct 2017 00:34:00


Hi Dmitrii,

We provide limited support for 3rd party tools integrating with our templates. 

We have verified your network is working correctly by adding a custom RPC endpoint to Metamask in a Chrome browser and sending 1000 Ether to an Ethereum address using your Blockchain Admin endpoint.

In your truffle.js file, you pass the network_id in as a "" string. In the few truffle.js files we have seen, the network_id is passed in as an integer. Have you tried removing the double quotes?

Also, consider the following post regarding your error with Truffle: 

https://ethereum.stackexchange.com/questions/26365/deploying-contracts-in-ropsten-with-truffle.

We hope this helps!

Dmitrii Fotesco on Wed, 25 Oct 2017 03:56:16


What framework do you advise to use to write and deploy a smart contract?

Microsoft Azure Blockchain Team on Wed, 25 Oct 2017 07:02:20


Hi Dmitrii,

We have verified using browser solidity (remix) and also the Nethereum library if you are using C#.  It also works via web3 js.  We have not verified using truffle but it should work and there is likely some configuration error causing your issue that would need some debugging.  Can you try to compile the smart contract into bytecode and then deploy using web3 js or Nethereum?