{"action":"closed","issue":{"url":"https://api.github.com/repos/openblockchain/obc-peer/issues/761","repository_url":"https://api.github.com/repos/openblockchain/obc-peer","labels_url":"https://api.github.com/repos/openblockchain/obc-peer/issues/761/labels{/name}","comments_url":"https://api.github.com/repos/openblockchain/obc-peer/issues/761/comments","events_url":"https://api.github.com/repos/openblockchain/obc-peer/issues/761/events","html_url":"https://github.com/openblockchain/obc-peer/issues/761","id":137626049,"number":761,"title":"A nondetermenistic chaincode","user":{"login":"exactproskl","id":17478440,"avatar_url":"https://avatars.githubusercontent.com/u/17478440?v=3","gravatar_id":"","url":"https://api.github.com/users/exactproskl","html_url":"https://github.com/exactproskl","followers_url":"https://api.github.com/users/exactproskl/followers","following_url":"https://api.github.com/users/exactproskl/following{/other_user}","gists_url":"https://api.github.com/users/exactproskl/gists{/gist_id}","starred_url":"https://api.github.com/users/exactproskl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exactproskl/subscriptions","organizations_url":"https://api.github.com/users/exactproskl/orgs","repos_url":"https://api.github.com/users/exactproskl/repos","events_url":"https://api.github.com/users/exactproskl/events{/privacy}","received_events_url":"https://api.github.com/users/exactproskl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-01T16:43:21Z","updated_at":"2016-03-03T04:21:13Z","closed_at":"2016-03-03T04:21:13Z","body":"Assume I have some validating peers in my network, and a chaincode which can put a random state into the ledger on init.\r\n\r\n```\r\nOPENCHAIN_PEER_ADDRESS=172.17.0.2:30303 obc-peer chaincode deploy -p github.com/openblockchain/obc-peer/openchain/example/chaincode/random -c '{\"Function\":\"init\", \"Args\":[\"a\",\"100\", \"b\", \"200\"]}'\r\n```\r\nDespite the ctor message, it will put a random value for an \"a\" from the range [10, 200] into the ledger. In that case each peer will return it's own value:\r\n\r\n_Query request 1_\r\n\r\n```\r\nOPENCHAIN_PEER_ADDRESS=172.17.0.3:30303 obc-peer chaincode query -n <name> -c '{\"Function\":\"query\", \"Args\":[\"a\"]}'\r\n```\r\n```\r\n30\r\n```\r\n\r\n_Query request 2_\r\n\r\n```\r\nOPENCHAIN_PEER_ADDRESS=172.17.0.4:30303 obc-peer chaincode query -n <name> -c '{\"Function\":\"query\", \"Args\":[\"a\"]}'\r\n```\r\n```\r\n150\r\n```\r\n\r\nAre there any mechanisms to prevent such situations?\r\n\r\nThank you\r\n\r\n\r\n\r\n\r\n\r\n"}}