Skip to content

0L-Analytics/ol-intelligence-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ol-intelligence-server

Providing answers with on-chain and off-chain data.

Prerequisites

Before running the ol-intelligence-server, make sure:

Running the ol-intelligence-server (Linux)

  1. Clone the repository
git clone https://github.com/0L-Analytics/ol-intelligence-server.git
  1. Navigate to the path that contains the docker-compose.yml file
cd /path/to/yml/directory
  1. For Ubuntu/Debian execute run.dev.sh. Service names as they defined in docker-compose.yml can be specified after the database backup filename, but this is optional.
sh run.dev.sh dump_all_121222.gz crawler client api
  1. Test the api at localhost:5004/ping
  2. Test the app at localhost:3007
  3. Test the tools at localhost:5005/ping

Useful docker commands

First build and then run all services defined in docker-compose.yml in background

docker compose up -d --build

Enter the db container to make queries directly on db:

docker exec -it ol-intel-db /bin/bash
/ # su postgres
/ $ psql "<entire content of DATABASE_URL variable in .env file>"
viz_dev=# select count(*) from paymentevent;
...
viz_dev=# select tx->'script'->>'function_name' from accounttransaction where address <> 'C906F67F626683B77145D1F20C1A753B';
...
viz_dev=# exit
/ $ exit
/ # exit

Get logs from a container

docker logs ol-intel-crawler

Get running containers

docker ps -a

Shut down comtainers and remove volumes (e.g. remove db)

docker compose down -v

Force remove a comtainers

docker rm -f ol-intel-crawler

TODOS

Apply a design like https://vikdiesel.github.io/admin-one-bulma-dashboard/ See issues on github Define branch naming conventions Optimize tools container (or merge with crawler or api)

Branch naming conventions

Two branches are pretty standard and self explanatory, dev and main. Development is never done directly on these two branches. Work branches are merged to dev branch. Testing is done on dev branch and only from dev branch it is allowed to push to main branch.