Setup The Blockchain Database
Posted By : Ankit Rai | 13-Jan-2021
BigchainDB — The Blockchain Database
BigchainDB is a scalable and distributed database for Blockchain. Bigchain DB enables enterprises to deploy applications with Blockchain and Proof-of-Concept.
The combination of NoSQL database with Blockchain DB is one of its primary benefits. In BigchainDB, Data is represented as an “asset”. Any physical or digital object structured as JSON and key-values can be an "asset" or data in BigchainDB.
Let us have a look at the list of components that are required to set up Blockchain DB
MongoDB is the distributed database that will possess the Bigchaindb as a collection. You can run it on localhost or add an IP in the MongoDB config file to run it on a particular host IP.
Tendermint contains a genesis.json file. This file has the id and key pair for all the members on the network. To create a peer-to-peer connection, a minimum of 4 nodes are a must.
The setup can be performed using docker-all-one install
- docker pull bigchaindb/bigchaindb:all-in-one
- docker run \
--name bigchaindb \
--publish 9984:9984 \
--publish 9985:9985 \
--publish 27017:27017 \
--publish 26657:26657 \
--volume $HOME/bigchaindb_docker/mongodb/data/db:/data/db \
--volume $HOME/bigchaindb_docker/mongodb/data/configdb:/data/configdb \
--volume $HOME/bigchaindb_docker/tendermint:/tendermint \
After proper configuration and start of the setup, we need to examine the DB:
On CLI, run command “mongo”
- root@2de56a6c3953:/# mongo
MongoDB shell version v3.6.17
- show dbs
- use bigchain
switched to DB bigchain
- show collections
Post setup, any transaction we perform at any time will be reflected in bigchain DB under assets, blocks, metadata, and transactions collections.
Choose Oodles For SaaS App Development Services
We are a 360-degree software development company that provides cross-platform SaaS app development services to address varied software project requirements. We have an experienced team of Java, PHP, and Python developers who use advanced frameworks, tools, and SDKs to build scalable web and mobile applications with custom features. For more detail, reach us out at email@example.com.