Skip to content

Commit 18fc3e8

Browse files
Merge pull request #379 from iExecBlockchainComputing/release/5.0.0
Release/5.0.0
2 parents 3f31f71 + 5718423 commit 18fc3e8

File tree

72 files changed

+633
-1771
lines changed

Some content is hidden

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

72 files changed

+633
-1771
lines changed

Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
#openjdk:12-alpine heavy and not supporting jre-only yet, azul-zulu based on openjdk
2-
FROM azul/zulu-openjdk-alpine:11.0.3-jre
1+
FROM openjdk:11.0.7-jre-slim
32

4-
# Default certificate will only be valid at 'https://localhost:[...]' (and not at 'https://core:[...]' for e.g.)
5-
COPY build/resources/main/ssl-keystore-dev.p12 /ssl/ssl-keystore.p12
6-
ENV IEXEC_CORE_SSL_KEYSTORE /ssl/ssl-keystore.p12
7-
8-
ADD build/libs/iexec-core-@[email protected] iexec-core.jar
3+
COPY build/libs/iexec-core-@[email protected] iexec-core.jar
94

105
ENTRYPOINT ["java","-jar","/iexec-core.jar"]

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,3 @@ Since the core will perform some transactions on the blockchain and handle some
4040
## Documentation
4141

4242
A more exhaustive documentation is available on [the official documentation of iExec](https://docs.iex.ec/)
43-
44-
45-
46-
## HTTPS
47-
48-
* Self-signed certificate (dev purpose only)
49-
50-
`keytool -genkey -alias iexec-core -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore ./src/main/resources/ssl-keystore-dev.p12 -validity 3650`
51-
52-
* Replace it with a real certificate in production

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ dependencies {
8484
compile "org.springframework.boot:spring-boot-starter-actuator"
8585
compile "org.springframework.cloud:spring-cloud-starter-openfeign"
8686

87+
// NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'
88+
implementation 'com.squareup.okhttp3:okhttp:4.3.1' // Web3j issue: https://github.com/web3j/web3j/issues/1180
89+
// NoSuchMethodError: 'byte[] kotlin.collections.ArraysKt.copyInto(byte[], byte[], int, int, int)'
90+
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.50' // https://stackoverflow.com/a/57907899
91+
8792
testCompile "org.springframework.boot:spring-boot-starter-test"
8893

8994
// swagger
@@ -217,7 +222,7 @@ task buildImage(type: Exec) {
217222
}
218223

219224
buildImage.dependsOn prepareDockerFile
220-
buildImage.enabled = isMasterBranch || project.hasProperty("forceDockerBuild")
225+
buildImage.enabled = (isMasterBranch || isDevelopBranch ) || project.hasProperty("forceDockerBuild")
221226

222227
task pushImage(type: Exec) {
223228
if (project.hasProperty("nexusUser") && project.hasProperty("nexusPassword")) {
@@ -232,4 +237,4 @@ task pushImage(type: Exec) {
232237
}
233238

234239
pushImage.dependsOn buildImage
235-
pushImage.enabled = isMasterBranch && project.hasProperty("nexusUser") && project.hasProperty("nexusPassword")
240+
pushImage.enabled = (isMasterBranch || isDevelopBranch ) && project.hasProperty("nexusUser") && project.hasProperty("nexusPassword")

docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ services:
1313
- IEXEC_IPFS_HOST=ipfs
1414
- IEXEC_SMS_HOST=sms
1515
- IEXEC_SCONE_CAS_HOST=iexec-cas
16-
- IEXEC_CORE_SSL_KEYSTORE=/iexec/ssl-keystore-dev.p12
17-
- IEXEC_CORE_SSL_PASSWORD=whatever
1816
volumes:
1917
- ./wallet/encrypted-wallet_scheduler.json:/iexec/wallet/encrypted-wallet.json
20-
- ./ssl-keystore-dev.p12:/iexec/ssl-keystore-dev.p12
2118
ports:
2219
- 18090:18090
2320
restart: on-failure

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
iexecCommonVersion=4.0.1
1+
iexecCommonVersion=5.0.0
22
nexusUser=fake
33
nexusPassword=fake
4-
version=4.0.1
4+
version=5.0.0
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.iexec.core;
22

3-
import com.iexec.core.chain.IexecHubService;
3+
import com.iexec.core.chain.DealWatcherService;
44
import org.springframework.beans.factory.annotation.Autowired;
55
import org.springframework.boot.CommandLineRunner;
66
import org.springframework.boot.SpringApplication;
@@ -11,16 +11,14 @@
1111
public class Application implements CommandLineRunner {
1212

1313
@Autowired
14-
private IexecHubService iexecHubService;
14+
private DealWatcherService dealWatcherService;
1515

1616
public static void main(String[] args) {
1717
SpringApplication.run(Application.class, args);
1818
}
1919

2020
@Override
2121
public void run(String... args) throws Exception {
22-
if (!iexecHubService.hasEnoughGas()) {
23-
System.exit(0);
24-
}
22+
dealWatcherService.run();
2523
}
2624
}

src/main/java/com/iexec/core/HttpWebServerConfiguration.java

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
11
package com.iexec.core.chain;
22

3-
import lombok.extern.slf4j.Slf4j;
4-
import org.springframework.stereotype.Service;
5-
import org.web3j.crypto.CipherException;
6-
import org.web3j.crypto.Credentials;
7-
import org.web3j.crypto.WalletUtils;
3+
import com.iexec.common.chain.CredentialsAbstractService;
84

9-
import java.io.IOException;
5+
import org.springframework.beans.factory.annotation.Value;
6+
import org.springframework.stereotype.Service;
107

11-
@Slf4j
128
@Service
13-
public class CredentialsService {
14-
15-
private Credentials credentials;
16-
17-
public CredentialsService(WalletDetails walletDetails) throws IOException, CipherException {
18-
try {
19-
credentials = WalletUtils.loadCredentials(walletDetails.getPassword(), walletDetails.getPath());
20-
log.info("Load core wallet credentials [address:{}] ", credentials.getAddress());
21-
} catch (IOException | CipherException e) {
22-
log.error("Credentials cannot be loaded [exception:{}] ", e);
23-
throw e;
24-
}
25-
}
9+
public class CredentialsService extends CredentialsAbstractService {
2610

27-
public Credentials getCredentials() {
28-
return credentials;
11+
public CredentialsService(
12+
@Value("${wallet.password}") String walletPassword,
13+
@Value("${wallet.encryptedFilePath}") String walletPath
14+
) throws Exception {
15+
super(walletPassword, walletPath);
2916
}
30-
}
17+
}

src/main/java/com/iexec/core/chain/DealEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.iexec.core.chain;
22

3-
import com.iexec.common.contract.generated.IexecClerkABILegacy;
3+
import com.iexec.common.contract.generated.IexecHubContract;
44
import com.iexec.common.utils.BytesUtils;
55
import lombok.Builder;
66
import lombok.Data;
@@ -23,7 +23,7 @@ public DealEvent(String chainDealId, BigInteger blockNumber) {
2323
this.blockNumber = blockNumber;
2424
}
2525

26-
public DealEvent(IexecClerkABILegacy.SchedulerNoticeEventResponse schedulerNoticeEventResponse) {
26+
public DealEvent(IexecHubContract.SchedulerNoticeEventResponse schedulerNoticeEventResponse) {
2727
this.chainDealId = BytesUtils.bytesToString(schedulerNoticeEventResponse.dealid);
2828
this.blockNumber = schedulerNoticeEventResponse.log.getBlockNumber();
2929
}

src/main/java/com/iexec/core/chain/DealWatcherService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.springframework.scheduling.annotation.Scheduled;
1414
import org.springframework.stereotype.Service;
1515

16-
import javax.annotation.PostConstruct;
1716
import java.math.BigInteger;
1817
import java.util.Optional;
1918

@@ -39,8 +38,7 @@ public DealWatcherService(IexecHubService iexecHubService,
3938
this.taskService = taskService;
4039
}
4140

42-
@PostConstruct
43-
void run() {
41+
public void run() {
4442
subscribeToDealEventFromOneBlockToLatest(configurationService.getLastSeenBlockWithDeal());
4543
}
4644

@@ -88,7 +86,7 @@ private void handleDeal(String chainDealId) {
8886
* Some deal events are sometimes missed by #schedulerNoticeEventObservable method
8987
* so we decide to replay events from times to times (already saved events will be ignored)
9088
* */
91-
@Scheduled(fixedRateString = "${detector.dealwatcherreplay.period}")
89+
@Scheduled(fixedRateString = "${cron.detector.dealwatcherreplay.period}")
9290
void replayDealEvent() {
9391
if (configurationService.getFromReplay().intValue() < configurationService.getLastSeenBlockWithDeal().intValue()) {
9492
if (dealEventSubscriptionReplay != null && !dealEventSubscriptionReplay.isDisposed()) {

0 commit comments

Comments
 (0)