Learn about Ethereum blockchain development
If you are new to the blockchain technology, taking our Introduction to Blockchain Technology self-paced course is highly recommended. Also, for a comprehensive coverage of blockchain development in Ethereum or mastering Solidity programming, taking our below self paced courses is highly recommended:
In our previous article (How to Run Geth on a Local Private Ethereum Blockchain), we discussed how to setup and run Geth on a local private Ethereum network.
In this article, we learn how to develop a local private Ethereum network that includes mining component.
We have shown you the steps to start a simple private blockchain. With some additional steps, you can set up private blockchains with mining enabled too. We will discuss the steps you need to take to get a mining blockchain up and running in the local environment here:
Let's create another directory for a blockchain with mining. It's very similar to how we set up an environment in the Private blockchain without miningarticle. In the following code, we create two more subdirectories, data and src, under hello_world_mining:
$ cd hello_world_mining $ mkdir data $ mkdir src
When data and src are created, you list the information of the directories under
hello_world_mining to verify the names and locations.
When we created the blockchain without mining, we left the alloc section blank. We will prefund the accounts this time. You may want to tune the difficulty to a lower value in your first attempt. It is better to choose some random value for a nonce, in case it connects to any unknown nodes. Let's have a look at the following configuration:
{
"config": {
"chainId": 135,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},"alloc" : {
"0x0000000000000000000000000000000000000001": {"balance": "111111111"},
"0x0000000000000000000000000000000000000002": {"balance": "222222222"}},
"coinbase" : "0x0000000000000000000000000000000000000000",
The configuration here is the pre-funding
"difficulty" : "0x00001", "extraData" : "", "gasLimit" : "0x2fefd8",
"nonce" : "0x0000000000000107",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00"
}
address 0x0000000000000000000000000000000000000001 and the balance of 111111111 and 222222222 to the 0x0000000000000000000000000000000000000002 address.
Let's take the opportunity to look at the other parameters here:
By now, you should understand the structure and content of a genesis file. Be our guest and customize a genesis file on your own. Doing so will deepen your understanding.
In our next article (How to Run Geth on a Local Private Ethereum Blockchain with Mining), we discuss how to run Geth on a local private Ethereum network that includes mining component.
This article is written in collaboration with Brian Wu who is a leading author of “Learn Ethereum: Build your own decentralized applications with Ethereum and smart contracts” book. He has written 7 books on blockchain development.
Here is the list of our free webinars that are highly recommended:
Here is the list of our 10 free self-paced courses that are highly recommended:
If you like to learn more about Hyperledger Fabric, Hyperledger Sawtooth, Ethereum or Corda, taking the following self-paced classes is highly recommended:
If you want to master Hyperledger Fabric, Ethereum or Corda, taking the following live classes is highly recommended:
If you like to learn more about blockchain technology and how it works, reading the following articles is highly recommended:
If you like to learn more about blockchain development in Ethereum with Solidity, reading the following articles and tutorials is highly recommended:
If you like to learn more about blockchain development with Hyperledger, reading the following articles and tutorials is highly recommended:
If you like to learn more about blockchain development on Corda , reading the following articles and tutorials is highly recommended:
If you like to learn more about blockchain development in other platforms, reading the following articles and tutorials is highly recommended:
We offer private custom tutoring classes both online and in DC, MD and VA for almost all of our courses or bootcamps. Give us a call or email us to discuss your needs.
$90 Regular
$50 Limited Offer
REGISTER NOW