How to run the example endorsement plugin on the fabric 2.2? #hyperledger-fabric #fabric-endorser


1139073321xdvg@...
 

Hi fabirc experts, I met some problems when I write my endosement plugins.My steps are followed.
1   I modify the docker-compose-test-net.yaml in the test-network/docker, add " - ../plugin_test:/etc/hyperledger/fabric/plugin" in the two peers's volume;
2   I run "go build -buildmode=plugin -o DefaultEndorsement.so plugin.go" in the core/handlers/plugin, to make the DefaultEndorsement.so file.
3   I move the DefaultEndorsement.so to the plugin_test directory which is created in the step 1.
4   I modify the core.yaml in the fabric-samples/config, with such content:
endorsers:
         escc:
           name: DefaultEndorsement
          library:
          DefaultEndorsement:
            name: DefaultEndorsement
 
            library: /etc/hyperledger/fabric/plugin/DefaultEndorsement.so
5. then I run the test-network ,follow the official guide. is./network.sh up createChannel and this guide "Deploying a smart contract to a channel" in the official guide; in "approveformyorg"  " checkcommitreadiness" "commit" I add the "-E DefaultmetEndorsement" in the tail;
6. then I run the statement
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls true --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n fabcar --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"initLedger","Args":[]}'

return a false: 
Error: endorsement failure during invoke. response: status:500 message:"endorsing with plugin failed: plugin with name DefaultEndorsement could not be used: plugin with name DefaultEndorsement wasn't found"

but I run into the peer docker , I can see the DefaultEndorsement.so in the docker, I do not know I make mistake in which step, can experts tell me how to fix this mistake, I am a new hand of fabric, and do not know what to do next, thanks very much!