Skip to content

Commit

Permalink
Merge pull request #138 from cardano-foundation/develop
Browse files Browse the repository at this point in the history
chore: Merge develop to main
  • Loading branch information
satran004 authored Mar 4, 2024
2 parents c79af01 + affdc6e commit 5b2da38
Show file tree
Hide file tree
Showing 429 changed files with 2,676 additions and 1,689 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Build docker image


```shell
docker build -t cardanofoundation/ledger-sync:<version> .
docker build --target ledger-sync -t cardanofoundation/ledger-sync:<version> .
```

### Docker Run
Expand Down
6 changes: 4 additions & 2 deletions application/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
plugins {
id 'org.springframework.boot' version '3.1.4'
id 'nu.studer.jooq' version '8.2'
id 'org.springframework.boot' version '3.2.2'
id 'nu.studer.jooq' version '8.2.3'
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-jooq'
Expand Down Expand Up @@ -57,6 +58,7 @@ ext {
}

jooq {
version = '3.18.9'
configurations {
main {
generateSchemaSourceOnCompilation = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cardanofoundation.ledgersync.explorerconsumer;
package org.cardanofoundation.ledgersync;

import jakarta.annotation.PostConstruct;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
Expand All @@ -17,15 +18,21 @@
@ComponentScan(basePackages = "org.cardanofoundation.*")
@EntityScan("org.cardanofoundation.*")
@EnableJpaRepositories("org.cardanofoundation.*")
public class ExplorerConsumerApplication {
public class LedgerSyncApplication {

static {
System.setProperty("org.jooq.no-logo", "true");
System.setProperty("org.jooq.no-tips", "true");
}

public static void main(String[] args) {
SpringApplication.run(ExplorerConsumerApplication.class, args);
SpringApplication.run(LedgerSyncApplication.class, args);
}

@PostConstruct
public void postConstruct() {
long maxMemory = Runtime.getRuntime().maxMemory();
log.info("<< Max JVM heap memory: {} MB", maxMemory / (1024 * 1024) + " >>");
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.aggregate;
package org.cardanofoundation.ledgersync.aggregate;

import com.bloxbean.cardano.client.crypto.Base58;
import lombok.AccessLevel;
Expand All @@ -8,7 +8,7 @@
import lombok.experimental.FieldDefaults;
import org.cardanofoundation.ledgersync.common.common.address.ShelleyAddress;
import org.cardanofoundation.ledgersync.common.util.HexUtil;
import org.cardanofoundation.ledgersync.explorerconsumer.constant.ConsumerConstant;
import org.cardanofoundation.ledgersync.constant.ConsumerConstant;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.aggregate;
package org.cardanofoundation.ledgersync.aggregate;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.aggregate;
package org.cardanofoundation.ledgersync.aggregate;

import lombok.AccessLevel;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.aggregate;
package org.cardanofoundation.ledgersync.aggregate;

//import org.cardanofoundation.ledgersync.common.common.AuxData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.aggregate;
package org.cardanofoundation.ledgersync.aggregate;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.aggregate;
package org.cardanofoundation.ledgersync.aggregate;

import com.bloxbean.cardano.yaci.core.model.Amount;
import com.bloxbean.cardano.yaci.core.model.Update;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.aggregate;
package org.cardanofoundation.ledgersync.aggregate;

import com.bloxbean.cardano.yaci.core.model.TransactionInput;
import com.bloxbean.cardano.yaci.core.model.byron.ByronTxIn;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.aggregate;
package org.cardanofoundation.ledgersync.aggregate;

//import org.cardanofoundation.ledgersync.common.common.Amount;
//import org.cardanofoundation.ledgersync.common.common.Datum;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.configuration;
package org.cardanofoundation.ledgersync.configuration;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.configuration;
package org.cardanofoundation.ledgersync.configuration;

import org.jooq.conf.MappedSchema;
import org.jooq.conf.RenderMapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.configuration;
package org.cardanofoundation.ledgersync.configuration;

import io.micrometer.core.aop.TimedAspect;
import io.micrometer.core.instrument.MeterRegistry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.constant;
package org.cardanofoundation.ledgersync.constant;

import org.cardanofoundation.ledgersync.common.common.constant.Constant;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.converter;
package org.cardanofoundation.ledgersync.converter;

import co.nstant.in.cbor.model.Array;
import co.nstant.in.cbor.model.ByteString;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.converter;
package org.cardanofoundation.ledgersync.converter;

import co.nstant.in.cbor.model.Array;
import co.nstant.in.cbor.model.Map;
Expand All @@ -14,7 +14,7 @@
import java.util.List;
import java.util.stream.IntStream;

import static org.cardanofoundation.ledgersync.explorerconsumer.service.impl.genesis.GenesisDataServiceImpl.convertObjecToBigInteger;
import static org.cardanofoundation.ledgersync.service.impl.genesis.GenesisDataServiceImpl.convertObjecToBigInteger;

@UtilityClass
public class CostModelConverter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.dto;
package org.cardanofoundation.ledgersync.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.cardanofoundation.ledgersync.explorerconsumer.dto;
package org.cardanofoundation.ledgersync.dto;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.experimental.FieldDefaults;
import org.cardanofoundation.explorer.consumercommon.entity.MaTxOut;
import org.cardanofoundation.explorer.consumercommon.entity.TxOut;
import org.cardanofoundation.ledgersync.consumercommon.entity.MaTxOut;
import org.cardanofoundation.ledgersync.consumercommon.entity.TxOut;
import org.springframework.util.CollectionUtils;

import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.cardanofoundation.ledgersync.explorerconsumer.dto;
package org.cardanofoundation.ledgersync.dto;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.cardanofoundation.explorer.consumercommon.entity.*;
import org.cardanofoundation.ledgersync.consumercommon.entity.*;

import java.sql.Timestamp;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.cardanofoundation.ledgersync.explorerconsumer.dto;
package org.cardanofoundation.ledgersync.dto;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.experimental.FieldDefaults;
import org.cardanofoundation.explorer.consumercommon.entity.MaTxOut;
import org.cardanofoundation.explorer.consumercommon.entity.TxOut;
import org.cardanofoundation.ledgersync.consumercommon.entity.MaTxOut;
import org.cardanofoundation.ledgersync.consumercommon.entity.TxOut;
import org.springframework.util.MultiValueMap;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.dto.cache;
package org.cardanofoundation.ledgersync.dto.cache;

import lombok.*;
import lombok.experimental.FieldDefaults;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.dto.cache;
package org.cardanofoundation.ledgersync.dto.cache;

import lombok.*;
import lombok.experimental.FieldDefaults;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.cardanofoundation.ledgersync.dto.healthcheck;

import lombok.*;

import java.time.LocalDateTime;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class HealthStatus {
Boolean isHealthy;
String messageCode;
String messageDesc;
LocalDateTime latestBlockInsertTime;
Boolean hasStopSlot;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.cardanofoundation.ledgersync.dto.healthcheck;

import lombok.Getter;

@Getter
public enum Message {
READY_TO_SERVE("READY_TO_SERVE", "Data is ready to serve"),
IS_NOT_SYNCING("IS_NOT_SYNCING", "Connection to node is not healthy, data is not being synchronized"),
SYNCING_BUT_NOT_READY("SYNCING_BUT_NOT_READY", "Data is being synchronized, but it isn't ready to serve yet"),
CONNECTION_HEALTHY_BUT_BLOCK_CONSUMING_NOT_HEALTHY("CONNECTION_HEALTHY_BUT_BLOCK_CONSUMING_NOT_HEALTHY",
"Connection to node is healthy, but the latest block insertion time has exceeded the threshold"),
SYNCING_HAS_FINISHED("SYNCING_HAS_FINISHED",
"Connection to node is healthy, but the latest block insertion time has exceeded the threshold");

private final String code;
private final String desc;

Message(String code, String desc) {
this.code = code;
this.desc = desc;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cardanofoundation.ledgersync.explorerconsumer.exception;
package org.cardanofoundation.ledgersync.exception;

public class HashScriptException extends RuntimeException {
public HashScriptException(Exception e) {
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5b2da38

Please sign in to comment.