github.com/MetalBlockchain/subnet-evm@v0.4.9/peer/README.md (about) 1 # Peer Package 2 3 The peer package handles networking for the VM. 4 5 ## Network 6 7 The `Network` interface implements the networking portion of the required VM interface. The VM utilizes the `Network` interface to: 8 9 - Set an App Gossip handler for incoming VM gossip messages 10 - Set an App Request handler for incoming VM request messages 11 - Send App Requests to peers in the network and specify a response handler to be called upon receiving a response or failure notification 12 - Send App Gossip messages to the network 13 14 ## Client 15 16 The client utilizes the `Network` interface to send requests to peers on the network and utilizes the `waitingHandler` to wait until a response or failure is received from the MetalGo networking layer. 17 18 This allows the user of `Client` to treat it as if it were returning results from the network synchronously. 19 20 ```go 21 result, err := client.Request(nodeID, request) // Blocks until receiving a response from the network 22 if err != nil { 23 return err 24 } 25 26 foo(result) // do something with the result 27 ```