Skip to content

Python scripts for ETL (extract, transform and load) jobs for Tron blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions.

License

Notifications You must be signed in to change notification settings

Raisin975/tron-etl

 
 

Repository files navigation

TRON-ETL

  • TRON RESTFULL API does not support batch request
  • Use multithreading to replace batch requests
  • Batch requests are a feature of the Ethereum JSON-RPC API that allows multiple requests to be sent in a single HTTP POST request

Quickstart

Clone Tron ETL:

git clone https://github.com/Raisin975/tron-etl.git

Export Transactions and Blocks

export_blocks_and_transactions(
    start_block, end_block, 
    rpc_url=rpc_url,
    batch_size=batch_size, 
    max_workers=max_worker, 
    transactions_output=data_save_path + "/transactions.json",
    block_output=data_save_path + "/blocks.json"
)

Export TRC20 Transfers

extract_trc20_token_transfers(
    transactions=data_save_path + "/transactions.json",
    batch_size=batch_size, 
    max_workers=max_worker, 
    output=data_save_path + "/trc20_transfers.json"
)

Export TRC10 Transfers

extract_trc10_token_transfers(
    transactions=data_save_path + "/transactions.json",
    batch_size=batch_size, 
    max_workers=max_worker, 
    output=data_save_path + "/trc10_transfers.json"
)

Export Contracts

export_contracts(
    transactions=data_save_path + "/transactions.json",
    rpc_url=rpc_url,
    batch_size=batch_size, 
    max_workers=max_worker, 
    output=data_save_path + "/contracts.json"
)

Running in Docker

coding...

About

Python scripts for ETL (extract, transform and load) jobs for Tron blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Dockerfile 0.2%