MCPcopy Create free account
hub / github.com/CPChain/chain / NodeInfo

Method NodeInfo

protocols/cpc/handler.go:838–847  ·  view source on GitHub ↗

NodeInfo retrieves some protocol metadata about the running host node.

()

Source from the content-addressed store, hash-verified

836
837// NodeInfo retrieves some protocol metadata about the running host node.
838func (pm *ProtocolManager) NodeInfo() *NodeInfo {
839 currentBlock := pm.blockchain.CurrentBlock()
840 return &NodeInfo{
841 Network: pm.networkID,
842 Height: pm.blockchain.CurrentBlock().Number(),
843 Genesis: pm.blockchain.Genesis().Hash(),
844 Config: pm.blockchain.Config(),
845 Head: currentBlock.Hash(),
846 }
847}

Callers 1

NewProtocolManagerFunction · 0.95

Calls 5

GenesisMethod · 0.80
CurrentBlockMethod · 0.65
HashMethod · 0.65
ConfigMethod · 0.65
NumberMethod · 0.45

Tested by

no test coverage detected