GithubHelp home page GithubHelp logo

python-tools's Introduction

python-tools

This repository contains source code for tools used by coinmetrics.io to collect data from Bitcoin and its clones and forks. Currently, we support BTC, BCH, LTC, DOGE, ZEC, DCR, PIVX, XVG, DASH, VTC, DGB, BTG, BSV and two assets based on Omni protocol: USDT and MAID.

Prerequisites

Python 3.6, PostgreSQL 9 or 10, Python modules psycopg2, requests, python-dateutil.

Reproducing coinmetrics.io data

We'll use LTC as an example, due to relatively small size of its blockchain. We presume that the tool, postgresql database and LTC node live on the same machine.

  • LTC node should be installed and synced with the network. It is essential to launch the node with txindex=1 flag set.
  • Clone this repository and launch the following command from the root directory: python3 -m coinmetrics.bitsql.applications.export ltc localhost:db_port:db_name:db_user:db_password localhost:node_rpc_port:node_rpc_user:node_rpc_password. This will export node data to PostgreSQL database and may take a while.
  • After initial export is completed, vacuum tables by running python3 -m coinmetrics.bitsql.applications.dbcontrol ltc localhost:db_port:db_name:db_user:db_password --vacuum and then create database indices by running python3 -m coinmetrics.bitsql.applications.dbcontrol ltc localhost:db_port:db_name:db_user:db_password --add-index.
  • Compute metrics and store them in PostgreSQL tables by running python3 -m coinmetrics.bitsql.applications.metricmaker ltc localhost:db_port:db_name:db_user:db_password --save.
  • Optionally, create CSV from metric tables: python3 -m coinmetrics.applications.utxo_csvmaker ltc localhost:db_port:db_name:db_user:db_password.
  • Produced CSV contains only on-chain data denominated in satoshis. CSVs available at coinmetrics.io can be obtained by combining on-chain and price data collected from, for instance, coinmarketcap.com.

python-tools's People

Contributors

whateverpal avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.