This is integration of truffle chain with Quorum Blockhain
Steps are
-
Set Quorum Blockchain envirnoment. You have to build the envirnoment in vagrant first for more steps "https://github.com/jpmorganchase/quorum-examples"
-
After set up use this command "vagrant up" to start Quorum Chain.
-
"vagrant ssh" to start chain protocol
-
After "vagrant up" , ubuntu@ubuntu-xenial:~$ cd quorum-examples/7nodes/
-
ubuntu@ubuntu-xenial:~/quorum-examples/7nodes$ ./raft-init.sh
-
ubuntu@ubuntu-xenial:~/quorum-examples/7nodes$ ./raft-start.sh
-
open new terminal
-
Prateek-Tiwari:quorum-examples yudiz$cd myproject
-
Prateek-Tiwari:quorum-examples yudiz$truffle init
-
Prateek-Tiwari:quorum-examples yudiz$truffle console
-
truffle(development)> SimpleStorage.deployed().then(function(instance) { return instance.get(); })
output will as { [String: '42'] s: 1, e: 1, c: [ 42 ] }
-
Start network four in cmd ,Prateek-Tiwari:quorum-examples yudiz$truffle console --network nodefour
-
truffle(nodefour)> SimpleStorage.deployed().then(function(instance) { return instance.get(); })
-
output will as { [String: '0'] s: 1, e: 0, c: [ 0 ] }
-
open new terminal Prateek-Tiwari:yudiz$truffle console --network nodeseven
-
truffle(nodeseven)> SimpleStorage.deployed().then(function(instance) { return instance.get(); })
-
output as : { [String: '42'] s: 1, e: 1, c: [ 42 ] }
-
Due to this command {privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="]}), main contract is showing permission to node seven only see the log as "42" output.
-
For public transaction replace privatefor key word and it will work