Skip to content

Running Conseil

Pratham Rawat edited this page Nov 13, 2020 · 28 revisions

Running Conseil

Conseil can either be run in a Docker container or as a JAR file using a Java runtime environment.

If you don't want to run your own Conseil instance and prefer an easy hosted solution, check out Nautilus Cloud.

Please visit the releases page and use a git tag corresponding to a release of your choice. It is advisable to always use the latest release as blockchain protocols keep changing.

Conseil needs access to a Postgres database that is set up with the right schema. To view a SQL file with the right schema, see the file sql/conseil.sql in the git branch or tag you are using.

Make sure that you apply the schema found in sql/conseil.sql to the database. Conseil won't work without it!

Conseil also needs access to a Tezos node to collect blockchain data. See instructions for Running Tezos for Lorre.

Synchronizing Lorre from scratch, i.e. downloading all the blockchain data into the database, can take a very long time. We therefore recommend using the database dumps we provide on the releases page. These dumps can be applied to your Postgres database using the pg_restore tool.

Run using Docker

Working docker-compose.yml file for running Conseil and Lorre from DockerHub can be found here:

https://github.com/Cryptonomic/Conseil/blob/master/docker/docker-compose.yml

Fetching an image from DockerHub

Conseil is available from dockerhub. This is the recommended option if you want to use an official release.

You can pull the latest docker image with:

docker pull cryptonomictech/conseil:latest

You can find available tags on our dockerhub page.

Building your own image

Alternatively, to build your own image, clone the Conseil git repo, switch to your desired tag or branch and run this command:

docker build -t conseil .

Running the Docker image

The container can be configured using the following environment variables:

Tezos Node Config:

  • CONSEIL_XTZ_NETWORK - default zeronet
  • CONSEIL_XTZ_ENABLED - default false
  • CONSEIL_XTZ_NODE_PROTOCOL - default https
  • CONSEIL_XTZ_NODE_HOSTNAME - default nautilus.cryptonomic.tech
  • CONSEIL_XTZ_NODE_PORT - default 8732
  • CONSEIL_XTZ_NODE_PATH_PREFIX - default tezos/zeronet/

Bitcoin Node Config:

  • CONSEIL_BTC_NETWORK - default mainnet
  • CONSEIL_BTC_ENABLED - default false
  • CONSEIL_BTC_NODE_PROTOCOL - default mainnet
  • CONSEIL_BTC_NODE_HOSTNAME - default localhost
  • CONSEIL_BTC_NODE_PORT - default 8332
  • CONSEIL_BTC_NODE_USERNAME - default bitcoin
  • CONSEIL_BTC_NODE_PASSWORD - default sP9PV88xtbGwLMAEi2rVlZ7jIFfJbpOmTUCsBBBRN9I=
  • CONSEIL_BTC_BATCHING_INDEXER_THREADS_COUNT - default 8
  • CONSEIL_BTC_BATCHING_HTTP_FETCH_THREADS_COUNT - default 8
  • CONSEIL_BTC_BATCHING_HASH_BATCH_SIZE - default 2000
  • CONSEIL_BTC_BATCHING_BLOCKS_BATCH_SIZE - default 500
  • CONSEIL_BTC_BATCHING_TRANSACTIONS_BATCH_SIZE - default 500

Ethereum Node Config:

  • CONSEIL_ETH_NETWORK - default mainnet
  • CONSEIL_ETH_ENABLED - default false
  • CONSEIL_ETH_NODE - default https://localhost:8332
  • CONSEIL_ETH_RETRY_MAX_WAIT - default 2s
  • CONSEIL_ETH_RETRY_MAX_RETRY - default 5
  • CONSEIL_ETH_BATCHING_INDEXER_THREADS_COUNT - default 8
  • CONSEIL_ETH_BATCHING_HTTP_FETCH_THREADS_COUNT - default 8
  • CONSEIL_ETH_BATCHING_BLOCKS_BATCH_SIZE - default 100
  • CONSEIL_ETH_BATCHING_TRANSACTIONS_BATCH_SIZE - default 100
  • CONSEIL_ETH_BATCHING_CONTRACTS_BATCH_SIZE - default 100
  • CONSEIL_ETH_BATCHING_TOKENS_BATCH_SIZE - default 100

Quorum Node Config:

  • CONSEIL_QUO_NETWORK - default mainnet
  • CONSEIL_QUO_ENABLED - default false
  • CONSEIL_QUO_NODE - default https://localhost:8332
  • CONSEIL_QUO_RETRY_MAX_WAIT - default 2s
  • CONSEIL_QUO_RETRY_MAX_RETRY - default 5
  • CONSEIL_QUO_BATCHING_INDEXER_THREADS_COUNT - default 8
  • CONSEIL_QUO_BATCHING_HTTP_FETCH_THREADS_COUNT - default 8
  • CONSEIL_QUO_BATCHING_BLOCKS_BATCH_SIZE - default 100
  • CONSEIL_QUO_BATCHING_TRANSACTIONS_BATCH_SIZE - default 100
  • CONSEIL_QUO_BATCHING_CONTRACTS_BATCH_SIZE - default 100
  • CONSEIL_QUO_BATCHING_TOKENS_BATCH_SIZE - default 100

Conseil Api db:

  • CONSEIL_API_DB_NAME - default conseil
  • CONSEIL_API_DB_USER - default foo
  • CONSEIL_API_DB_PASSWORD - default bar
  • CONSEIL_API_DB_URL - default jdbc:postgresql://localhost:5432/postgres

Conseil Api:

  • CONSEIL_API_HOSTNAME - default 0.0.0.0
  • CONSEIL_API_PORT - default 1337
  • CONSEIL_API_KEY - required
  • CONSEIL_API_ALLOW_BLANK_KEYS - default false

Conseil Lorre:

  • CONSEIL_LORRE_DB_NAME - default conseil
  • CONSEIL_LORRE_DB_USER - default foo
  • CONSEIL_LORRE_DB_PASSWORD - default bar
  • CONSEIL_LORRE_DB_URL - default jdbc:postgresql://localhost:5432/postgres

JVM Config:

  • JVM_XMX - recommended -Xmx4G

Or, you can use your own config file, in which case specify the environment variable CONFIG_PATH with the path to your file. See Configuring Conseil for details on building a config file.

To start the Lorre indexer run:

docker run conseil conseil-lorre

To start the Conseil API run:

docker run conseil conseil-api

To run container with environment variables stated before you can use -e parameter, for example:

docker run -e CONSEIL_XTZ_NODE_HOSTNAME=tezos.example.node.com -e CONSEIL_XTZ_NODE_PORT=443 conseil conseil-lorre 

Running a JAR file

Fetch a prebuilt JAR file

This is the recommended option if you simply want to run the latest release. Each release listed on GitHub has a JAR file attached which you can simply download.

Build your own JAR

Alternatively, you can build your JAR file by following the instructions on Building Conseil.

Run the JAR file

You will need to create a configuration file. See Configuring Conseil (latest release) or Configuring Conseil (master branch) for details.

To start the Lorre indexer:

java -Dconfig.file=conseil.conf -jar conseil-lorre.jar <platform> <network>

Lorre can also be configured further with the following command line args:

Usage: lorre [options] platform network

platform which platform to use network which network to use -h, --headHash <value> from which block to start. Default to actual head -d, --depth <value> how many blocks to synchronize starting with head: use -1 or allfor everything and 0 ornew to only get new ones) -v, --verbose print additional configuration info when the application is launched -h, --help prints this usage text

To start the Conseil API:

java -Dconfig.file=conseil.conf -jar conseil-api.jar

The Conseil API can also be configured further with the following command line args:

Usage: conseil-api [options]

-v, --verbose print additional configuration info when the application is launched -f, --fail-fast stops without retrying if the initialization process fails for any reason -h, --help prints this usage text