Broadcasts the given transaction over the P2P network
This is constructing a chain api from disk every time we call this method This involves database calls which can be slow and expensive to construct our Blockchain
Unlike our chain api, this is cached inside our node object.
Unlike our chain api, this is cached inside our node object. Internally in p2p client you will see that the chain api is updated inside of the p2p client
Fetches the given blocks from the peers and calls the appropriate callbacks when done.
Fetches the given blocks from the peers and calls the appropriate callbacks when done.
Gets the hash of the block that is what we consider "best"
Gets the hash of the block that is what we consider "best"
Gets the height of the given block
Gets the height of the given block
Gets number of confirmations for the given block hash
Gets number of confirmations for the given block hash
Checks if we have a tcp connection with our peer
Checks if we are fully initialized with our peer and have executed the handshake This means we can now send arbitrary messages to our peer
Sends the given P2P to our peer.
Sends the given P2P to our peer.
This method is useful for playing around
with P2P messages, therefore marked as
private[node]
.
Starts our node
Stops our node
Starts to sync our node with our peer If our local best block hash is the same as our peers we will not sync, otherwise we will keep syncing until our best block hashes match up
This a base trait for various kinds of nodes. It contains house keeping methods required for all nodes.