Skip to content

Commit

Permalink
feat: tx submitter with initial FRED API3 - Reports Support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Czeladka authored and matiwinnetou committed Nov 12, 2024
1 parent b0ac608 commit cb3c574
Show file tree
Hide file tree
Showing 39 changed files with 1,386 additions and 0 deletions.
11 changes: 11 additions & 0 deletions _backend-services/cf-lob-tx-submitter/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ORGANISER_MNEMONIC_PHRASE="test test test test test test test test test test test test test test test test test test test test test test test sauce"
BLOCKFOST_URL=https://cardano-mainnet.blockfrost.io/api/v1/
BLOCKFROST_PASSWORD=
TX_SUBMIT_URL=https://submit-api.pro.dandelion-preprod.eu-west-1.metadata.dev.cf-deployments.org/api/submit/tx

## Assuming `data` is a serialized transaction on the file-system.
#curl "https://cardano-mainnet.blockfrost.io/api/v0/tx/submit" \
# -X POST \
# -H "Content-Type: application/cbor" \
# -H "project_id: $PROJECT_ID" \
# --data-binary @./data
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="CFLOBTxSubmitter (PRE-PROD)" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.cardano.foundation.lob.CFLOBTxSubmitter" />
<module name="voting-admin-app.main" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.cardano.foundation.lob.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="software.aws.toolkits.jetbrains.core.execution.JavaAwsConnectionExtension">
<option name="credential" />
<option name="region" />
<option name="useCurrentConnection" value="false" />
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="CFLOBTxSubmitter (PROD)" type="Application" factoryName="Application">
<envs>
<env name="SPRING_CONFIG_LOCATION" value="classpath:/application.properties,classpath:/application-prod.properties" />
<env name="SPRING_PROFILES_ACTIVE" value="prod" />
</envs>
<option name="MAIN_CLASS_NAME" value="org.cardano.foundation.lob.CFLOBTxSubmitter" />
<module name="voting-admin-app.main" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.cardano.foundation.lob.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="software.aws.toolkits.jetbrains.core.execution.JavaAwsConnectionExtension">
<option name="credential" />
<option name="region" />
<option name="useCurrentConnection" value="false" />
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="VotingAppAdminService (YACI_DEV_NET)" type="Application" factoryName="Application">
<envs>
<env name="SPRING_CONFIG_LOCATION" value="classpath:/application.properties,classpath:/application-dev--yaci-dev-kit.properties" />
<env name="SPRING_PROFILES_ACTIVE" value="dev--yaci-dev-kit" />
</envs>
<option name="MAIN_CLASS_NAME" value="org.cardano.foundation.lob.CFLOBTxSubmitter" />
<module name="voting-admin-app.main" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.cardano.foundation.lob.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="software.aws.toolkits.jetbrains.core.execution.JavaAwsConnectionExtension">
<option name="credential" />
<option name="region" />
<option name="useCurrentConnection" value="false" />
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
9 changes: 9 additions & 0 deletions _backend-services/cf-lob-tx-submitter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM openjdk:20-jdk-slim AS build
WORKDIR /app
COPY . /app
RUN ./gradlew clean build

FROM openjdk:20-jdk-slim AS runtime
WORKDIR /app
COPY --from=build /app/build/libs/*SNAPSHOT.jar /app/app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
Empty file.
57 changes: 57 additions & 0 deletions _backend-services/cf-lob-tx-submitter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
plugins {
java
id("io.spring.dependency-management") version "1.1.3"
id("org.graalvm.buildtools.native") version "0.9.27"
id("com.github.ben-manes.versions") version "0.48.0"
id("org.springframework.boot") version "3.1.2"
}

group = "org.cardano.foundation"
version = "1.0.0-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_21

configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}

repositories {
mavenCentral()
maven { url = uri("https://repo.spring.io/milestone") }
}

extra["springShellVersion"] = "3.1.2"

dependencies {
implementation("org.springframework.shell:spring-shell-starter")
testImplementation("org.springframework.boot:spring-boot-starter-test")

compileOnly("org.projectlombok:lombok:1.18.30")
annotationProcessor("org.projectlombok:lombok:1.18.30")

testCompileOnly("org.projectlombok:lombok:1.18.30")
testAnnotationProcessor("org.projectlombok:lombok:1.18.30")

implementation("com.bloxbean.cardano:cardano-client-crypto:0.5.1") // 0.6.2
implementation("com.bloxbean.cardano:cardano-client-address:0.5.1")
implementation("com.bloxbean.cardano:cardano-client-metadata:0.5.1")
implementation("com.bloxbean.cardano:cardano-client-quicktx:0.5.1")
implementation("com.bloxbean.cardano:cardano-client-backend-blockfrost:0.5.1")

implementation("com.google.crypto.tink:tink:1.10.0")

implementation("io.blockfrost:blockfrost-java:0.1.3")

implementation("me.paulschwarz:spring-dotenv:4.0.0")
}

dependencyManagement {
imports {
mavenBom("org.springframework.shell:spring-shell-dependencies:${property("springShellVersion")}")
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit cb3c574

Please sign in to comment.