Skip to content

syntifi/ori

Repository files navigation

Java CI Project license

ORI (Onchain Risk Intelligence)

ORI (On-chain Risk Intelligence tool) in an open-source project available under Apache 2 license. It provides the tools and functionalities to analyse and assess risk on transactions happening on public chains. The project is divided into several submodules that implement the different pieces needed for such an analysis:

  • tt begins with a crawler engine, that crawls the blockchains and stores the relevant data in an indexed DB
  • followed by an API, that provides access to the services to trace the coin the risk metrics of an account
  • as well as a front-end, and a dashboard providing graphical capabilities to analyse the data.

In the sections that follow it is possible to find more information about each module, build instructions, and the guidelines to contribute.

Content

Dependencies

Modules

Build instructions

NOTE: After building, the database is empty. Please follow the steps listed on After build instructions to populate the database.

The project is divided into several modules with some interdependency. For this reason one must first install before running it in dev mode:

./mvnw clean install 

Running the application in dev mode

NOTE: Please run the following docker container to run a Postgresql instance used in dev mode:

docker run -d --name postgresql_ori_db --ulimit memlock=-1:-1 -it --memory-swappiness=0 -e POSTGRES_USER=ori_db_user -e POSTGRES_PASSWORD=ori_db_pwd -e POSTGRES_DB=ori_db -p 5432:5432 postgres:13.1

After the packaging and test run you can run the application in dev mode that enables live coding using:

./mvnw quarkus:dev -pl ori-api/

Packaging and running the application

The application can be packaged using:

./mvnw package

It produces the quarkus-run.jar file in the ori-api/target/quarkus-app/ directory. Be aware that it’s not an über-jar as the dependencies are copied into the ori-api/target/quarkus-app/lib/ directory.

If you want to build an über-jar, execute the following command:

./mvnw package -Dquarkus.package.type=uber-jar

The application is now runnable using java -jar ori-api/target/quarkus-app/quarkus-run.jar.

Creating a native executable

You can create a native executable using:

./mvnw package -Pnative

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:

./mvnw package -Pnative -Dquarkus.native.container-build=true

You can then execute your native executable with: ./ori-api/target/ori-api-0.2.0-SNAPSHOT-runner.

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html.

Building and running Docker images

Instructions to build and run docker images are available at Docker.

After build instructions

At this point the system is build and running. The database is empty however. One must crawl the blockchains to properly populate the database.

Crawling the chains

The module ori-chains implements the batch jobs to crawl a specific chain and populate the DB. Find out more about it at Crawlers.

Features