• Console packages:
  • id: Nethereum.Web3 version: 3.0.0-rc3

TestChain Getting Started Guide

Documentation about Nethereum can be found at: https://nethereum.readthedocs.io

First, let's download the test chain matching your environment from https://github.com/Nethereum/Testchains

Start a Geth chain (geth-clique-linux\, geth-clique-windows\ or geth-clique-mac\) using startgeth.bat (Windows) or startgeth.sh (Mac/Linux). The chain is setup with the Proof of Authority consensus and will start the mining process immediately.

To get started, reference the NuGet package

#r "Nethereum.Web3"

First, we need to new up a web3 object for localhost:8545 (this uses RPC)

var web3 = new Nethereum.Web3.Web3();

Are we mining? (startgeth.sh|bat auto-starts mining)

var isMining = await web3.Eth.Mining.IsMining.SendRequestAsync()

List all pre-defined accounts in the devchain

var accounts = await web3.Eth.Accounts.SendRequestAsync()

Get the balance for the default account

var balance = await web3.Eth.GetBalance.SendRequestAsync("0x12890d2cce102216644c59dae5baed380d84830c")