Skip to content
This repository has been archived by the owner on Nov 13, 2020. It is now read-only.

Latest commit

 

History

History
38 lines (24 loc) · 1.32 KB

nethereum-creating-a-new-account-using-geth.md

File metadata and controls

38 lines (24 loc) · 1.32 KB

Creating a new Account using Geth Personal Api

This document is a Workbook, an interactive document where you can run code. To run workbooks natively, you can:

The entirety of Nethereum workbooks can be found here

Documentation about Nethereum can be found at: https://docs.nethereum.com

Prerequisites:

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.

#r "Nethereum.Web3"
using Nethereum.Web3;

Now, let's create a new instance of Web3:

var web3 = new Web3();

Using the Personal API we can now execute the request "NewAccount" with a password to encrypt the account storage file:

var account = await web3.Personal.NewAccount.SendRequestAsync("password");