I am currently learning core-development in go-ethereum. I am a little weak with networking, RPC and connections.
I am trying to write a function in my own consensus mechanism that gathers all currently connected node addresses into a struct and then uses it to display them. it currently has a structure like this.
type NodeAddresses struct {
connectedNode []ConnectedNode
}
type ConnectedNode struct {
address common.Address
}
func GatherNodeAddresses() {
nodes := &NodeAddresses{
......
}
}
What I'm having trouble with is how to populate the struct of NodeAddresses with connecting nodes in a private network. Each node has their own personal account set up with an address. Could someone give me an insight of how to move forward from here? Cheers!