Skip to content

terhnt/unoparty2mysql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unoparty2mysql

unoparty2mysql is a php script which populates a mysql database with unoparty data.

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

By default unoparty2mysql starts at the first block with a Unoparty transaction (mainnet=1777464, testnet=700) and parses data for all blocks between the starting block and the current block.

If no starting block is given, unoparty2mysql will try to resume parsing at the last successfully parsed block, or use the first block with a unoparty 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 table to track tx_index/type information
  • create dispenses table to track dispenser dispenses
  • create markets table to track decentralized exchange (DEX) market info

Setup

echo "CREATE DATABASE IF NOT EXISTS Unoparty" | mysql
echo "CREATE DATABASE IF NOT EXISTS Unoparty_Testnet" | mysql
cat sql/*.sql | mysql Unoparty
cat sql/*.sql | mysql Unoparty_Testnet

Bootstrap Information

Command line arguments

--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

Database Information

Unoparty tables (populated via 'messages')

EVM-related tables

Additional tables (populated by unoparty2mysql):

Helpful? Donate BTC, XCP or any Unoparty asset to 188gkL7ZYcsoGShuv7VTFtZaG5RUcxcwhQ

About

PHP script that populates a MySQL database with Unoparty data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%