Unable to unlock personal account using nethereum, c# based coding

Category: azure blockchain

Question

J Benito on Thu, 11 Oct 2018 09:56:26


We deployed an private Ethereum blockchain with Azure Template "Proof of Work" and while we try to login in to blockchain via web3 from visual studio c# code, we face the following issue “The method personal_unlockAccount does not exist/is not available” and while we try to unlock the web3 API account from PowerShell using the script "geth --rpcapi eth,web3,personal --rpc" we receive the following error “Maximum peer count ETH=25 LES=0 total=25 Fatal: Error starting protocol stack: datadir already used by another process

C# Code used to unlock account is as follows

  var web3 = new Web3(<<ETHEREUM-RPC-ENDPOINT >>);
            Task<bool> unlockAccountResult =
                 web3.Personal.UnlockAccount.SendRequestAsync(senderAddress, password, 120);

            unlockAccountResult.Wait();
            bool s = unlockAccountResult.Result;

Note : We are able to test the contract in development environment without any issues on "Ganache".

Any Quick insights on this will be appreciated. Thanks in advance.

Replies

Microsoft Azure Blockchain Team on Thu, 11 Oct 2018 16:43:54


Take a look at this github discussion: https://github.com/Nethereum/Nethereum/issues/105. It seems to have a solution for your problem.