Skip to content
Snippets Groups Projects
Commit a53d0014 authored by mi3u17's avatar mi3u17
Browse files

new read me file outside the project folder

parent 74b96610
Branches
No related tags found
No related merge requests found
#MARINOS ILIADIS ##MSc Project
- Marinos Iliadis
- University of Southampton 2017-2018
- MSc Data Science
##Eclipse Gradle project ## Project Title
Maintaining Privacy in Database and Data exchange using Blockchain Mechanisms and Smart Contract
## How to import the project into Eclipse ## How to import the project into Eclipse
Open Eclipse -> Go to File -> Open Project From File System -> Show other specialised import wizard-> Gradle -> Existing Gradle -> sample-project-gradle-master - Open Eclipse -> Go to File -> Open Project From File System -> Show other specialised import wizard-> Gradle -> Existing Gradle -> sample-project-gradle-master
Import this project to Eclipse (I use Eclipse Oxygen 3A) as an existing grandle project. - Import this project to Eclipse (I use Eclipse Oxygen 3A) as an existing Gradle project.
Our eclipse project uses the web3j library. Java library to interact with Ethereum blockchain and solidity smart contracts - Our eclipse project uses the web3j library. Java library to interact with Ethereum blockchain and solidity smart contracts
Run the "Application.java" - Run the "Application.java"
### Functionality ### Functionality
...@@ -26,44 +30,45 @@ This decentralised application shows an Access control mechanism in order to inc ...@@ -26,44 +30,45 @@ This decentralised application shows an Access control mechanism in order to inc
### Ethereum wallet ### Ethereum wallet
To use our java dapp need to have an Ethereum wallet. Set up a password. - To use our java dapp need to have an Ethereum wallet. Set up a password.
This can be generated using the web3j command line tool. - This can be generated using the web3j command line tool.
https://docs.web3j.io/command_line.html - https://docs.web3j.io/command_line.html
OR OR
Using the MyEtherWallet website to create an Ethereum wallet file - Using the MyEtherWallet website to create an Ethereum wallet file
https://www.myetherwallet.com/ - https://www.myetherwallet.com/
### Manage account ### Manage account
By using MetaMask Google Chrome Extension - By using MetaMask Google Chrome Extension
check how it works here: - Check how it works here:
https://metamask.io/ - https://metamask.io/
OR OR
By visiting Etherscan's website and add the addres to th search bar
https://etherscan.io/ - By visiting Etherscan's website and add the address to the search bar
- https://etherscan.io/
### Request some ether ### Request some Ether from Faucet
Import the wallet file into the MetaMask account. - Import the wallet file into the MetaMask account.
Change from Main Netwotk to Ropsten Network and click the Buy button. - Change from Main Netwotk to Ropsten Network and click the Buy button.
Then, click Ropsten test Fuacet. - Then, click Ropsten test Faucet.
Request ether several times. - Request Ether several times.
Ether need to deploy and interact with the functions of our smart contract - Ether are required for the deployment and the interaction with the functions of our smart contract
### Smart contracts ### Smart contracts
There are several smart contracts in this dapp, the most updated one is the "Acladv.java". - There are several smart contracts in this dapp, the most updated one is the "Acladv.java".
You can find all smart contracts of my project in the folder src/main/resources insolidity type (.sol) - You can find all smart contracts of my project in the folder src/main/resources insolidity type (.sol)
You can test them in https://remix.ethereum.org/ as well - You can test them in https://remix.ethereum.org/ as well
### Infura ### Infura
Cloud-based ethereum clients. Need to sign in and create a auto generated token in order to use our java dapp. - Cloud-based ethereum clients. Need to sign in and create a auto generated token in order to use our java dapp.
https://infura.io/register.html - https://infura.io/register.html
### Testnet ### Testnet
...@@ -71,32 +76,32 @@ In this prototype java dapp we deploy our contract on the Ropsten Test Network ...@@ -71,32 +76,32 @@ In this prototype java dapp we deploy our contract on the Ropsten Test Network
### Solidity compiler and Java wrappers ### Solidity compiler and Java wrappers
A) Compiling Solidity source code -- A) Compiling Solidity source code
1) npm install -g solc - 1) npm install -g solc
2) solc or solcjs <contract>.sol --bin --abi --optimize -o <output-dir>/ - 2) solc or solcjs <contract>.sol --bin --abi --optimize -o <output-dir>/
Links: -- Links:
https://web3j.readthedocs.io/en/latest/smart_contracts.html - https://web3j.readthedocs.io/en/latest/smart_contracts.html
https://www.npmjs.com/package/solc - https://www.npmjs.com/package/solc
http://solidity.readthedocs.io/en/develop/installing-solidity.html - http://solidity.readthedocs.io/en/develop/installing-solidity.html
B) Auto generated Java wrapper for solidity smart contract -- B) Auto generated Java wrapper for solidity smart contract
Need first to save your solidity code into a Notepad++ file with extention <yourcontract>.sol Need first to save your solidity code into a Notepad++ file with extention <yourcontract>.sol
Solidity smart contract wrappers Solidity smart contract wrappers
3) web3j solidity generate [--javaTypes|--solidityTypes] /path/to/<smart-contract>.bin /path/to/<smart-contract>.abi -o /path/to/src/main/java -p com.your.organisation.name - 3) web3j solidity generate [--javaTypes|--solidityTypes] /path/to/<smart-contract>.bin /path/to/<smart-contract>.abi -o /path/to/src/main/java -p com.your.organisation.name
Link: -- Link:
https://docs.web3j.io/smart_contracts.html#smart-contract-wrappers - https://docs.web3j.io/smart_contracts.html#smart-contract-wrappers
### Viewing logs on blockchain ### Viewing logs on blockchain
Logback configuration is provided in the project dependencies giving the opportunity to logging of protocol - Logback configuration is provided in the project dependencies giving the opportunity to logging of protocol
messages. messages.
To enable change the following line in the logback configuration: - To enable this need to change the following line in the logback config:
```xml ```xml
<logger name="org.web3j.protocol" level="DEBUG"/> <logger name="org.web3j.protocol" level="DEBUG"/>
``` ```
### Extra Dependencies (check build.grandle) ### Extra Dependencies for the project (check build.grandle)
Assert java 3.10.0 - Assert java 3.10.0
Javatuples 1.2 - Javatuples 1.2
JUnit 4.12 for testing - JUnit 4.12 for testing
\ No newline at end of file \ No newline at end of file
#MSc Project ##MSc Project
- Marinos Iliadis - Marinos Iliadis
- University of Southampton 2017-2018 - University of Southampton 2017-2018
- MSc Data Science - MSc Data Science
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment