Last active
December 28, 2017 17:07
-
-
Save didil/feb62a02f1d22bd30d6b925c39d81c99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# network names are set in the truffle config | |
$ truffle console --network=a | |
# company A votes, while making the transaction private and only visible by the regulator, "BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo=" is the Regulator Node's key in our setup | |
truffle(a)> SecretBallot.deployed().then((instance) => instance.vote(1, {privateFor: ["BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo="]})) | |
# Check vote count for option 1 | |
truffle(a)> SecretBallot.deployed().then((instance) => instance.getTotalVotes(1)).then((result) => result.toNumber()) | |
1 | |
# Check vote count for option 2 | |
truffle(a)> SecretBallot.deployed().then((instance) => instance.getTotalVotes(2)).then((result) => result.toNumber()) | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment