Giter Site home page Giter Site logo

helium-etl-queries's Introduction

helium-etl-queries

A collection of SQL queries used to enrich data produced by a Helium blockchain-etl

This repo is specifically trying to create and manage views that better surface the embedded JSON fields in a more managable form, e.g. turning transactions[type='state_channel_close'] => data_credits table, with properly typed columns

A live instance with these views is avaialble on the beta DeWi ETL instance, which runs Metabase:

https://etl.dewi.org

If you're interested in using it, please contact @jamiedubs/@wishplorer on Discord. There is auto signup available if using gmail.com email address with google signin.

Documentation available on: https://dbdocs.io/wishplorer/HeliumDewiETL

Setup

  • setup a blockchain-etl instance – this might take a while
  • load all the views from this repository:
dbname="etl"
for i in views/*; do psql $dbname < $i; done

Or load them one at a time etc.

TODO

  • More views: challenges, consensus_groups, payments, split out reward-types, etc
  • Get fancy and use dbt

Contributing

  • Pull requests welcome
  • Ask questions in #hips or #blockchain-dev on Discord

Contributors

License

MIT

helium-etl-queries's People

Contributors

evandiewald avatar gregkarabinos avatar jamiew avatar wishplorer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

helium-etl-queries's Issues

Add indexes to transctions_payment

How is the Helium API doing efficient payment txn lookups? Our current setup is extremely slow

Specifically like to index payer and payee

Might require turning this into a materialized view and adding to the cronjobs, but I assume blockchain-http has some secrets

Switch to using dbt and dbt-metabase

Use dbt pipelines to handle transormations and view creation more reliably and sanely.

Then use dbt-metabase to sync the dbt data model w/ Metabase (!)

Will make it a lot easier to test, easier to automate, and make it easier for others to contribute new tables and views

Add witness_address index to challenge_receipts_parsed

Weird that transmitter has indexes on both address and name, but witness is only on name

OR make both of these only use address... shave some space off a large index

Name not unique so shouldn't really be an index at all

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.