My mission will be to set up a testnet blockchain for our organization. To do this, I will create and submit four deliverables:
-
Set up a custom testnet blockchain.
-
Send a test transaction.
-
Create a repository.
-
Write instructions on how to use the chain for the rest of the team.
I have just landed a new job at ZBank, a small, innovative bank that is interested in exploring what blockchain technology can do for them and their customers. My first project at the company is to set up a private testnet that the team of developers can use to explore potentials for blockchain at ZBank. We have decided on setting up a testnet because there is no real money involved, which will give the team of developers the freedom to experiment and Testnets allow for offline development.
In order to set up a testnet, it is advised that you have a general knowledge of:
- Puppeth, to generate genesis block.
- Geth, a command-line tool, to create keys, initialize nodes, and connect the nodes together.
- The Clique Proof of Authority algorithm.
Tokens inherently have no value here, so we will provide pre-configured accounts and nodes for easy setup.
- Start by downloading Go Ethereum Tools from https://geth.ethereum.org/downloads/
- Navigate to the folder Go Ethereum
- With proof of authority verification we will need to create nodes first
- ./geth account new --datadir node1
- ./geth account new --datadir node2
- launch puppeth private network manager with command ./puppeth
- name of the newtwork, for our project we selected bankingnet
- create a genenis block using the following steps
- launch puppeth private network manager with command ./puppeth
- name of the newtwork, for our project we selected bankingnet
- confure new genesis
- create new genesis from scratch
- clique - proof of authority
- 7 second blocks
- input adresses fron node1 and node2 into allowed seal accounts
- input addresses from node 1 and node2 into prefunded account
- precompile address will result in a new genesis block being configured, couple more steps
- manage existing gensis
- export gensis configuration
- default folder to save will result in a new native gensis chain bankingnet.json
- ./geth init bankingnet.json --datadir node1
- ./geth init bankingnet.json --datadir node2
- ./geth --datadir node1 --unlock "sealer one address" --mine --rpc --allow-insecure-unlock
- capture enode from Started P2P Networking line: enode://numbers and letters @127.0.0.1:30303
- ./geth --datadir node2 --unlock "sealer two address" --mine --port 30304 --bootnodes "enode from last step" --ipcdisable --allow-insecure-unlock
- capture enode from Started P2P Networking line: enode://numbers and letters @127.0.0.1:30303
- Now the 2 nodes will start looking for peers & matching other peers, a successful minning will look like screenshot below:
- change netwrok to custom and fill in all fields
- enter node name
- network name is bankingnet
- currency is ethereum
- chain ID is the network ID we selected
- url is "http://127.0.0.1:8545"
- click save & use custom node
- launch wallet via keystore file
- transact 50 ETH from address for node1 to address for node2
- Your're done when you to see the screen below