The new version of Nethereum separates the standardised RPC method across clients and the custom functionality provided by the different clients like Geth, Parity or the new Quorum.
It also separates core functionality into new separate libraries.
Netherum.Geth is the extended Web3 library for Geth. including the non-generic RPC API client methods to interact with the Go Ethereum Client (Geth) Admin, Debug, Miner.
Nethereum Contracts is the core library to interact via RPC with Smart contracts in Ethereum.
Nethereum signer library to sign and verify messages, RLP and transactions using an Ethereum account
The RLP Encoding and decoding library.
There are two types of Accounts that can be used in conjunction with Web3, Account (normal) and ManagedAccount.
The main Account can be created using a private key, EthECKey or Loaded from a json or file using from a KeyStore.
When Web3 is instantiated using the Account, the default SignedTransactionManager will be used when interacting with contracts, meaning that all transactions will be signed offline using the account private key.
var web3 = new Web3Geth(new Account(privateKey));
A managed account is an account managed by a third party client (Geth or Parity), this instantiated with the account address and password.
When Web3 is instantiated using the Account, the default ClientPersonalTransactionManager will be used when interacting with contracts, meaning that all transactions will use Personal_SendTransaction using the the password provided.
var web3 = new Web3(new ManagedAccount(account, password),);
- New namespaces have been created to match the new structure.
- If you require controlling the mining process using Geth, you will need to use Nethereum.Geth. Web3Geth
- Accounts recovered from private keys will return Account address using the Checksum
- Functions and Contract deployment do not use the SignAndSendTransaction passing a password, you will need to use with Web3 a ManagedAccount or a ClientPersonalTransactionManager.
- New EthECKey and EthECDSASignature so if you are using ECKey or ECDASignature, these abstract the functionality to avoid libraries dependencies on Elliptic Curve.
As usual, the latest Nugets can be downloaded from Nuget.org