Persistence Initialization

This page describes available persistence stores and how to configure the Connector to operate using them.

Overview

This implementation classifies persistence data into two broad categories: data collected during performance-sensitive operations, and all other data.

Data collected during performance-sensitive operations is limited to the data required to facilitate the ILPv4 packet flow. In general, this type of data is limited to balance tracking information, and this implementation supports both Redis and Postgres for this use-case.

All other data, such as non-balance account configuration, runtime configuration, and more is stored into one of several supported RDBMS datastores. This implementation currently supports Posgresql, MS-SQL, MySQL, and Oracle.

This page details how to initialize a given persistence store for usage by the Connector. To set connection details and other runtime configuration properties, see here instead.

Postgresql

This section details how to use Postgresql as the underlying Connector datastore.

This section assumes that you have created a database named connectorinside of your Postgres installation. Note that this naming is used as an example only -- you can choose any database name.

Generate DDL

To generate the DDL for the Connector database, execute the following commands:

mvn -DskipTests clean package -P liquibase-pg-sql liquibase:updateSQL

This will emit a file /target/liquibase/migrate.sql that can be used to populate your database.

Direct Initialization via Maven

As an alternative during development, you can utilize the liquibase-maven-plugin to directly connect to Postgres and initialize the database for you.

However, for this to work, you first need to update the pom.xml file in the ilpv4-connector-persistence module to conform to your connection parameters by setting the configuration.url to a value for your environment, like this:

ilpv4-connector-persistence/pom.xml
...
<profiles>
    <profile>
      <id>liquibase-pg-sql</id>
      ...
        <configuration>
          <url>jdbc:postgresql://localhost:5432/connector</url>
        </configuration>        
      ...
</profiles>

Once the liquibase-maven-plugin is configured properly, the following commands will update the database directly:

cd ./java-ilpv4-connector/ilpv4-connector-persistence
mvn -DskipTests clean package -P liquibase-pg-sql liquibase:update

If you want to reinitialize the database, for example during development, the following commands can be used:

mvn -DskipTests clean package -P liquibase-pg-sql liquibase:dropAll
mvn -DskipTests clean package -P liquibase-pg-sql liquibase:update

Oracle

Coming soon.

MySQL

Coming soon.

MS-SQL

Coming soon.

Redis

Redis is only used for balance tracking, so outside of configuring runtime configuration properties, no further initialization is required.

Last updated