Here we will create 2 different nodes that will each have their own address. Follow the command as show below to create them.
Copy this public key as it will be necessary in subsequent steps. Re-run this command a second time with a new node name to create the second node.
Run the command ./puppeth
to open up the puppeth tool. This is the tool used for creating local networks.
It will now ask for you to specify a network name to administer. Call this whatever you please.
Run through the series of prompts as shown below. We will need to:
- Configure a new genesis
- Create a new genesis from scratch
- Create a Clique or 'proof of authority' type network.
- Authorize both accounts to be able to seal
- Pre-fund both accounts
Next we will define a chain ID. Make this any 3-digit number, and make sure to remember it.
Follow the next prompts as seen below.
Next, initialize both of your nodes using the command ./geth init yournet.json --datadir yournode1
, and again with the second node.
To start the network, begin mining with the first node using the command
./geth --datadir yournode1 --unlock "thelongpublickeyItoldyoutosave4stepsago" --mine --rpc --ipcdisable --minerthreads 1
We will run a similar command with our second node except that we will need to do 2 things differently.
- This node will need to run on a different port than the first. (The fist node runs on the default 30303)
- The two nodes need to be connected together. To do this, check the output from running the first node, somewhere near the top there should be 'enode://'. Copy that and the long string that follows
In order to send cryptocurrency between our two accounts we will need to use the MyCrypto app.
Firstly, connect your local network with the app. Name the network and node whatever you please, but make sure the network type is set to custom AND the Chain ID is set to the 3-digit number you created earlier.
Next, log into the wallet for the first node. From here we will be able to send and receive transactions. Copy and paste the address to the second node in the 'To Address' bar, input how much you would like to send and press 'Send Transaction'.
Congrats, you have made yourself filty rich in fake money!