Arman Sahakyan
Aug 22, 2017 · 1 min read

i tried your solution too.

// You need to have the geth running while running this code. command: c:\geth\>geth — testnet

string _getAddress = “./geth.ipc”;

var ipcClient = new Nethereum.JsonRpc.IpcClient.IpcClient(_getAddress);

var web3 = new Web3(ipcClient);

var accountPublicKey = “0x12890d2cce102216644c59daE5baed380d84830c”;

var accountPassword = “password”;

// Unlock the caller’s account with the given password

var unlockResult = await web3.Personal.UnlockAccount.SendRequestAsync(accountPublicKey, accountPassword, 120);

var abi = @”[{“”constant””:false,””inputs””:[{“”name””:””vol””,””type””:””int256"”}],””name””:””multiply””,””outputs””:[{“”name””:””d””,””type””:””int256"”}],””type””:””function””},{“”inputs””:[{“”name””:””multiplier””,””type””:””int256"”}],””type””:””constructor””}]”;

var byteCode = “606060405260405160208060ae833981016040528080519060200190919050505b806000600050819055505b5060768060386000396000f360606040526000357c0100000000000000000000000000000000000000000000000000000000900480631df4f144146037576035565b005b604b60048080359060200190919050506061565b6040518082815260200191505060405180910390f35b6000600060005054820290506071565b91905056”;

var gas = new Nethereum.Hex.HexTypes.HexBigInteger(300000);

var balance = new Nethereum.Hex.HexTypes.HexBigInteger(120);

var transactionHash = await web3.Eth.DeployContract.SendRequestAsync(abi, byteCode, accountPublicKey, gas, balance);

var reciept = await web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionHash);

I am getting this error message.

on this line: var unlockResult = await web3.Personal.UnlockAccount.SendRequestAsync(accountPublicKey, accountPassword, 120);

Source:Nethereum.JsonRpc.Client

Message: no key for given address or file

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade