Dune-Sync v2

Aperta
#112 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
postgresql, python, sql
Ambito
backend, database

Direzione di ricerca

Inizia da src/sync/app_data.py e dal suo utilizzo esistente di upload_csv, quindi confronta questo flusso con lo schema TOML proposto per datasources e jobs. Il lavoro è completato quando sono supportati trasferimenti configurabili e indipendenti dal dominio in entrambe le direzioni tra Dune e un database locale, incluse le impostazioni indicate per query, destinazione, parametri, troncamento e privacy.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

help wanted

It would be great to have a more generalised version of the dune-sync client that allows for both

  1. Syncing data from Dune to a local DB
  2. Syncing data from a local DB to Dune

Given that Dune has evolved and no longer recommends uploading data into S3 bucket it ingests, I'd suggest for 1) to mainly happen via the upload_csv functionality (as used in https://github.com/cowprotocol/dune-sync/blob/main/src/sync/app_data.py#L21).

I'd also suggest the new version to be completely domain agnostic in that all required information about the source and target data as well as queries can be provided separately (and thus packaged wherever dune-sync is deployed). The fact that for instance at the moment the app_hashes sql is checked into this repo, while the configuration of the sync job happens in the infrastructure repository is a smell imo.

I would suggest something like this as the general configuration shema:

[[datasources]]
name = "postgres"
type = "postgres"
url = "postgresql://host:port/?user=&password="

[[datasources]]
name = "dune"
type = "dune"
apikey = "xyz"

[[jobs]]
from = "dune" # referencing datasource name
to = "postgres" # referencing datasource name
query = 40000123 # referencing dune query id
target = "table" # referencing postgres target table
truncate = false # if table should be truncated before

[[jobs.parameters]]
day = "2021-01-01"
blockchain = "ethereum"

[[jobs]]
from = "postgres"
to = "dune"
query = "SELECT * FROM PRICES" # SQL query string
target = "table_name" # Dune table name
private = false # whether the dune table should be private or not

This way this client becomes a general purpose middleware for any web3 team that wants to bridge data in and out of Dune.

Lingua principale
Python
Stelle
5
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cowprotocol/dune-sync

Tutte le issue di cowprotocol/dune-sync

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.