This project sets up an Ethereum ETL with all its dependecies and constantly fetch data from blockchain and push them to a connected postgres
database.
It uses Dokcer for containerization and docker-compose to manage the service.
First of all, make sure postgres
server is already installed and is accessible. Secondly, you have Docker and docker-compose installed on your system. Then follow the following steps:
- Create an empty database in the
postgres
- Clone or download this repository to the local system
cd
to clone/downloaded repository- run
git submodule update --init --recursive
- open the
.env
file and update the database credentials - run
chmod +x ./setup.sh
- run
./setup.sh
in this repository- Note: this command will create essential tables and indices in the database
- if you have tables and indices already created then skip this step
- open the
.env
file again and update theprovider_uri
variable- currently it is set to
https://mainnet.infura.io/v3/6a3f7fe0b96044b5ae8a3cbaf22920c3
. If you are also using Infura then update the project id in the url. - there are other variables in the
.env
file to tune the streaming process
- currently it is set to
- Finally run
docker-compose up -d
-d
flag is used to run the etl service in detached mode (i.e in the background).- if you want an interactive mode omit this
-d
flag from the command - if you are in detached mode and want to know what is happening then run
docker-compose logs
- That's it!!!!