Skip to content

Running Pencroff

Pratham Rawat edited this page Mar 22, 2021 · 1 revision

Running Pencroff

System Requirements

Pencroff is officially supported on Ubuntu, but should also work with other *nix systems.

In order to run effectively, your machine should have:

  • 8GB RAM
  • A sizeable (preferably solid state) disk
  • 4 Processor Cores

Prerequisistes

The following need to be installed and configured properly so Pencroff works:

  • sbt
  • Docker
  • docker-compose
  • iptables

Starting Pencroff

Pencroff consists of two processes, the BlockIngestor which reads stores queries block by block, and the DataServer which responds to HTTP queries.

To start these processes:

  1. Clone the project to your machine.
  2. Go to docker/kudu and edit the two shell scripts. Set your machine's local ip (The one assigned by your router) there. start.sh opens ports in the firewall that are required for database start up using iptables. Replace these commands with your favorite FW manager if so required.
  3. Run start.sh to start kudu.
  4. Open <root>/ingestor/src/main/resources/reference.conf in an editor. Set the host, port and protocol config items to point to a tezos node of your choice. Edit nothing else.
  5. cd into <root>/ingestor and run sbt runMain tech.cryptonomic.BlockIngestor.scala. It should automatically create the necessary tables and start ingesting data from the node you specified in the previous step.
  6. After some blocks have been ingested, run sbt runMain tech.cryptonomic.DataServer.scala. This runs a HTTP server that mimics the node's api. Note that all urls to this have a prefix to them, currently hard coded to tezos.
  7. Open postman, run the following queries localhost:8080/tezos/chains/main/blocks/0 and localhost:8080/tezos/chains/main/blocks/BLockGenesisGenesisGenesisGenesisGenesisd6f5afWyME7. You should see identical output from these. Compare to the output from your configured tezos node. If everything matches you are good to start developing.

See ingestor/src/main/resources/tezos.json for the model that the Ingestor is using to fetch data. This can be edited to add different API calls to be replicated.

Configuring Conseil to work with Pencroff

Pencroff is configured out of the box to work with Cryptonomic's own block indexer and query tool, Conseil. This means that it includes all of the queries that Conseil needs to fully synchronize its database.

In order to make Conseil work, follow the instructions here to build it, and then here to properly configure it.

In the platforms section of the config file, change the path-prefix value to tezos/. This will add the URL prefix mentioned above to Conseil to allow it to properly access API Endpoints.

Instead of pointing Conseil to a Tezos Node, point it to the running instance of Pencroff by changing the protocol , hostname, and port configuration details.