Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog

All notable changes to this project will be documented in this file.

## [[7.1.2]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v7.1.2) 2022-11-29

* Update build workflow to 2.1.4, update documentation in README and add CHANGELOG.

## [[7.1.1]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v7.1.1) 2022-07-01

* Hotfix integration tests.

## [[7.1.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v7.1.0) 2022-07-01

* Add OpenFeign client library in dedicated iexec-blockchain-adapter-api-library jar.
* Use Spring Boot 2.6.2.
* Use Java 11.0.15.

## [[7.0.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v7.0.0) 2021-12-14

* Highly improved throughput of the iExec protocol.

## [[0.2.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v0.2.0) 2021-11-25

* Expose public chain configuration.
* Enable local import of iexec-common.
* Update build pipeline.

## [[0.1.1]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/0.1.1) 2021-11-10

* Send transactions synchronously to easily fix nonce conflicts.

## [[0.1.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/0.1.0) 2021-10-26

* First version.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Library('global-jenkins-library@2.0.1') _
@Library('global-jenkins-library@2.1.4') _
buildJavaProject(
buildInfo: getBuildInfo(),
integrationTestsEnvVars: ['BROKER_PRIVATE_KEY'],
Expand Down
47 changes: 42 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
# iexec-blockchain-client
A blockchain adapter API for iExec Smart-Contracts and other Ethereum things
# iExec Blockchain Adapter API

## Overview

The Blockchain Adapter API enables interacting with iExec smart contracts plus doing other Ethereum things.
The Blockchain Adapter API accepts incoming requests asking for submitting transactions to iExec smart contracts.
Incoming requests are locally stored in a database.
Transactions related to these requests are being asynchronously sent to a blockchain node.
At any time, the caller can retrieve the processing status for his request.

The iExec Blockchain Adapter API is available as an OCI image on [Docker Hub](https://hub.docker.com/r/iexechub/iexec-blockchain-adapter-api/tags).

To run properly, the iExec Blockchain Adapter API requires:
* A blockchain node. iExec smart contracts must be deployed on the blockchain network.
* A MongoDB instance to persist its data.
* A broker service to match iExec orders.
* An Ethereum wallet to interact with smart contracts on the blockchain network.

## Configuration

| Environment variable | Description | Type | Default value |
| --- | --- | --- | --- |
| IEXEC_BLOCKCHAIN_ADAPTER_API_PORT | Server HTTP port of the Blockchain Adapter API. | Positive integer | `13010` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_USERNAME | Login username of the server. | String | `admin` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_PASSWORD | Login password of the server. | String | `whatever` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_MONGO_HOST | Mongo server host. Cannot be set with URI. | String | `localhost` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_MONGO_PORT | Mongo server port. Cannot be set with URI. | Positive integer | `13012` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_CHAIN_ID | Chain ID of the blockchain network to connect. | Positive integer | `65535` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_NODE_ADDRESS | URL to connect to the blockchain network. | URL | `http://localhost:8545` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_BLOCK_TIME | In seconds, parameter of the targeted blockchain. | Positive integer | `1` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_HUB_ADDRESS | Proxy contract address to interact with the iExec on-chain protocol. | Ethereum Address | `0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_IS_SIDECHAIN | Define if iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `false` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_MULTIPLIER | Transactions will be sent with `networkGasPrice * gasPriceMultiplier`. | Float | `1.0` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_CAP | In Wei, will be used for transactions if `networkGasPrice * gasPriceMultiplier > gasPriceCap`. | Positive integer | `22000000000` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_BROKER_URL | URL of the broker to interact with when matching iExec orders. | URL | `http://localhost:3000` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_WALLET_PATH | Path to the wallet of the server. | String | `src/main/resources/wallet.json` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_WALLET_PASSWORD | Password to unlock the wallet of the server. | String | `whatever` |

## Running in development mode

# Local build
`./gradlew docker`

# CI/CD build
`docker image build -f docker/Dockerfile .`
## CI/CD build

`docker image build -f docker/Dockerfile .`
16 changes: 13 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ plugins {

ext {
openFeignVersion = '11.6'
gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
}

if (!project.hasProperty('gitBranch')) {
ext.gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
}

allprojects {
Expand All @@ -23,6 +26,13 @@ allprojects {
mavenLocal()
mavenCentral()
// iExec
maven {
url "https://docker-regis-adm.iex.ec/repository/maven-public/"
credentials {
username nexusUser
password nexusPassword
}
}
maven {
url "https://nexus.intra.iex.ec/repository/maven-public/"
}
Expand Down Expand Up @@ -120,8 +130,8 @@ publishing {
repositories {
maven {
credentials {
username project.hasProperty("nexusUser")? project.nexusUser: ''
password project.hasProperty("nexusPassword")? project.nexusPassword: ''
username nexusUser
password nexusPassword
}
url = project.hasProperty("nexusUrl")? project.nexusUrl: ''
}
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
version=7.1.1
version=7.1.2
iexecCommonVersion=6.0.0

nexusUser
nexusPassword
4 changes: 2 additions & 2 deletions iexec-blockchain-adapter-api-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ publishing {
repositories {
maven {
credentials {
username project.hasProperty("nexusUser")? project.nexusUser: ''
password project.hasProperty("nexusPassword")? project.nexusPassword: ''
username nexusUser
password nexusPassword
}
url = project.hasProperty("nexusUrl")? project.nexusUrl: ''
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ chain:
block-time: ${IEXEC_BLOCKCHAIN_ADAPTER_API_BLOCK_TIME:1} #in seconds, use 15 for mainnet
hub-address: ${IEXEC_BLOCKCHAIN_ADAPTER_API_HUB_ADDRESS:0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002} #0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f
is-sidechain: ${IEXEC_BLOCKCHAIN_ADAPTER_API_IS_SIDECHAIN:false}
gas-price-multiplier: ${IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_MULTIPLIER:1.0} # txs will be send with networkGasPrice*gasPriceMultiplier, 4.0 means super fast
gas-price-multiplier: ${IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_MULTIPLIER:1.0} # txs will be sent with networkGasPrice*gasPriceMultiplier, 4.0 means super fast
gas-price-cap: ${IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_CAP:22000000000} #in Wei, will be used for txs if networkGasPrice*gasPriceMultiplier > gasPriceCap
broker-url: ${IEXEC_BLOCKCHAIN_ADAPTER_API_BROKER_URL:http://localhost:3000}
wallet:
Expand Down