Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract balance for blockchains #76

Open
wants to merge 10 commits into
base: 2.x.x-REACTIVE
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/open-state-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Prepare Java SDK 11
- name: Prepare Java SDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Cache Gradle packages
uses: actions/cache@v2
Expand Down Expand Up @@ -81,10 +81,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Prepare Java SDK 11
- name: Prepare Java SDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Build project
run: ./gradlew assemble
Expand Down
56 changes: 41 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
plugins {
id 'jacoco'
id 'idea'
id 'org.jetbrains.kotlin.jvm' version '1.4.0'
id 'org.jetbrains.kotlin.plugin.spring' version '1.4.0'
id 'org.jetbrains.kotlin.kapt' version '1.4.0'
id 'org.springframework.boot' version '2.3.3.RELEASE'
id 'java'
id 'application'
id 'org.jetbrains.kotlin.jvm' version '1.9.21'
id 'org.jetbrains.kotlin.plugin.spring' version '1.9.21'
id 'org.jetbrains.kotlin.kapt' version '1.9.21'
id 'org.springframework.boot' version '2.7.18'
}

apply plugin: 'io.spring.dependency-management'

group = "io.openfuture"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_11
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
maven { url "https://jitpack.io" }
jcenter()
// maven {
// url "https://jitpack.io"
// }

maven {
url "https://dl.bintray.com/tronj/tronj"
}


}

dependencies {
// Lombok fix
implementation('org.projectlombok:lombok:1.18.22')
// Spring
implementation('org.springframework.boot:spring-boot-starter-webflux')
implementation('org.springframework.boot:spring-boot-starter-data-mongodb-reactive')
implementation('org.springframework.boot:spring-boot-starter-data-redis-reactive')
implementation('org.springframework.boot:spring-boot-starter-validation')
implementation('org.springframework.boot:spring-boot-starter-actuator')

// Kotlin
implementation('com.fasterxml.jackson.module:jackson-module-kotlin')
Expand All @@ -34,16 +49,23 @@ dependencies {
implementation('org.jetbrains.kotlinx:kotlinx-coroutines-jdk8')

// Ethereum
implementation('org.web3j:core:4.6.3')
implementation('com.squareup.okhttp3:okhttp:4.8.1')
implementation('org.web3j:core:4.12.0') {
exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on'
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
implementation('org.bouncycastle:bcprov-jdk18on:1.78.1')
implementation('com.squareup.okhttp3:okhttp:4.12.0')

// Binance
implementation('com.google.protobuf:protobuf-java:3.15.6')
implementation('com.github.binance-chain:java-sdk:v1.1.0-bscAlpha.0')
implementation('com.google.protobuf:protobuf-java:4.26.0')
//implementation('com.github.binance-chain:java-sdk:v1.1.0-bscAlpha.0')

// Utils
implementation('commons-validator:commons-validator:1.7')
implementation('org.apache.httpcomponents:httpclient:4.5.12')
implementation('commons-validator:commons-validator:1.9.0')
implementation('org.apache.httpcomponents:httpclient:4.5.13')

// Monitoring
implementation('io.micrometer:micrometer-registry-prometheus')

// DevTools
runtimeOnly('org.springframework.boot:spring-boot-devtools')
Expand All @@ -68,20 +90,24 @@ sourceSets {
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "11"
jvmTarget = JavaVersion.VERSION_17.toString()
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "11"
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

// Tests
test {
useJUnitPlatform()

testLogging {
showStandardStreams = true
}

if (project.hasProperty('maxParallelForks')) {
maxParallelForks = project.maxParallelForks as int
}
Expand All @@ -90,7 +116,7 @@ test {
}
}
jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.7"
}
jacocoTestReport {
reports {
Expand Down
24 changes: 24 additions & 0 deletions data/prometheus/config/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# my global config
global:
scrape_interval: 120s # By default, scrape targets every 15 seconds.
evaluation_interval: 120s # By default, scrape targets every 15 seconds.

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090', 'localhost:9100']

- job_name: 'Spring Boot Application input'
metrics_path: '/actuator/prometheus'
scrape_interval: 2s
static_configs:
- targets: ['localhost:8545']
labels:
application: "OPEN STATE"
42 changes: 42 additions & 0 deletions docker-compose-monitoring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
services:
prometheus:
image: prom/prometheus:latest
#network_mode: host
container_name: prometheus
restart: unless-stopped
volumes:
- ./data/prometheus/config:/etc/prometheus/
command:
- "--config.file=/etc/prometheus/prometheus.yaml"
ports:
- 9090:9090
# links:
# - node-exporter:node-exporter


# node-exporter:
# image: prom/node-exporter:latest
# network_mode: host
# container_name: monitoring_node_exporter
# restart: unless-stopped
# expose:
# - 9100

grafana:
image: grafana/grafana-oss:latest
pull_policy: always
#network_mode: host
container_name: grafana
restart: unless-stopped
user: root
ports:
- 3000:3000 # access grafana url
volumes:
- ./data/grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_DOMAIN=localhost
# Enabled for logging
- GF_LOG_MODE=console file
- GF_LOG_FILTERS=alerting.notifier.slack:debug alertmanager:debug ngalert:debug
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading