From 76f289fbb19ff4889911af2749b83c5029f5008b Mon Sep 17 00:00:00 2001 From: Vinicius Stevam Date: Wed, 17 Apr 2019 16:10:34 +0100 Subject: [PATCH 1/3] Update Readme.md --- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/README.md b/README.md index e69de29..22383f1 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,79 @@ +# EEA Sample Project +This project provides a simple web3j application that demonstrates the EEA features of web3j connecting to Pantheon in the Private Network. + +1. Connecting to a Pantheon the Ethereum network +2. Loading an Ethereum wallet file +3. Deploying a private token to the network +4. Transferring tokens privately between parties on the network +5. Viewing events from the point of view of different parties on the network + + +## Getting Started + +To start clone the repository and import the project: + +```bash +$ git clone https://github.com/web3j/eea-sample-project.git +``` + +## Prerequisites + +To run this tutorial, you must have the following installed: + +- [Docker and Docker-compose](https://docs.docker.com/compose/install/) + +- [Git command line](https://git-scm.com/) + +- MacOS or Linux + + !!! important + The Private Network Quickstart is not supported on Windows. If using Windows, run the quickstart + inside a Linux VM such as Ubuntu. + +- [Pantheon-Quickstart](https://github.com/PegaSysEng/pantheon-quickstart) - Setup and run the private dockerized environment. + - [Privacy](https://github.com/PegaSysEng/pantheon-quickstart/tree/4-node-example/privacy) + +- [Solidity](https://solidity.readthedocs.io/en/v0.4.24/installing-solidity.html) - Solidity version between 0.4.2 < and < 0.5. + +## Setup + +A step by step series of how to get an environment setup and running. + + +Access the folder. + +```bash +$ cd eea-sample-project/ +``` + +Execute `./gradlew generateContractWrappers`. +It will generate the `HumanStandardToken` injecting this dependency into the project. +To mark `build` directory as `Unmark Generated Sources Root` . + +Go to build > generated > source > web3j > main > java. +```bash +build/ +├── generated/ + └──── source/ + └──── web3j/ + └──── main/ + └──── java/ +``` +Right clique > Mark Directory As > Unmark Generated Sources Root. + + +```bash +$ ./gradlew generateContractWrappers +``` + +Execute `./gradlew test`. + +!!! important + To execute `./gradlew test` you need to have all the nodes from Pantheon-Quickstart running. + +```bash +$ ./gradlew test +``` + + + From b04486da28d098fcb63528db2464fedbba647975 Mon Sep 17 00:00:00 2001 From: Vinicius Stevam Date: Thu, 18 Apr 2019 12:00:42 +0100 Subject: [PATCH 2/3] add output example --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 22383f1..266b68c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # EEA Sample Project -This project provides a simple web3j application that demonstrates the EEA features of web3j connecting to Pantheon in the Private Network. +The project provides a simple web3j application that demonstrates the EEA features of web3j connecting to Pantheon in the Private Network. + +## Functionality +This application demonstrates a number of core features of web3j and Ethereum through Pantheon nodes: 1. Connecting to a Pantheon the Ethereum network 2. Loading an Ethereum wallet file @@ -66,6 +69,44 @@ Right clique > Mark Directory As > Unmark Generated Sources Root. $ ./gradlew generateContractWrappers ``` +To execute the application. + +!!! important + To execute `./gradlew run` you need to have all the nodes from Pantheon-Quickstart running. + +```bash +$ ./gradlew run +``` + +Example Output +```bash +11:02:37.221 [main] INFO org.web3j.eea.sample.Application - Alice deploying private token for {Alice, Bob} +11:02:38.961 [main] INFO org.web3j.eea.sample.Application - Token deployed at 0x08ae6fb627eff726705d72e3705746f5353986f2 for {Alice, Bob} +11:02:38.962 [main] INFO org.web3j.eea.sample.Application - Alice view of tokens: +11:02:42.115 [main] INFO org.web3j.eea.sample.Application - Alice: 10 +11:02:42.115 [main] INFO org.web3j.eea.sample.Application - Bob: 0 +11:02:42.115 [main] INFO org.web3j.eea.sample.Application - Bob view of tokens: +11:02:44.443 [main] INFO org.web3j.eea.sample.Application - Alice: 10 +11:02:44.444 [main] INFO org.web3j.eea.sample.Application - Bob: 0 +11:02:44.445 [main] INFO org.web3j.eea.sample.Application - Transferring 10 tokens from Alice to Bob +11:02:45.545 [main] INFO org.web3j.eea.sample.Application - Alice view of tokens: +11:02:47.687 [main] INFO org.web3j.eea.sample.Application - Alice: 0 +11:02:47.687 [main] INFO org.web3j.eea.sample.Application - Bob: 10 +11:02:47.687 [main] INFO org.web3j.eea.sample.Application - Bob view of tokens: +11:02:49.848 [main] INFO org.web3j.eea.sample.Application - Alice: 0 +11:02:49.848 [main] INFO org.web3j.eea.sample.Application - Bob: 10 +11:02:49.849 [main] INFO org.web3j.eea.sample.Application - Transferring 1 token from Bob to Alice +11:02:50.900 [main] INFO org.web3j.eea.sample.Application - Alice view of tokens: +11:02:53.003 [main] INFO org.web3j.eea.sample.Application - Alice: 1 +11:02:53.003 [main] INFO org.web3j.eea.sample.Application - Bob: 9 +11:02:53.003 [main] INFO org.web3j.eea.sample.Application - Bob view of tokens: +11:02:57.098 [main] INFO org.web3j.eea.sample.Application - Alice: 1 +11:02:57.098 [main] INFO org.web3j.eea.sample.Application - Bob: 9 + +BUILD SUCCESSFUL in 22s +``` + +## Test Execute `./gradlew test`. !!! important @@ -75,5 +116,3 @@ Execute `./gradlew test`. $ ./gradlew test ``` - - From b91adb63ca9c7e4e15a02f9c23067ffbd2f1371f Mon Sep 17 00:00:00 2001 From: Vinicius Stevam Date: Tue, 23 Apr 2019 09:06:07 +0100 Subject: [PATCH 3/3] Improving Readme. --- README.md | 50 ++++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 266b68c..fd72e84 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ The project provides a simple web3j application that demonstrates the EEA featur ## Functionality This application demonstrates a number of core features of web3j and Ethereum through Pantheon nodes: -1. Connecting to a Pantheon the Ethereum network -2. Loading an Ethereum wallet file -3. Deploying a private token to the network -4. Transferring tokens privately between parties on the network -5. Viewing events from the point of view of different parties on the network +1. Connecting to two Pantheon nodes with private transaction support; +2. Loading the credentials associated with those nodes; +3. Deploying a private token to the network; +4. Transferring tokens privately between parties on the network; +5. Viewing the state of the contract from the points of view of different nodes; ## Getting Started @@ -49,25 +49,10 @@ Access the folder. $ cd eea-sample-project/ ``` -Execute `./gradlew generateContractWrappers`. -It will generate the `HumanStandardToken` injecting this dependency into the project. -To mark `build` directory as `Unmark Generated Sources Root` . - -Go to build > generated > source > web3j > main > java. -```bash -build/ -├── generated/ - └──── source/ - └──── web3j/ - └──── main/ - └──── java/ -``` -Right clique > Mark Directory As > Unmark Generated Sources Root. - - ```bash $ ./gradlew generateContractWrappers ``` +It will generate the `HumanStandardToken` smart contract wrapper into the project. To execute the application. @@ -106,13 +91,22 @@ Example Output BUILD SUCCESSFUL in 22s ``` -## Test -Execute `./gradlew test`. + +## Additional Configuration (Intellij) !!! important - To execute `./gradlew test` you need to have all the nodes from Pantheon-Quickstart running. - -```bash -$ ./gradlew test -``` + Execute this step only if your IDE is the `Intellij`. +To mark `build` directory as `Mark Generated Sources Root` . + +Go to build > generated > source > web3j > main > java. + +```bash +build/ +├── generated/ + └──── source/ + └──── web3j/ + └──── main/ + └──── java/ +``` +Right click > Mark Directory As > Mark Generated Sources Root.