Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Run gitbash from command prompt

(1) change directory


cd D:/blockchain

(2) To create the private blockchain network using genesis block

$ geth --datadir ./chaindata init genesis.json

Two folders will be created i) Chaindata


ii) keystore

Whatever we do will be stored in chaindata folder.

(3) To check if private network is working using geth command

$ geth --datadir ./chaindata

It should show
IPC (Interprocess Communication) End point to establish the communication.

Explain the displayed txt

Ctrl C and come out of this one

(4) To create new account


geth --datadir ./datadir account new

will ask for passphrase:


Remember your passphrase
Run twice for two users two accounts
1st account passphrase: 123456
Address:
{5132d160f9d1d25a881e751b5c4a4302fd34791f}
2nd account passphrase: 12345678
Address:
{6f9240e600bfc9b43211447e64a8f5966a538d84}

These are two accounts

copy these two addresses from datadir/keystore and paste to the /chaindata/keystore

we don't need datadir

now we are ready to do the transactions.

before we start our network part we need our wallet.

before we start our network part we need our wallet.

Metamask is the wallet. Wallet to connect multiple networks. Very widely commanly
used. This is browser based in chrome or firefox. You need the extension Metamsk.
It is your wallet. Never share the password to anyone in real life.
Create -> 12 word passphrase -> Click here to reveal secret words -> click and
download -> available in the txt file -> Next -> Confirm -> All done

Bib39 (type in browser) -> pnemonic words

password: 12345678
12word secret seed phrase

bip39 based passphrase , mnemonic Code converter: Randomly gerate the words
start the network with

geth --datadir ./chaindata

don't press ctrl-c

right click and open new gitbash command window


cd d:/Blockchain

geth attach \\\\.\\pipe\\geth.ipc

(or coppy it from the 1st running window)


>eth.accounts
accounts should be shown
You should be able to see this.

["0x5132d160f9d1d25a881e751b5c4a4302fd34791f",
"0x6f9240e600bfc9b43211447e64a8f5966a538d84"]

Open metamask and connect to local host 8545 it will get connected automatically.
Change local host to 8545. Then import some accounts

Select Type: json file

browse to first account and select from keystore

You might also like