-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from iExecBlockchainComputing/release/2.0.0
Release/2.0.0
- Loading branch information
Showing
52 changed files
with
4,328 additions
and
241 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,2 +1,41 @@ | ||
# iexec-commons-poco | ||
PoCo Java wrappers for the iExec platform | ||
|
||
|
||
## Steps to generate Java Wrappers for Smart Contracts | ||
|
||
First you need to install last version of Web3j CLI, the simplest way to install the Web3j CLI is via the following script: | ||
|
||
``` | ||
curl -L get.web3j.io | sh && source ~/.web3j/source.sh | ||
``` | ||
Verify the installation was successful | ||
``` | ||
web3j -v | ||
Version: 1.4.2 | ||
``` | ||
|
||
After, you need to clone `Poco-dev` repository | ||
``` | ||
git clone https://github.com/iExecBlockchainComputing/PoCo-dev/ | ||
cd PoCo-dev | ||
git checkout x.y.z | ||
``` | ||
|
||
Edit script `generateContractWrappers` and check lines *15* and *18*. If necessary, adjust the directories to match your local work tree. | ||
``` shell | ||
#Put here the PoCo-dev directory that contains smart contracts (JSON files) | ||
POCO_DEV_CONTRACTS_DIRECTORY=${HOME}/iexecdev/PoCo-dev/build/contracts/ | ||
|
||
#Put here the src/main/java/ directory of commons-poco project | ||
COMMONS_POCO_WRAPPER_DIRECTORY=${HOME}/iexecdev/iexec-commons-poco/src/main/java/ | ||
``` | ||
|
||
Clean `IexecLibOrders_v5.OrderOperationEnum` references from `IexecLibOrders_v5.json` with your favorite editor(Only in abi node). | ||
|
||
You can now run the script | ||
``` shell | ||
./generateContractWrappers App AppRegistry Dataset DatasetRegistry Ownable Workerpool WorkerpoolRegistry IexecInterfaceTokenABILegacy IexecLibOrders_v5 | ||
``` | ||
|
||
After this execution and if no error has occurred, you must rename `IexecInterfaceTokenABILegacy.java` to `IexecHubContract.java` and also rename the java class. |
This file contains 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
This file contains 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,5 @@ | ||
services: | ||
poco-chain: | ||
image: docker-regis.iex.ec/poco-chain:native-v5.4.2-5s | ||
expose: | ||
- "8545" |
This file contains 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,59 @@ | ||
#!/usr/bin/env bash | ||
|
||
################################################################### | ||
#Script Name : generateContractWrappers | ||
#Description : Script to facilitate the generation of java wrappers | ||
#Args : list of smart contracts json files without extension | ||
#Exemple : ./generateContractWrappers App AppRegistry | ||
#Author : iExec | ||
################################################################### | ||
|
||
set -Eeuo pipefail | ||
|
||
|
||
#Put here the PoCo-dev directory that contains smart contracts (JSON files) | ||
POCO_DEV_CONTRACTS_DIRECTORY=${HOME}/iexecdev/PoCo-dev/build/contracts/ | ||
|
||
#Put here the src/main/java/ directory of commons-poco project | ||
COMMONS_POCO_WRAPPER_DIRECTORY=${HOME}/iexecdev/iexec-commons-poco/src/main/java/ | ||
|
||
#Put here the java package for commons-poco Wrappers | ||
COMMONS_POCO_PACKAGE='com.iexec.commons.poco.contract.generated' | ||
|
||
|
||
check_mandatory_dependency(){ | ||
CMDS="web3j" | ||
|
||
for i in $CMDS | ||
do | ||
command -v $i >/dev/null && continue || { echo "$i command not found."; exit 1; } | ||
done | ||
} | ||
|
||
check_mandatory_directory(){ | ||
if [ ! -d "$1" ]; | ||
then | ||
echo "$1 directory does not exist." | ||
exit 1 | ||
fi | ||
} | ||
|
||
generate_wrapper() { | ||
if test -f "$POCO_DEV_CONTRACTS_DIRECTORY$1.json"; then | ||
web3j generate truffle --truffle-json $POCO_DEV_CONTRACTS_DIRECTORY$1.json -o $COMMONS_POCO_WRAPPER_DIRECTORY -p $COMMONS_POCO_PACKAGE | ||
else | ||
echo "Missing $POCO_DEV_CONTRACTS_DIRECTORY$1.json file" | ||
exit 1 | ||
fi | ||
} | ||
|
||
|
||
check_mandatory_dependency | ||
check_mandatory_directory $POCO_DEV_CONTRACTS_DIRECTORY | ||
check_mandatory_directory $COMMONS_POCO_WRAPPER_DIRECTORY | ||
|
||
|
||
for var in "$@" | ||
do | ||
generate_wrapper $var | ||
done |
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version=1.0.2 | ||
version=2.0.0 | ||
|
||
nexusUser | ||
nexusPassword |
This file contains 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,3 @@ | ||
# This file is generated by the 'io.freefair.lombok' Gradle plugin | ||
config.stopBubbling = true | ||
lombok.addLombokGeneratedAnnotation = true |
This file contains 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
This file contains 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
Oops, something went wrong.