Note

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:

Recap

In our previous article (Review of Ethereum API and Console Options), we discussed Ethereum API and its console options.

In this article, we learn about Ethereum Networking Options.

Networking options

Networking options provide us with the flexibility to define the network’s details, such as the listening port, the maximum number of peers, the maximum number of attempts for pending a connection, the discovery mechanism in the network, and so on. The following list specifies the various options that are available:

  • –bootnodes, –port, –nodekey, and –nodekeyhex are the networking option flags we have come across. Generally, –bootnodesv4 is set for light server and full nodes. –bootnodesv5 is set for light servers and light nodes.
  • If you have already connected a few nodes, for example, with 2 nodes, and you don’t want any other nodes to be added to the local private network accidentally, set –maxpeers to 2. The default value for maxpeers is 25.
  • –nodiscover is used for adding peers manually without the discovery protocol. This flag is used for testing a single node or network with a limited number of nodes.
  • Other members of the networking options family are –maxpendpeers, –nat, –

-v5disc, and –netrestrict. In a local private blockchain, –maxpeers and –
-nodiscover are frequently used.

  • Starting from geth v1.5.4, –netrestrict is added to the toolbox. The flag takes an IP address, and geth will only communicate with the peers from this address.

In the following command, we specify maxpeers to be 2, disabling the peering discovery mechanism and restricting the network communication to 127.0.0.1:
$ geth –datadir < local data dir> –networkid <network id> –maxpeers 2 — nodiscover –netrestrict 127.0.0.1

We have introduced every member of the networking options family. Feel free to use them and get familiar with them.

 

Next Article

In our next article (Review of Ethereum Transaction Pool Options), we discuss what Ethereum Transaction Pool Options are and how they work.

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.

Resources

Free Webinars on Blockchain

Here is the list of our free webinars that are highly recommended:

 

Free Courses

Here is the list of our 10 free self-paced courses that are highly recommended:

 

Self-Paced Blockchain Courses

If you like to learn more about Hyperledger Fabric, Hyperledger Sawtooth, Ethereum or Corda, taking the following self-paced classes is highly recommended:

  1. Intro to Blockchain Technology
  2. Blockchain Management in Hyperledger for System Admins
  3. Hyperledger Fabric for Developers
  4. Intro to Blockchain Cybersecurity
  5. Learn Solidity Programming by Examples
  6. Introduction to Ethereum Blockchain Development
  7. Learn Blockchain Dev with Corda R3
  8. Intro to Hyperledger Sawtooth for System Admins

 

Live Blockchain Courses

If you want to master Hyperledger Fabric, Ethereum or Corda, taking the following live classes is highly recommended:

 

Articles and Tutorials on Blockchain Technology

If you like to learn more about blockchain technology and how it works, reading the following articles is highly recommended:

 

Articles and Tutorials on Ethereum and Solidity

If you like to learn more about blockchain development in Ethereum with Solidity, reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on Hyperledger Family

If you like to learn more about blockchain development with Hyperledger, reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on R3 Corda

If you like to learn more about blockchain development on Corda , reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on Other Blockchain Platforms

If you like to learn more about blockchain development in other platforms, reading the following articles and tutorials is highly recommended: