Determine the BigchainDB Root URL¶
If you want to use the BigchainDB Python Driver to communicate with a BigchainDB node or cluster, then you will need its BigchainDB Root URL. This page is to help you determine it.
Case 1: BigchainDB on localhost¶
If a BigchainDB node is running locally
BIGCHAINDB_SERVER_BIND setting wasn’t changed
from the default
then the BigchainDB Root URL is:
bdb_root_url = 'http://localhost:9984'
Case 2: A Cluster Hosted by Someone Else¶
If you’re connecting to a BigchainDB cluster hosted by someone else, then they’ll tell you their BigchaindB Root URL. It can take many forms. It can use HTTP or HTTPS. It can use a hostname or an IP address. The port might not be 9984. Here are some examples:
bdb_root_url = 'http://example.com:9984' bdb_root_url = 'http://api.example.com:9984' bdb_root_url = 'http://example.com:1234' bdb_root_url = 'http://example.com' # http is port 80 by default bdb_root_url = 'https://example.com' # https is port 443 by default bdb_root_url = 'http://184.108.40.206:9984' bdb_root_url = 'http://220.127.116.11:5000'
Case 3: Docker Container on localhost¶
If you are running the Docker-based dev setup that comes along with the
bigchaindb_driver repository (see Development Environment with Docker for more
information), and wish to connect to it from the
(container) service, use:
bdb_root_url = 'http://bdb-server:9984'
Alternatively, you may connect to the containerized BigchainDB node from “outside”, in which case you need to know the port binding:
$ docker-compose port bigchaindb 9984 0.0.0.0:32780
or you can use the command specified in the Makefile:
$ make root-url 0.0.0.0:32780
bdb_root_url = 'http://0.0.0.0:32780'
Next, try some of the basic usage examples.