Skip to content

Commit 0e4cc4e

Browse files
Merge pull request #174 from iExecBlockchainComputing/release/9.0.0
Release 9.0.0
2 parents a1f2838 + 0048b1e commit 0e4cc4e

File tree

51 files changed

+965
-950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+965
-950
lines changed

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

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

5+
## [[9.0.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v9.0.0) 2025-03-28
6+
7+
### New Features
8+
9+
- All received commands are now stored in a single MongoDB collection. (#166)
10+
- Add `WebSocketBlockchainListener` with first iExec specific metrics. (#167)
11+
12+
### Quality
13+
14+
- Use no more `iexec-commons-poco` deprecated code in integration tests. (#163)
15+
- Fix Spring Security deprecations after Spring Boot 3.3.8 upgrade. (#169)
16+
- Use `CommandArgs` instead of split parameters in methods arguments. (#172)
17+
18+
### Breaking API changes
19+
20+
- Remove unversioned /tasks REST endpoints which are deprecated. (#164)
21+
- Remove exposed public chain configuration, the blockchain adapter is not a configuration service. (#165)
22+
- Harmonize YML internal variables to proper case. (#171)
23+
24+
### Dependency Upgrades
25+
26+
- Upgrade to `eclipse-temurin:17.0.13_11-jre-focal`. (#162)
27+
- Upgrade to Spring Doc OpenAPI 2.6.0. (#162)
28+
- Upgrade to Spring Boot 3.3.8. (#168)
29+
- Upgrade to `iexec-common` 9.0.0. (#173)
30+
- Upgrade to `iexec-commons-poco` 5.0.0. (#173)
31+
532
## [[8.6.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v8.6.0) 2024-12-20
633

734
### Bug Fixes

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build app container
2-
FROM eclipse-temurin:11.0.24_8-jre-focal
2+
FROM eclipse-temurin:17.0.13_11-jre-focal
33

44
ARG jar
55

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Overview
44

5-
The Blockchain Adapter API enables interacting with iExec smart contracts plus doing other Ethereum things.
6-
The Blockchain Adapter API accepts incoming requests asking for submitting transactions to iExec smart contracts.
5+
The Blockchain Adapter API enables interacting with iExec PoCo smart contracts.
6+
The Blockchain Adapter API accepts incoming requests asking for submitting transactions to iExec PoCo smart contracts.
77
Incoming requests are locally stored in a database.
88
Transactions related to these requests are being asynchronously sent to a blockchain node.
99
At any time, the caller can retrieve the processing status for his request.
@@ -26,13 +26,13 @@ To run properly, the iExec Blockchain Adapter API requires:
2626
| `IEXEC_BLOCKCHAIN_ADAPTER_API_PASSWORD` | Login password of the server. | String | `whatever` |
2727
| `IEXEC_BLOCKCHAIN_ADAPTER_API_MONGO_HOST` | Mongo server host. Cannot be set with URI. | String | `localhost` |
2828
| `IEXEC_BLOCKCHAIN_ADAPTER_API_MONGO_PORT` | Mongo server port. Cannot be set with URI. | Positive integer | `13012` |
29-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `134` |
30-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_IS_SIDECHAIN` | Define whether iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `true` |
31-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_NODE_ADDRESS` | URL to connect to the blockchain network. | URL | `https://bellecour.iex.ec` |
32-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_BLOCK_TIME` | Duration between consecutive blocks on the blockchain network, in seconds. | Positive integer | `5` |
33-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | Ethereum Address | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` |
34-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_MULTIPLIER` | Transactions will be sent with `networkGasPrice * gasPriceMultiplier`. | Float | `1.0` |
35-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_CAP` | In Wei, will be used for transactions if `networkGasPrice * gasPriceMultiplier > gasPriceCap`. | Positive integer | `22000000000` |
29+
| `IEXEC_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `134` |
30+
| `IEXEC_IS_SIDECHAIN` | Define whether iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `true` |
31+
| `IEXEC_BLOCKCHAIN_NODE_ADDRESS` | URL to connect to the blockchain network. | URL | `https://bellecour.iex.ec` |
32+
| `IEXEC_BLOCK_TIME` | Duration between consecutive blocks on the blockchain network, in seconds. | Positive integer | `5` |
33+
| `IEXEC_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | Ethereum Address | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` |
34+
| `IEXEC_GAS_PRICE_MULTIPLIER` | Transactions will be sent with `networkGasPrice * gasPriceMultiplier`. | Float | `1.0` |
35+
| `IEXEC_GAS_PRICE_CAP` | In Wei, will be used for transactions if `networkGasPrice * gasPriceMultiplier > gasPriceCap`. | Positive integer | `22000000000` |
3636
| `IEXEC_BLOCKCHAIN_ADAPTER_API_MAX_ALLOWED_TX_PER_BLOCK` | Max number of transactions per block, between `1` and `4`. | Positive integer | `1` |
3737
| `IEXEC_BLOCKCHAIN_ADAPTER_API_WALLET_PATH` | Path to the wallet of the server. | String | `src/main/resources/wallet.json` |
3838
| `IEXEC_BLOCKCHAIN_ADAPTER_API_WALLET_PASSWORD` | Password to unlock the wallet of the server. | String | `whatever` |
@@ -44,6 +44,26 @@ This endpoint allows to define health checks in an orchestrator or
4444
a [compose file](https://github.com/compose-spec/compose-spec/blob/master/spec.md#healthcheck).
4545
No default strategy has been implemented in the [Dockerfile](Dockerfile) at the moment.
4646

47+
## Metrics
48+
49+
The Blockchain Adapter API is a Spring Boot application configured to be able to expose metrics through
50+
the [Prometheus actuator](https://docs.spring.io/spring-boot/docs/3.0.13/reference/html/actuator.html#actuator.metrics.export.prometheus).
51+
Enabling the actuator allows to expose metrics with the [OpenMetrics](https://openmetrics.io/) format
52+
on the `/actuator/prometheus` endpoint.
53+
54+
By default, the following kind of metrics are exposed through autoconfiguration:
55+
- JVM specific metrics
56+
- MongoDB data source specific metrics
57+
- iExec specific business metrics
58+
59+
The current iExec specific metrics are:
60+
61+
| Metric name | Metric tag | Description |
62+
| ---------------------------------- | --------------- | ----------------------------------------------------------------------------------------------------- |
63+
| `iexec.chain-adapter.block.latest` | | Last block number seen in the websocket blockchain listener |
64+
| `iexec.chain-adapter.tx-count` | `block=latest` | Number of transactions sent with the configured wallet and mined in latest block |
65+
| `iexec.chain-adapter.tx-count` | `block=pending` | Number of transactions sent with the configured wallet, including both mined and pending transactions |
66+
4767
## Running in development mode
4868

4969
`./gradlew docker`

build.gradle

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
plugins {
22
id 'java'
33
id 'io.freefair.lombok' version '8.10.2'
4-
id 'org.springframework.boot' version '2.7.18'
4+
id 'org.springframework.boot' version '3.3.8'
55
id 'io.spring.dependency-management' version '1.1.6'
66
id 'jacoco'
77
id 'org.sonarqube' version '5.1.0.4882'
88
id 'maven-publish'
99
}
1010

1111
ext {
12-
openFeignVersion = '11.10'
1312
testContainersVersion = '1.20.4'
1413
}
1514

@@ -41,8 +40,12 @@ allprojects {
4140
toolchain {
4241
languageVersion.set(JavaLanguageVersion.of(17))
4342
}
44-
sourceCompatibility = '11'
45-
targetCompatibility = '11'
43+
sourceCompatibility = JavaVersion.VERSION_17
44+
targetCompatibility = JavaVersion.VERSION_17
45+
}
46+
47+
tasks.withType(JavaCompile).configureEach {
48+
options.compilerArgs.add('-parameters')
4649
}
4750
}
4851

@@ -55,16 +58,12 @@ dependencies {
5558
implementation 'org.springframework.boot:spring-boot-starter-web'
5659

5760
// Spring Doc
58-
implementation 'org.springdoc:springdoc-openapi-ui:1.7.0'
61+
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
5962

6063
// iexec
6164
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
6265
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
6366

64-
// feign
65-
implementation "io.github.openfeign:feign-jackson:$openFeignVersion"
66-
implementation "io.github.openfeign:feign-slf4j:$openFeignVersion"
67-
6867
// observability
6968
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
7069

@@ -87,32 +86,44 @@ testing {
8786
suites {
8887
configureEach {
8988
dependencies {
90-
implementation 'org.springframework.boot:spring-boot-starter-test'
9189
implementation 'org.awaitility:awaitility'
90+
implementation 'org.springframework.boot:spring-boot-starter-test'
91+
implementation 'org.springframework.security:spring-security-test'
92+
implementation "org.testcontainers:junit-jupiter:$testContainersVersion"
9293
}
9394
}
9495
test {
9596
useJUnitJupiter()
97+
dependencies {
98+
implementation "org.testcontainers:mongodb:$testContainersVersion"
99+
}
96100
}
97101
itest(JvmTestSuite) {
98-
sources {
99-
java {
100-
srcDirs = ['src/itest/java']
101-
}
102-
}
103102
dependencies {
104103
implementation project()
105104
implementation project(':iexec-blockchain-adapter-api-library')
106105
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
107106
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
108107
implementation 'org.apache.commons:commons-lang3'
109108
implementation 'org.hibernate.validator:hibernate-validator'
110-
implementation "org.testcontainers:junit-jupiter:$testContainersVersion"
111109
}
112110
}
113111
}
114112
}
115113

114+
tasks.withType(Test).configureEach {
115+
finalizedBy jacocoTestReport
116+
systemProperty "mongo.image", "mongo:7.0.15-jammy"
117+
}
118+
119+
// sonarqube code coverage requires jacoco XML report
120+
jacocoTestReport {
121+
reports {
122+
xml.required = true
123+
}
124+
}
125+
tasks.sonarqube.dependsOn tasks.jacocoTestReport
126+
116127
publishing {
117128
publications {
118129
maven(MavenPublication) {
@@ -131,18 +142,6 @@ publishing {
131142
}
132143
}
133144

134-
tasks.withType(Test).configureEach {
135-
finalizedBy jacocoTestReport
136-
}
137-
138-
// sonarqube code coverage requires jacoco XML report
139-
jacocoTestReport {
140-
reports {
141-
xml.required = true
142-
}
143-
}
144-
tasks.sonarqube.dependsOn tasks.jacocoTestReport
145-
146145
ext.jarPathForOCI = relativePath(tasks.bootJar.outputs.files.singleFile)
147146
ext.gitShortCommit = 'git rev-parse --short=8 HEAD'.execute().text.trim()
148147
ext.ociImageName = 'local/' + ['bash', '-c', 'basename $(git config --get remote.origin.url) .git'].execute().text.trim()

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
version=8.6.0
2-
iexecCommonVersion=8.6.0
3-
iexecCommonsPocoVersion=4.2.0
1+
version=9.0.0
2+
iexecCommonVersion=9.0.0
3+
iexecCommonsPocoVersion=5.0.0
44

55
nexusUser
66
nexusPassword

iexec-blockchain-adapter-api-library/build.gradle

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,29 @@ plugins {
66
}
77

88
dependencies {
9+
implementation platform('org.springframework.boot:spring-boot-dependencies:3.3.8')
910
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
1011
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
11-
implementation 'org.apache.commons:commons-lang3:3.12.0'
12+
implementation 'org.apache.commons:commons-lang3'
1213
}
1314

1415
java {
15-
sourceCompatibility = '11'
16-
targetCompatibility = '11'
16+
sourceCompatibility = JavaVersion.VERSION_17
17+
targetCompatibility = JavaVersion.VERSION_17
1718
withJavadocJar()
1819
withSourcesJar()
1920
}
2021

22+
tasks.withType(JavaCompile).configureEach {
23+
options.compilerArgs.add('-parameters')
24+
}
25+
2126
testing {
2227
suites {
2328
test {
2429
useJUnitJupiter()
2530
dependencies {
26-
implementation 'org.junit.jupiter:junit-jupiter:5.8.2'
27-
implementation 'org.mockito:mockito-junit-jupiter:4.5.1'
31+
implementation 'org.mockito:mockito-junit-jupiter'
2832
}
2933
}
3034
}

iexec-blockchain-adapter-api-library/src/main/java/com/iexec/blockchain/api/BlockchainAdapterApiClient.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2023 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2022-2025 IEXEC BLOCKCHAIN TECH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
1717
package com.iexec.blockchain.api;
1818

1919
import com.iexec.common.chain.adapter.args.TaskFinalizeArgs;
20-
import com.iexec.common.config.PublicChainConfig;
2120
import feign.Param;
2221
import feign.RequestLine;
2322

@@ -50,11 +49,4 @@ String requestInitializeTask(@Param("chainDealId") String chainDealId,
5049

5150
// endregion
5251

53-
// region unauthenticated APIs
54-
55-
@RequestLine("GET /config/chain")
56-
PublicChainConfig getPublicChainConfig();
57-
58-
//endregion
59-
6052
}

0 commit comments

Comments
 (0)