peer chaincode install -n simple-token -v 1.0 -l java -p /Users/friends/Documents/Virtual\ Machines.localized/share/projects/hsl-hsl-user-guide-examples-v14/simple-token/simple-token-chaincode
peer chaincode instantiate successed。为什么chaincode实例化成功,但查询失败
peer chaincode instantiate -o orderer:7050 -C helloch -n simple-token -v 1.0 -l java -c "{\"Args\":[\"init\",\"{'id':'admin1','nick':'admin','type':'ADMIN','balance':100}\", \"{'id':'LiLei','nick':'LiLei','type':'ORDINARY','balance':100}\", \"{'id':'HanMeimei','nick':'HanMeimei','type':'ORDINARY','balance':100}\"]}"
但我的shell中的对等链代码查询失败不是cli docker,为什么? 其实,
peer chaincode query -o 127.0.0.1:7050 -C helloch -n hello -c "{\"Args\":[\"user.get\",\"\",\"LiLei\"]}"
Error: Error endorsing query: rpc error: code = Unknown desc = could not find chaincode with name 'simple-token' - make sure the chaincode simple-token has been successfully instantiated and try again - hy
您是否可以运行“docker ps”来查看链代码容器何时运行?或者docker“ps -a | grep -i hello”然后“docker logs containerID”来查看输出结果? –
根据您的其他问题中提供的日志:https://stackoverflow.com/questions/46045970/why-peer-chaincode-instantiate-execuate-many-times-successfully似乎同伴根本无法获取块实例化交易,因此chaincode容器没有跨越,因此你无法查询你的chaincode。 –