Running ProvenDB with Docker-Compose

Michael Harrison
ProvenDB
Published in
4 min readDec 19, 2019

--

ProvenDB is the worlds first genuinely trustable database. By bridging the gap between database and Blockchain, it allows users data Immutability, Tamper Detection and Point-in-time History.

Marketing talk aside, ProvenDB is a database service that has the look and feel of MongoDB, but with extra functions and features added allowing you to create a digital fingerprint of your data and anchor it on the Blockchain. At a later date, you can verify this digital fingerprint existed, providing proof for you (and other stakeholders) that you owned that data at a given time, and that no tampering has occurred in the meantime.

This is particularly useful for any use-case where the integrity and provenance of your data are critical or must be proven to the third party without relying too much on trust.

The easiest way to use ProvenDB is as a Cloud Service with interfaces for creating and connecting to your Database. However, for one reason or another, you may not wish to use a Cloud Service, or you may want to investigate the possibility of an On-Premise deployment of ProvenDB for your Blockchain project. In this post, I’ll be demonstrating how you may run ProvenDB using Docker-Compose on your local machine.

Prerequisites

  • You will need to have git installed, either as a command line or using an application like GitKraken.
  • You will need to have Docker installed with a version supporting docker-compose.

Getting Started

  1. Clone the Repository.
git clone https://github.com/SouthbankSoftware/provendb-docker-compose.git

2. Navigate to the root directory of the repository.

cd provendb-docker-compose

3. Ensure Docker images are up to date (run this regularly to get the latest features and bug fixes.)

docker-compose pull

4. Run the Docker containers.

# On Unix operating systems:docker-compose pull && docker-compose -f docker-compose.yml -f docker-compose.standalone.yml up --build -d# On Windows operating systems:
sed -i 's/\r$//' scripts/*/*.sh && docker-compose pull && docker-compose -f docker-compose.yml -f docker-compose.standalone.yml up --build -d

5. Check container status

docker ps

6. Connect to ProvenDB

mongo mongodb://pdbuser:click123@localhost:27018/provendb

7. Add some data to the database.

We can use standard MongoDB syntax to add a document into the database.

db.insertOne({ hello: 'world' });

8. Put that data on the blockchain.

The only required parameter for creating a Blockchain proof is what version of the database should be used. This is because ProvenDB maintains the history of your database over many versions. To find out what version we are using we can use the getVersion command

db.runCommand({getVersion: 1})

We can see here my database is on version 4, but let’s create a proof for version 2.

db.runCommand({submitProof: 2})

Done! The data from your local MongoDB database has been submitted to the Blockchain using ProvenDB. To learn more about creating Proofs, you can read the documentation.

Next Steps

  • Customise your configuration by modifying the env/creds-standalone/provendb.env file.
  • Complete the database tutorial here.
  • If you run into any problems, there are additional troubleshooting steps in the git repository.
  • There is also a video available here showing the process start to finish:

We would love to hear about any features or improvements you would like to ProvenDB, and we’re always interested to hear what amazing new applications are being built using Blockchain technology. Feel free to comment below, or send us an email at support@provendb.com to tell us about your project. Thanks for reading!

ProvenDB integrates MongoDB with the Bitcoin Blockchain. Immutable versions of database state are anchored to the Blockchain, delivering an unparalleled level of data integrity. ProvenDB allows MongoDB developers to build high-performance applications that include cryptographic proof of data integrity and provenance without having to understand blockchain programming complexities.

Sign up at provendb.com

--

--