If you want to break free from the financial institutions and governments lurking over your shoulders every time you conduct a financial transaction, blockchain is the thing that can help you. However, you might think that setting up your own private blockchain is a task too daunting to undertake and probably too costly as well. That’s not true. You just need some cloud-based computing resources and a few lines of code and you’ll be good for conducting your financial and other transactions under the radar.
THING NEEDED FOR MAKING A BLOCKCHAIN
In theory, you need to have a network of interconnected nodes to make a blockchain work but thanks you cloud computing this has been made very easy. These are the things you need to create your own private blockchain.
- A cloud-based computing platform is needed to host the blockchain. By far, the best platform for this is Microsoft Azure; the reason is coming in the next point.
- A blockchain template is needed to create the blockchain and that is provided by Azure in the form of an Ethereum Blockchain Consortium template. This template offers a configurable number of mining and transaction nodes.
All you need from here on is 10 minutes of work and three simple steps to get your own private blockchain up and running. One thing that is important to be noted at this point is that the template we are going to use creates a proof-of-work (PoW) blockchain. Depending on the nature of your intended use, this might not be the best option.
After you have acquired the computing resources on Azure, this is how you can make a private blockchain of your own. The following steps are needed to get the authority node up and running.
STEP 1 – INSTALL ETHEREUM AND GETH
Run the following code on your Azure virtual machine:
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum
STEP 2 – SETTING UP THE AUTHORITY AND TRANSACTION ACCOUNTS
Now, you will have to set up two accounts for the basic functioning of your blockchain. The first will be the authority account to validate the transactions and the other one will be the pre-funded transaction account to carry out transactions on the blockchain. This is the code you need for that:
geth –datadir .ethereum/ account new
> Address: {6203bb870bfb79438b827de3d6b0070d4d2a5f7b}
geth –datadir .ethereum/ account new
> Address: {1808adc011f6e970943d3f28f4d285053d9140ac}
Make sure that you keep a record of all the passwords and addresses involved in making the blockchain.
STEP 3 – CREATE THE GENESIS BLOCK
At this step, you will have to use a CLI tool working on Geth 1,6 or higher. Use it to create and render the definition of the genesis on which all the protocols of the blockchain will be bases. This is the code for that:
puppeth
…
Please specify a network name to administer (no spaces, please)
> clique
…
What would you like to do? (default = stats)
- Show network stats
- Configure new genesis
- Track new remote server
- Deploy network components
> 2
Which consensus engine to use? (default = clique)
- Ethash – proof-of-work
- Clique – proof-of-authority
> 2
How many seconds should blocks take? (default = 15)
> 15
Which accounts are allowed to seal? (mandatory at least one)
> 0x6203bb870bfb79438b827de3d6b0070d4d2a5f7b
> 0x
Which accounts should be pre-funded? (advisable at least one)
> 0x1808adc011f6e970943d3f28f4d285053d9140ac
> 0x
Specify your chain/network ID if you want an explicit one (default = random)
> 42
INFO [02-15|18:24:03] Configured new genesis block
What would you like to do? (default = stats)
- Show network stats
- Manage existing genesis
- Track new remote server
- Deploy network components
> 2
- Modify existing fork rules
- Export genesis configuration
- Remove genesis configuration
> 2
Which file to save the genesis into? (default = clique.json)
> genesis.json
INFO [02-15|18:24:22] Exported existing genesis block
STEP 4 – START YOUR PRIVATE ETHEREUM INSTANCE
All that’s left to do now is to initiate your own private Ethereum instance and that can be done with the following code:
geth –datadir .ethereum/ init genesis.json
geth –nodiscover –networkid 42 –datadir .ethereum/ –unlock 0x6203bb870bfb79438b827de3d6b0070d4d2a5f7b –mine –rpc –rpcapi eth,net,web3 –rpcaddr
IN CONCLUSION
This is the way you can develop a Proof-of-Work Blockchain. To keep learning more about the tech around you and how you can use it for your benefit, keep following Wall Street Media Co.