https://github.com/consensysmesh/bentobox
Asks an ethereum node for its contents (block, tx, logs, topics) dump them into a PSQL
https://github.com/consensysmesh/bentobox
Last synced: about 1 year ago
JSON representation
Asks an ethereum node for its contents (block, tx, logs, topics) dump them into a PSQL
- Host: GitHub
- URL: https://github.com/consensysmesh/bentobox
- Owner: ConsenSysMesh
- Created: 2016-12-27T00:57:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-04T05:57:57.000Z (over 9 years ago)
- Last Synced: 2025-06-21T13:02:22.716Z (about 1 year ago)
- Language: Go
- Size: 139 KB
- Stars: 9
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Event Crawler
It reads the JSON RPC API of an ethereum node and dumps its results into
a PSQL database.
### Run a PSQL database using docker
Just use the command
```
make run-psql
```
Will mount the dir `$HOME/.psql` and have a DB for you.
You need to setup your database if it is the first time using it.
Use the instructions below.
### Setup the database
You can have your database already, or you can use docker as above.
This script will set you up with your database.
Get in a console able to use `psql` and Run
```
psql -U postgres
```
*TIP*: If you are running PSQL with docker,
to access bash inside the container do
```
docker exec -ti /bin/bash
```
Once inside you create your database with
```
CREATE DATABASE bentobox;
\q
```
Now you need to restore the schema. Do from the comamnd line
```
psql -U postgres bentobox < database.sql
```
You are good to go.
### Retrieving program dependencies
```
make boostrap
```
### Compiling the program
```
make crawler
```
Will put your program in `./build/bin/crawler`. This is compiled for debian
though. To run it...
### Running the program
```
make run-crawler
```
Which will run the program inside the dev container.
#### Adding arguments to the executable inside the container
To add arguments, do, for example
```
ARGS="--help" make run-crawler
```
### Herman, I want to compile and run the program without docker
Fine. Do,
```
glide install # You need to have glide (https://github.com/Masterminds/glide)
go build -o build/bin/crawler main.go
./build/bin/crawler
```