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.
- 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 table to track tx_index/type information
- create dispenses table to track dispenser dispenses
- create markets table to track decentralized exchange (DEX) market info
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
- Counterparty.sql.gz (Mainnet Block # 866,528)
- Counterparty_Testnet.sql.gz (Testnet Block # 3,192,303)
--testnet Load testnet data
--regtest Load regtest data
--block=# Load data for given block
--single Load single block
--rollback=# Rollback data to a given block
--silent Fail silently on insert errors
Counterparty tables (populated via 'messages')
- addresses
- address_events
- bets
- bet_expirations
- bet_match_expirations
- bet_match_resolutions
- bet_matches
- broadcasts
- btcpays
- burns
- cancels
- credits
- debits
- destructions
- dispensers
- dispenser_refills
- dispenses
- dividends
- fairminters
- fairmints
- issuances
- order_expirations
- order_match_expirations
- order_matches
- orders
- rps
- rps_expirations
- rps_match_expirations
- rps_matches
- rpsresolves
- sends
EVM-related tables
Additional tables (populated by counterparty2mysql):
- assets
- balances
- blocks
- markets
- index_addresses
- index_contracts
- index_transactions
- index_tx
- index_tx_types
- transactions
- transaction_outputs
Helpful? Donate BTC, XCP or any Counterparty asset to 1JDogZS6tQcSxwfxhv6XKKjcyicYA4Feev