1

In the previous version of Nethereum (1.0.6), I was able to do something like this:

var miningResult = await web3.Miner.Start.SendRequestAsync(200);
Assert.IsTrue(miningResult);

In 2.0.0-rc5 I get an error: Web3 does not contain a definition of Miner How can I do the same in version 2.0.0-rc5?

1 Answers1

2

Nethereum 2.0.0 has moved all the specific Geth methods to Nethereum.Geth. To start the mining process, you will need to use Web3Geth instead of Web3.

Steps:

  1. install nuget package with Geth Install-Package Nethereum.Geth -Pre 2.
  2. Create and use Web3Geth var web3Geth = new Web3Geth();
  3. async web3Geth.Miner.Start.SendRequestAsync(6);
Juan Blanco
  • 1,405
  • 11
  • 12
  • 2
    Thanks Juan. So steps todo:
    1. install nuget package with Geth Install-Package Nethereum.Geth -Pre
    2. then create and use Web3Geth var web3Geth = new Web3Geth(); web3Geth.Miner.Start.SendRequestAsync(6);
    – Sydney Shown Jun 26 '17 at 04:38
  • Yes, I will update the answer – Juan Blanco Jun 26 '17 at 10:45