mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-02-12 14:05:14 -05:00
Provide a working end-to-end example of syncing data from hubs to a Postgres database. This should work with no additional dependencies besides what you install with `yarn install` and Docker.
18 lines
805 B
Markdown
18 lines
805 B
Markdown
## Replicate hub data into Postgres
|
|
|
|
This example shows you how you can quickly start ingesting data from a Farcaster hub into a traditional database like Postgres.
|
|
|
|
### Run on StackBlitz
|
|
|
|
[](https://stackblitz.com/github/farcasterxyz/hubble/tree/main/packages/hub-nodejs/examples/replicate-data-postgres)
|
|
|
|
### Run locally
|
|
|
|
1. Clone the repo locally
|
|
2. Navigate to this folder with `cd packages/hub-nodejs/examples/replicate-data-postgres`
|
|
3. Run `yarn install` to install dependencies
|
|
4. Run `docker compose up -d` to start a Postgres instance ([install Docker](https://docs.docker.com/get-docker/) if you do not yet have it)
|
|
5. Run `yarn start`
|
|
|
|
To wipe your local data, run `docker compose down -v` from this directory.
|