Today I read fork database, I see something about net_plugin & bnet_plugin, they make me confuse. In my opinion, bnet_plugin which receives block from peer. But I cannot found this code. Can you help me more understand this?


1 Answer 1


This question has been elaborated on here: What's the difference between bnet-endpoint and p2p-listen-endpoint in v1.0.0 config.ini?

Both net_plugin and bnet_plugin are responsible of to the Peer-to-Peer network. The P2P network is the network that is between the Block Producers.

However, net_plugin is the old plugin for the P2P network. Whereas, the bnet_plugin is a newer and optional protocol plugin that works side-by-side with the existing net_plugin. But, a bnet_plugin only communicates with other plugings of the same kind.

The p2p-listen-endpoint is for the net_plugin. While, bnet-endpoint is for the new bnet_plugin.

bnet_plugin as described in the docs:

bnet_plugin provides an p2p protocol to persistently synchronize two blockchains using a very simple algorithm:

find the last block id on our local chain that the remote peer knows about if we have the next block send it to them if we don't have the next block send them a the oldest unexpired transaction

Link: https://developers.eos.io/eosio-nodeos/docs/bnet_plugin

As for the net_plugin, you can get a better understanding of it based on the flags that can be set:

  --p2p-listen-endpoint arg (=
                                        The actual host:port used to listen for
                                        incoming p2p connections.
  --p2p-server-address arg              An externally accessible host:port for
                                        identifying this node. Defaults to
  --p2p-peer-address arg                The public endpoint of a peer node to
                                        connect to. Use multiple
                                        p2p-peer-address options as needed to
                                        compose a network.
  --p2p-max-nodes-per-host arg (=1)     Maximum number of client nodes from any
                                        single IP address
  --agent-name arg (="EOS Test Agent")  The name supplied to identify this node
                                        amongst the peers.
  --allowed-connection arg (=any)       Can be 'any' or 'producers' or
                                        'specified' or 'none'. If 'specified',
                                        peer-key must be specified at least
                                        once. If only 'producers', peer-key is
                                        not required. 'producers' and
                                        'specified' may be combined.
  --peer-key arg                        Optional public key of peer allowed to
                                        connect.  May be used multiple times.
  --peer-private-key arg                Tuple of [PublicKey, WIF private key]
                                        (may specify multiple times)
  --max-clients arg (=25)               Maximum number of clients from which
                                        connections are accepted, use 0 for no
  --connection-cleanup-period arg (=30) number of seconds to wait before
                                        cleaning up dead connections
  --network-version-match arg (=0)      True to require exact match of peer
                                        network version.
  --sync-fetch-span arg (=100)          number of blocks to retrieve in a chunk
                                        from any individual peer during
  --max-implicit-request arg (=1500)    maximum sizes of transaction or block
                                        messages that are sent without first
                                        sending a notice
  --use-socket-read-watermark arg (=0)  Enable expirimental socket read
                                        watermark optimization
  --peer-log-format arg (=["${_name}" ${_ip}:${_port}])
                                        The string used to format peers when
                                        logging messages about them.  Variables
                                        are escaped with ${<variable name>}.
                                        Available Variables:
                                           _name  self-reported name

                                           _id    self-reported ID (64 hex

                                           _sid   first 8 characters of

                                           _ip    remote IP address of peer

                                           _port  remote port number of peer

                                           _lip   local IP address connected to

                                           _lport local port number connected
                                                  to peer

Link: https://developers.eos.io/eosio-nodeos/docs/net_plugin

All of the plugins for nodeos may be found here at the bottom left: https://developers.eos.io/eosio-nodeos/docs/

  • Thank @Nat, but why the EOS not remove or merge them?
    – user2644
    Nov 27, 2018 at 2:28
  • I'm sure they will as time goes on. Their chief focus is elsewhere right now.
    – Nat
    Nov 27, 2018 at 2:44
  • 1
    Bnet plugin has since been removed. Aug 12, 2021 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.