phpsource / counterparty2mysql

PHP script that populates a MySQL database with Counterparty data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

counterparty2mysql

counterparty2mysql is a php script which populates a mysql database with counterparty data.

counterparty2mysql loads Counterparty data by requesting 'messages' data for a block from the Counterparty API, and then processing each message. The Counterparty 'messages' table holds a list of all of the insert and update actions performed on counterparty tables.

By default counterparty2mysql starts at the first block with a Counterparty transaction (mainnet=278270, testnet=310000) and parses data for all blocks between the starting block and the current block.

If no starting block is given, counterparty2mysql will try to resume parsing at the last successfully parsed block, or use the first block with a counterparty transaction.

Database Customizations

  • Index all assets, addresses, transactions, and contracts
  • create assets table with up to date summary information
  • create balances table to track address/asset balance information
  • create blocks table and index transaction hashes
  • create index_tx to track tx_index/type information

Setup

echo "CREATE DATABASE IF NOT EXISTS Counterparty" | mysql
echo "CREATE DATABASE IF NOT EXISTS Counterparty_Testnet" | mysql
cat sql/*.sql | mysql Counterparty
cat sql/*.sql | mysql Counterparty_Testnet

Bootstrap Information

Command line arguments

--testnet  Load testnet data
--regtest  Load regtest data
--block=#  Load data for given block
--single   Load single block

Database Information

Counterparty tables (populated via 'messages')

EVM-related tables

Additional tables (populated by counterparty2mysql):

Helpful? Donate BTC, XCP or any Counterparty asset to 1JDogZS6tQcSxwfxhv6XKKjcyicYA4Feev

About

PHP script that populates a MySQL database with Counterparty data

License:MIT License


Languages

Language:PHP 100.0%