A utreexo compact state node doesn't have all the data required for verifying a bitcoin block just with the block. It also requires a utreexo proof.
The method described here is only valid for utreexod v0.4.1. The next version will have a different P2P messaging flow.
For v0.4.1, to get the necessary utreexo data, one must ask for a MSG_UTREEXO_BLOCK
when constructing the getdata. Since we also want segwit blocks as well, we use the
MSG_WITNESS_UTREEXO_BLOCk
. Constructing the inv is done like so:
iv := wire.NewInvVect(wire.InvTypeWitnessUtreexoBlock, hashOfTheBlock)
This will send a request to the utreexo node that a utreexo proof should be attached to the block.
Calling blockchain.ProcessBlock
with the import being from github.com/utreexo/utreexod/blockchain
will automatically handle the utreexo proof.