Providing answers with on-chain and off-chain data.
Before running the ol-intelligence-server, make sure:
- Docker is installed. (For Ubuntu: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)
- Consider making the post installation configuration for Linux users. (https://docs.docker.com/engine/install/linux-postinstall/)
- Clone the repository
git clone https://github.com/0L-Analytics/ol-intelligence-server.git
- Navigate to the path that contains the docker-compose.yml file
cd /path/to/yml/directory
- Run the following docker compose command:
docker compose up -d --build
If you have an older version of docker compose installed, you might need to add a hyphen between docker and compose like:
docker-compose up -d --build
- Create the user table and populate it with data:
docker compose exec api python manage.py recreate_db
docker compose exec api python manage.py seed_db
- Test the api at localhost:5004/ping
- Test the app at localhost:3007
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 compose exec -it db /bin/sh
/ # su postgres
/ $ plsql "<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 compose logs ol-intel-crawler
Get running containers
docker ps
Shut down comtainers and remove volumes (e.g. remove db)
docker compose down -v
See issues
Two branches are pretty standard and self explanatory, dev and main. Nobody develops directly on these two branches. dev branch is used to merge all work branches. Testing is done on dev branch and only from dev branch it is allowed to push to main branch.
Working branches are not pushed to Github, unless there is a very good reason for it. One good reason could be two competing technologies that might take each other over at one time in the future.