- follow instructions to install geth
- follow instructions to create a new account in rinkeby testnet using:
- geth —rinkeby account new
- add account password to accountPassword field in ccc-ethereum.properties file (conch/CCCRest-ear-commons/src/main/resources/ccc-ethereum.properties)
- show the list of current accounts in rinkeby testnet to verify the account is created and where the keystore file is stored:
- geth —rinkeby acount list
- copy address of account created e.g. 0x9a6944f1b5f3368c53966415dc6ef66f3a7338d3
- add keystore file path to keyStoreFilePath field in ccc-ethereum.properties file (conch/CCCRest-ear-commons/src/main/resources/ccc-ethereum.properties)
- geth —rinkeby acount list
- install metamask browser add-on from metamask.io
- create account for metamask
- choose rinkeby testnet
- import in metamask the account created previously using geth
- use geth —rinkeby acount list to find where the keystore file is stored
- buy ether using rinkeby faucet www.rinkeby.io
- install solc compiler: (solidity.readthedocs.io/en/v0.4.24/installing-solidity.html)
- npm install -g solc
- install web3j command-line tool v3.5.0
- go to solidity-contracts folder
- compile collectPayment.sol using the solc compiler:
- solc collectPayment.sol --bin --abi --optimize -o .
- execute web3j command-line tool to create java wrappers for collectPayment solidity contract
- web3j solidity generate collectPayment.bin collectPayment.abi -p uk.ac.ncl.ethereum.contract -o .
- copy generated contract folder to conch/CCCRest-ear-commons/src/main/java/uk/ac/ncl/ethereum
- use remix ide to compile and deploy the collectPayment.sol smart contract
- if there are no errors during compilation go to Run tab
- choose Injected web3 for “Environment” (it will use metamask to deploy the smart contract)
- make sure the correct account is selected in “Account”
- Click deploy button
- click submit in metamask to deploy the collectPayment.sol smart contract to Rinkeby testnet
- add contract address in ccc-ethereum.properties file contractAddress field
- start jboss EAP server:
- ./run.sh
- deploy a new version of the CCC with the included java wrapper for the collectPayment.sol smart contract
- mvn clean package jboss-as:deploy
- start geth using rinkeby testnet and enabling json-rpc api:
- geth --rinkeby --syncmode "fast" --cache=1024 --rpc console
- go to CCCRestClient folder to start the client that sends the sequences to the CCC
- ./runClient.sh