-
Notifications
You must be signed in to change notification settings - Fork 0
Running Pencroff
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
The following need to be installed and configured properly so Pencroff works:
sbt
Docker
docker-compose
iptables
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:
- Clone the project to your machine.
- 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 usingiptables
. Replace these commands with your favorite FW manager if so required. - Run
start.sh
to start kudu. - Open
<root>/ingestor/src/main/resources/reference.conf
in an editor. Set thehost
,port
andprotocol
config items to point to a tezos node of your choice. Edit nothing else. -
cd
into<root>/ingestor
and runsbt 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. - 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 totezos
. - Open postman, run the following queries
localhost:8080/tezos/chains/main/blocks/0
andlocalhost: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.
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.