hyperledger-fabric

Endorsers Instantiate Chaincode with error “cannot find package”

好久不见. 提交于 2020-12-08 02:18:40
问题 I created a chaincode and I imported a package to it. import ( "bytes" "encoding/json" "fmt" "strings" "golang.org/x/crypto/bcrypt" "github.com/hyperledger/fabric/core/chaincode/shim" pb "github.com/hyperledger/fabric/protos/peer") I can install that chaincode to all endorsers. But when I instantiated it to all endorsers, it faced the error: endorser failed with error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1

Hyperledger Fabric JSON response has backslashes

爱⌒轻易说出口 提交于 2020-12-08 01:50:35
问题 I'm currently testing a Hyperledger Fabric Application, but I get an unexpected JSON response. Why are there extra backslashes between every object in the response? result, err := json.Marshal(history) logger.Debug(string(result)) if err != nil { message := fmt.Sprintf("unable to marshal the result: %s", err.Error()) logger.Error(message) return shim.Error(message) } logger.Info("SimpleChaincode.getHistory exited successfully") return shim.Success(result) Actual CLI output: Chaincode invoke

channel Got error &{FORBIDDEN} while joining new peer to a channel

淺唱寂寞╮ 提交于 2020-11-24 18:02:51
问题 I created my network with a script like: docker-compose -f $COMPOSE_FILE up -d $CA docker-compose -f $COMPOSE_FILE up -d $ORDERER1 $PEER0 $PEER1 docker-compose -f $COMPOSE_FILE up -d $CLI docker exec cli peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f /etc/hyperledger/config/channel.tx The channel is created and if I enter the cli, inside the working directory, I can find with ls the new generated file beerchannel.block. In this directory I also have crypto, which contains