MCPcopy Create free account
hub / github.com/DNAProject/DNA / initPageInfo

Function initPageInfo

http/nodeinfo/server.go:65–75  ·  view source on GitHub ↗
(blockHeight uint32, curNodeType string, ngbrCnt int, ngbrsInfo []NgbNodeInfo)

Source from the content-addressed store, hash-verified

63}
64
65func initPageInfo(blockHeight uint32, curNodeType string, ngbrCnt int, ngbrsInfo []NgbNodeInfo) (*Info, error) {
66 id := fmt.Sprintf("0x%x", node.GetID())
67 return &Info{NodeVersion: config.Version, BlockHeight: blockHeight,
68 NeighborCnt: ngbrCnt, Neighbors: ngbrsInfo,
69 HttpRestPort: int(config.DefConfig.Restful.HttpRestPort),
70 HttpWsPort: int(config.DefConfig.Ws.HttpWsPort),
71 HttpJsonPort: int(config.DefConfig.Rpc.HttpJsonPort),
72 HttpLocalPort: int(config.DefConfig.Rpc.HttpLocalPort),
73 NodePort: uint16(config.DefConfig.P2PNode.NodePort),
74 NodeId: id, NodeType: curNodeType}, nil
75}
76
77func viewHandler(w http.ResponseWriter, r *http.Request) {
78 var ngbrNodersInfo []NgbNodeInfo

Callers 1

viewHandlerFunction · 0.85

Calls 1

GetIDMethod · 0.65

Tested by

no test coverage detected