- Install virtualbox
- Install vagrant
- Install truffle: npm install -g truffle
Truffle is a framework used to make development for Ethereum-based blockchains easier. It allows you to easily deploy, test and upgrade smart contracts.
- From quorum-examples: run
vagrant up
andvagrant ssh
- From smart-contracts/contracts: run
truffle compile
to generate the contract binaries - In ./migrations, create a new migration file and set the constructor parameter and the authorized nodes (get pub keys from tm1.pub (etc) in quorum-examples/examples/7nodes/keys)
- From smart-contracts/migrations: run
truffle migrate
to deploy your smart contract
The sample network consists of seven nodes, of which the RPC ports are displayed in the vagrant logs. To connect to these nodes, edit the truffle.js file in ./smart-contracts
truffle console
--> By default, you're acting as node1 ('development)truffle console --network nodefour
--> Acting as a different nodeSimpleStorage.deployed().then(function(instance) { return instance.get(); })
--> Calling a method on a deployed contract
https://ethereum.stackexchange.com/questions/23459/deploy-contract-in-web3j-quorum-problem