View Corda tables in H2 Database

Ashok JKannan
Apr 22, 2019 · 2 min read
Image result for corda h2

By default, Corda store their data in an H2 database.

The database (a file called persistence.mv.db) is created when the node first starts up.

Let’s take an example — https://github.com/corda/LetterOfCredit

We are not going to talk about the CORDA implementation here, we are going to see how the data has been stored by default.

LetterOfCredit application has few modules

Let’s take the Notary Pool and see how the data are in H2 (by default)

By default, it has an administrator user saand a blank password. The database password is required only when the H2 database is exposed on non-localhost address (which is disabled by default).

Lets say the application is deployed and is running in the portal.

Connecting using the H2 Console

  • Download the last stable h2 platform-independent zip, unzip the zip, and navigate in a terminal window to the unzipped folder
  • Change directories to the bin folder: cd h2/bin
  • Run the following command to open the h2 web console in a web browser tab:
  • Unix: sh h2.sh
  • Windows: h2.bat

Identify the persistence.mv.db file,

The command to start the H2 console,

java -jar h2–1.4.197.jar -webAllowOthers -tcpAllowOthers

Use the jdbc URL,

jdbc:h2:file:/home/corda/LetterOfCredit/kotlin-source/build/libs/build/20190416–114935.603/NotaryPool/persistence.mv.db

Once connected, the tables can be viewed,

That’s it.. Lets rock Blockchain Database guys!!!

Next article we can see about Nodes configured to use PostgreSQL.

beovolytics

Beovolytics integrates software assembly lines into large organizations by deploying solutions offered by the Cloud ecosystem.

Ashok JKannan

Written by

beovolytics

Beovolytics integrates software assembly lines into large organizations by deploying solutions offered by the Cloud ecosystem.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade