Skip to content

Commit ece0a44

Browse files
authored
Merge pull request #92 from iExecBlockchainComputing/release/8.1.0
Release/8.1.0
2 parents bd3c9a1 + 4c258cf commit ece0a44

Some content is hidden

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

42 files changed

+827
-1088
lines changed

CHANGELOG.md

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

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

5+
## [[8.1.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v8.1.0) 2023-06-07
6+
7+
### New Features
8+
- Enable Prometheus actuator. (#79)
9+
- Rework `QueueService` with a thread pool based on a `PriorityBlockingQueue`. (#84)
10+
- Do not use `broker` to match ordes on chain. (#87 #88)
11+
### Bug Fixes
12+
- Fix security rule to access Swagger API. (#79)
13+
### Quality
14+
- Use `testcontainers` in integration tests. (#89)
15+
- Remove `com.iexec.blockchain.dataset` package and update `feign` client endpoints. (#91)
16+
### Dependency Upgrades
17+
- Upgrade to `feign` 11.10. (#80)
18+
- Upgrade to `iexec-common` 8.2.0. (#83 #85 #90)
19+
- Upgrade to `iexec-commons-poco` 3.0.2. (#83 #85 #86 #90)
20+
521
## [[8.0.1]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v8.0.1) 2023-04-06
622

723
### Quality

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ To run properly, the iExec Blockchain Adapter API requires:
2525
| `IEXEC_BLOCKCHAIN_ADAPTER_API_PASSWORD` | Login password of the server. | String | `whatever` |
2626
| `IEXEC_BLOCKCHAIN_ADAPTER_API_MONGO_HOST` | Mongo server host. Cannot be set with URI. | String | `localhost` |
2727
| `IEXEC_BLOCKCHAIN_ADAPTER_API_MONGO_PORT` | Mongo server port. Cannot be set with URI. | Positive integer | `13012` |
28-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `65535` |
29-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_NODE_ADDRESS` | URL to connect to the blockchain network. | URL | `http://localhost:8545` |
30-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_BLOCK_TIME` | In seconds, parameter of the targeted blockchain. | Positive integer | `1` |
31-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | Ethereum Address | `0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002` |
32-
| `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` |
28+
| `IEXEC_BLOCKCHAIN_ADAPTER_API_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `134` |
29+
| `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` |
30+
| `IEXEC_BLOCKCHAIN_ADAPTER_API_NODE_ADDRESS` | URL to connect to the blockchain network. | URL | `https://bellecour.iex.ec` |
31+
| `IEXEC_BLOCKCHAIN_ADAPTER_API_BLOCK_TIME` | Duration between consecutive blocks on the blockchain network, in seconds. | Positive integer | `5` |
32+
| `IEXEC_BLOCKCHAIN_ADAPTER_API_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | Ethereum Address | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` |
3333
| `IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_MULTIPLIER` | Transactions will be sent with `networkGasPrice * gasPriceMultiplier`. | Float | `1.0` |
3434
| `IEXEC_BLOCKCHAIN_ADAPTER_API_GAS_PRICE_CAP` | In Wei, will be used for transactions if `networkGasPrice * gasPriceMultiplier > gasPriceCap`. | Positive integer | `22000000000` |
35-
| `IEXEC_BLOCKCHAIN_ADAPTER_API_BROKER_URL` | URL of the broker to interact with when matching iExec orders. | URL | `http://localhost:3000` |
3635
| `IEXEC_BLOCKCHAIN_ADAPTER_API_WALLET_PATH` | Path to the wallet of the server. | String | `src/main/resources/wallet.json` |
3736
| `IEXEC_BLOCKCHAIN_ADAPTER_API_WALLET_PASSWORD` | Password to unlock the wallet of the server. | String | `whatever` |
3837

@@ -49,3 +48,7 @@ No default strategy has been implemented in the [Dockerfile](docker/Dockerfile)
4948
## CI/CD build
5049

5150
`docker image build -f docker/Dockerfile .`
51+
52+
## License
53+
54+
This repository code is released under the [Apache License 2.0](LICENSE).

build.gradle

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
ext {
12-
openFeignVersion = '11.7'
12+
openFeignVersion = '11.10'
1313
}
1414

1515
if (!project.hasProperty('gitBranch')) {
@@ -47,9 +47,8 @@ allprojects {
4747
}
4848

4949
configurations {
50-
integrationTestCompile.extendsFrom testCompile
51-
integrationTestRuntime.extendsFrom testRuntime
52-
integrationTestImplementation.extendsFrom testImplementation
50+
itestRuntime.extendsFrom testRuntime
51+
itestImplementation.extendsFrom testImplementation
5352
}
5453

5554
dependencies {
@@ -63,6 +62,7 @@ dependencies {
6362
implementation 'org.springframework.boot:spring-boot-starter-web'
6463

6564
// iexec
65+
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
6666
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
6767

6868
// web3j bug required
@@ -72,15 +72,19 @@ dependencies {
7272
implementation 'com.squareup.okhttp3:okhttp:4.9.0' // Web3j issue: https://github.com/web3j/web3j/issues/1180
7373

7474
// feign
75-
implementation "io.github.openfeign:feign-core:$openFeignVersion"
7675
implementation "io.github.openfeign:feign-jackson:$openFeignVersion"
7776
implementation "io.github.openfeign:feign-slf4j:$openFeignVersion"
7877

78+
// observability
79+
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
80+
7981
// integration tests
8082
implementation project(':iexec-blockchain-adapter-api-library')
8183

8284
testImplementation 'org.springframework.boot:spring-boot-starter-test'
83-
testImplementation 'org.awaitility:awaitility:4.0.1'
85+
testImplementation 'org.awaitility:awaitility'
86+
87+
itestImplementation 'org.testcontainers:junit-jupiter:1.18.1'
8488
}
8589

8690
springBoot {
@@ -95,32 +99,24 @@ tasks.named("bootJar") {
9599
}
96100

97101
sourceSets {
98-
integrationTest {
102+
itest {
99103
java {
100104
compileClasspath += main.output + test.output
101105
runtimeClasspath += main.output + test.output
102-
srcDir 'src/itest/java'
103106
}
104-
resources.srcDir 'src/itest/resources'
105107
}
106108
}
107109

108-
task itestSetup(type: Exec) {
109-
commandLine 'docker-compose', 'up', '-d'
110-
}
111-
112-
task itestTeardown(type: Exec) {
113-
commandLine 'docker-compose', 'down'
114-
}
115-
116-
task itest(type: Test) {
110+
tasks.register("itest", Test) {
111+
doFirst {
112+
exec {
113+
commandLine 'docker', 'compose', 'pull', '-q'
114+
}
115+
}
117116
group 'Verification'
118117
description 'Runs the integration tests.'
119-
dependsOn itestSetup
120-
finalizedBy itestTeardown
121-
setTestClassesDirs(sourceSets.integrationTest.output)
122-
classpath = sourceSets.integrationTest.runtimeClasspath
123-
useJUnitPlatform()
118+
setTestClassesDirs(sourceSets.itest.output)
119+
classpath = sourceSets.itest.runtimeClasspath
124120
}
125121

126122
jar {
@@ -148,7 +144,8 @@ publishing {
148144
}
149145
}
150146

151-
test {
147+
tasks.withType(Test).configureEach {
148+
finalizedBy jacocoTestReport
152149
useJUnitPlatform()
153150
}
154151

@@ -161,7 +158,6 @@ jacocoTestReport {
161158
xml.required = true
162159
}
163160
}
164-
tasks.test.finalizedBy tasks.jacocoTestReport
165161
tasks.sonarqube.dependsOn tasks.jacocoTestReport
166162

167163
ext.jarPathForOCI = relativePath(tasks.bootJar.outputs.files.singleFile)

docker-compose.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,11 @@
1-
version: "3.5"
2-
3-
networks:
4-
iexec-blockchain-adapter-api-net:
5-
name: iexec-blockchain-adapter-api-net
6-
71
services:
82

93
ibaa-chain:
104
image: docker-regis.iex.ec/poco-chain:native-v5.4.2-5s
11-
container_name: ibaa-chain
12-
ports:
13-
- 28545:8545
14-
networks:
15-
- iexec-blockchain-adapter-api-net
16-
17-
ibaa-broker:
18-
image: docker-regis.iex.ec/iexec-autonomous-brokering-engine:dev #warn, using nexus repo + dev tag, can it be public?
19-
container_name: ibaa-broker
20-
environment:
21-
- CHAIN=http://ibaa-chain:8545
22-
- PROXY=0xC129e7917b7c7DeDfAa5Fff1FB18d5D7050fE8ca
23-
- MNEMONIC=${BROKER_PRIVATE_KEY} #must use an other wallet for the broker, like wallet-abc
24-
- PORT=3000
25-
ports:
26-
- 23000:3000
27-
depends_on:
28-
- ibaa-chain
29-
networks:
30-
- iexec-blockchain-adapter-api-net
31-
restart: unless-stopped
5+
expose:
6+
- "8545"
327

338
ibaa-blockchain-adapter-mongo:
349
image: library/mongo:4.4
35-
container_name: ibaa-blockchain-adapter-mongo
3610
entrypoint: "/bin/bash"
3711
command: -c "mongod --bind_ip_all --port 13012"
38-
ports:
39-
- 23012:13012
40-
networks:
41-
- iexec-blockchain-adapter-api-net

gradle.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
version=8.0.1
2-
iexecCommonVersion=7.0.0
1+
version=8.1.0
2+
iexecCommonVersion=8.2.0
3+
iexecCommonsPocoVersion=3.0.2
34

45
nexusUser
56
nexusPassword

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ plugins {
66
}
77

88
dependencies {
9+
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
910
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
1011
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
1112
}

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2022-2023 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.
@@ -16,15 +16,13 @@
1616

1717
package com.iexec.blockchain.api;
1818

19-
import com.iexec.blockchain.tool.Status;
20-
import com.iexec.common.chain.ChainDataset;
21-
import com.iexec.common.chain.ChainTask;
2219
import com.iexec.common.chain.adapter.CommandStatus;
2320
import com.iexec.common.chain.adapter.args.TaskContributeArgs;
2421
import com.iexec.common.chain.adapter.args.TaskFinalizeArgs;
2522
import com.iexec.common.chain.adapter.args.TaskRevealArgs;
2623
import com.iexec.common.config.PublicChainConfig;
2724
import com.iexec.common.sdk.broker.BrokerOrder;
25+
import com.iexec.commons.poco.chain.ChainTask;
2826
import feign.Param;
2927
import feign.RequestLine;
3028

@@ -44,20 +42,6 @@ public interface BlockchainAdapterApiClient {
4442
@RequestLine("POST /broker/broker/orders/match")
4543
String matchOrders(BrokerOrder brokerOrder);
4644

47-
@RequestLine("POST /datasets/requests?name={name}&multiAddress={multiAddress}&checksum={checksum}")
48-
String createDataset(@Param("name") String name,
49-
@Param("multiAddress") String multiAddress,
50-
@Param("checksum") String checksum);
51-
52-
@RequestLine("GET /datasets/requests/{requestId}")
53-
String getAddressForCreateDatasetRequest(@Param("requestId") String requestId);
54-
55-
@RequestLine("GET /datasets/requests/{requestId}/status")
56-
Status getStatusForCreateDatasetRequest(@Param("requestId") String requestId);
57-
58-
@RequestLine("GET /datasets?address={address}")
59-
ChainDataset getDatasetByAddress(@Param("address") String address);
60-
6145
@RequestLine("GET /metrics")
6246
String getMetrics();
6347

0 commit comments

Comments
 (0)