Giter Site home page Giter Site logo

cardano-foundation / cf-ledger-consumer-schedules Goto Github PK

View Code? Open in Web Editor NEW
3.0 12.0 1.0 44 MB

This repository executes tasks in a periodic sequence to precompute computationally intensive jobs within the scope of the explorer project

Home Page: https://cardano-foundation.github.io/cf-ledger-consumer-schedules/

License: Apache License 2.0

Java 99.50% Dockerfile 0.13% Makefile 0.04% Smarty 0.28% PLpgSQL 0.06%
aggregations cardano explorer java scheduled-tasks

cf-ledger-consumer-schedules's Introduction

Explorer Scheduled Jobs

Tests Coverage Release Publish conventionalcommits FOSSA Status

This repository executes tasks in a periodic sequence to precompute computationally intensive jobs.

๐Ÿ‘‰ Check the Explorer repository to understand how the microservices work together

How to run

Following prerequisites are required to run the application:

  • Java 17
  • Redis
  • Postgres (ledger-sync and explorer database)
  • Ledger-sync (Ledgersync + Aggregate app + Postgres)

An example docker-compose script is provided in the example-infra directory. (This script only sets up Redis and Postgres, for a ledger-sync setup, please refer to the ledger-sync repository)

This can be used right away with the provided .env.example and adjusted as needed.

To start the needed Infrastructure, run:

# Start Redis and Postgres
docker-compose -f example-infra/docker-compose.yml up
# Additionally start Ledger Sync according to the docs in the ledger-sync repository 

To run the application via command line:

# Copy the .env.example to .env and adjust as needed
cp .env.example .env
# Build the application
source .env
mvn clean package
mvn spring-boot:run

๐Ÿงช Test Reports

To ensure the stability and reliability of this project, unit and mutation tests have been implemented. By clicking on the links below, you can access the detailed test reports and review the outcomes of the tests performed.

๐Ÿ“Š Mutation report

