The location to write 1 block to the file is as follows.
To test it, add the output code on line 314. Compile the peer separately and replace the original peer.
On the B machine, first query the block height to be 46, then call the chain code function once to generate 1 block, and later query the block height to be 47.
Observe the output of the peer, and output the information of the new sentence.
However, this block is marked as "invalid" and the reason given is "endorsement strategy failure". The reason remains to be determined.