This repository was archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
[WIP] Update Readme #3
Open
vinistevam
wants to merge
3
commits into
web3j:master
Choose a base branch
from
vinistevam:readme
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # EEA Sample Project | ||
| 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 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 | ||
|
|
||
| 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/ | ||
| ``` | ||
|
|
||
| ```bash | ||
| $ ./gradlew generateContractWrappers | ||
| ``` | ||
| It will generate the `HumanStandardToken` smart contract wrapper into the project. | ||
|
|
||
| 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 | ||
| ``` | ||
|
|
||
|
|
||
| ## Additional Configuration (Intellij) | ||
|
|
||
| !!! important | ||
| 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. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.