๐ŸŒฑ Environment Variables
  • LEDGER_SYNC_HOST: Ledger-sync database host.

  • LEDGER_SYNC_PORT: Ledger-sync database port

  • LEDGER_SYNC_USER: Ledger-sync database username

  • LEDGER_SYNC_PASSWORD: Ledger-sync database password

  • LEDGER_SYNC_DB: Ledger-sync database name

  • LEDGER_SYNC_SCHEMA: Ledger-sync database schema

  • LEDGER_SYNC_FLYWAY_ENABLE: Ledger-sync Migrate schema, set true if this is the first time run app

  • LEDGER_SYNC_AGG_HOST= Ledger-sync aggregate database host.

  • LEDGER_SYNC_AGG_PORT= Ledger-sync aggregate database port

  • LEDGER_SYNC_AGG_USER= Ledger-sync aggregate database username

  • LEDGER_SYNC_AGG_PASSWORD= Ledger-sync aggregate database password

  • LEDGER_SYNC_AGG_DB= Ledger-sync aggregate database name

  • LEDGER_SYNC_AGG_SCHEMA= Ledger-sync aggregate database schema

  • LEDGER_SYNC_AGG_FLYWAY_ENABLE= Ledger-sync aggregate Migrate schema, set true if this is the first time run app

  • EXPLORER_HOST: Explorer database host.

  • EXPLORER_PORT: Explorer database port

  • EXPLORER_USER: Explorer database username

  • EXPLORER_PASSWORD: Explorer database password

  • EXPLORER_DB: Explorer database name

  • EXPLORER_SCHEMA: Explorer database schema

  • EXPLORER_FLYWAY_ENABLE: Explorer Migrate schema, set true if this is the first time run app

  • MAXIMUM_POOL_SIZE: Schedule will have job select parallel from database. If you want to task schedule as fast as possible set the MAXIMUM_POOL_SIZE as much as possible (cpu core * 4). This will reduce another app performance.

  • REPORT_HISTORY_JOB_ENABLED: enable a report history job to delete expired file. Default true

  • SET_EXPIRED_REPORTS_DELAY: delay time between each report history job run. Default 86400000 as 1 day

  • LIMIT_CONTENT_PER_SHEET: limit content per sheet of export file, default 1000000

  • API_CHECK_REWARD_URL: api url to fetch reward

  • API_CHECK_POOL_HISTORY_URL: api url to fetch pool history

  • NETWORK_NAME: cardano node network name (preprod, testnet, mainnet)

  • REPORT_S3_ACCESS_KEY: report aws s3 access key

  • REPORT_S3_SECRET_KEY: report aws s3 secret key

  • REPORT_S3_REGION: report aws s3 region

  • REPORT_S3_BUCKET_NAME: report aws s3 bucket name

  • REPORT_S3_STORAGE_ENDPOINT: report aws s3 storage endpoint

  • TOKEN_LOGO_S3_ACCESS_KEY: token logo aws s3 access key

  • TOKEN_LOGO_S3_SECRET_KEY: token logo aws s3 secret key

  • TOKEN_LOGO_S3_REGION: token logo aws s3 region

  • TOKEN_LOGO_S3_BUCKET_NAME: token logo aws s3 bucket name

  • TOKEN_LOGO_S3_STORAGE_ENDPOINT: token logo aws s3 storage endpoint

  • SPRING_PROFILES_ACTIVE: active profiles

  • LOG: application log level

  • META_DATA_JOB_ENABLED: enable metadata job

  • TOKEN_METADATA_URL: url that store token

  • TOKEN_METADATA_FOLDER: store token

  • REDIS_SENTINEL_PASSWORD : Redis sentinel password. Default is redis_sentinel_pass.

  • REDIS_SENTINEL_HOST : Redis sentinel host. Default is cardano.redis.sentinel.

  • REDIS_SENTINEL_PORT : Redis sentinel port. Default is 26379.

  • REDIS_SENTINEL_MASTER_NAME : Redis master name. Default is mymaster.

  • POOL_STATUS_FIXED_DELAY: delay time between each time get pool status

  • NUMBER_DELEGATOR_FIXED_DELAY: delay time between each time get number delegator

  • UNIQUE_ACCOUNT_FIXED_DELAY: fixed delay for job build cache unique account

  • UNIQUE_ACCOUNT_ENABLED: enable unique account job

  • STAKE_TX_BALANCE_JOB_ENABLED: enable stake tx balance job

  • STAKE_TX_BALANCE_FIXED_DELAY: fixed delay for job stake tx balance

  • TOKEN_INFO_JOB_ENABLED: enable token info job

  • TOKEN_INFO_FIXED_DELAY: delay time between each time run token info job

  • AGGREGATE_POOL_INFO_FIXED_DELAY: fixed delay for job aggregate pool info

  • SMART_CONTRACT_INFO_FIXED_DELAY: fixed delay for job smart contract info

  • NATIVE_SCRIPT_INFO_FIXED_DELAY: fixed delay for job native script info

  • DREP_INFO_JOB_ENABLED: enable drep info job

  • DREP_INFO_FIXED_DELAY: fixed delay for job drep info

  • GOVERNANCE_INFO_JOB_ENABLED: enable governance info job

  • GOVERNANCE_INFO_FIXED_DELAY: fixed delay for job governance info

  • AGG_ANALYTIC_FIXED_DELAY: fixed delay for job aggregate analytic that related to address and token

cf-ledger-consumer-schedules's People

Contributors

fabianbormann avatar github-actions[bot] avatar hiiamtrong avatar kammerlo avatar m4rc0russ0 avatar nemo83 avatar rcmorano avatar sotatek-ducphung avatar sotatek-huyle3 avatar sotatek-namnguyen15 avatar sotatek-sonvu3 avatar sotatek-thinhvu avatar sotatek-tiendo avatar sotatek-trongvu avatar tungnguyendinh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sotatek-quanlea

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.