Getting Started
stellar/stellar-etl docker images
Recommended Usage
Generally if you do not need to modify any of the stellar-etl code, it is recommended that you use the stellar/stellar-etl docker images.
Example to run locally with docker:
docker run --platform linux/amd64 -ti stellar/stellar-etl:latest <parameters>
Building and Running Locally
Install Golang
- Make sure your golang version >=
1.22.1
- Instructions to install golang can be found at go.dev/doc/install
Clone the repo
git clone https://github.com/stellar/stellar-etl
Build stellar-etl
- Run
go build
in the cloned stellar-etl repo
go build
Run stellar-etl
- A
stellar-etl
executable should have been created in your stellar-etl repo - Example stellar-etl command:
./stellar-etl export_ledgers -s 10 -e 11
This should create a exported_ledgers.txt
file with the output of ledgers from ledgers 10 to 11:
{"base_fee":100,"base_reserve":100000000,"closed_at":"2024-02-06T17:34:12Z","failed_transaction_count":0,"fee_pool":0,"id":42949672960,"ledger_hash":"f7c89b35c50f74dc69eacd9dda8e9ec9f1af36b6a2928b77619c1beb5f5ca8d4","ledger_header":"AAAAAIGFrRh+oCo2QcAjG6IzWTlil89DNwYIwx6PrrmehujNf44MwMJZxPz3DJYHciV9ligoKwbmeiue4eM29CRWBJgAAAAAZcJtlAAAAAAAAAABAAAAANVyadliUPdJbQeb4ug1Ejbv/+jTnC4Gv6uxQh8X/GccAAAAQBW0ICM/1C7CML6ngZijKycAOIhzwGN6yUsznHznfJunIDyLLVF9/oqvLzP1vaGOhBf3Rmtm5WgGVgeLjlyJSAHfP2GYBKkv20BXGS3EPddI6neK3FK8SYzoBSTAFLgRGfBr+YHFQTIEJ0Y81WEOYClgyjOER8vd4qMQb3gM9nRvAAAACg3gtrOnZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkBfXhAAAAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=","max_tx_set_size":100,"operation_count":0,"previous_ledger_hash":"8185ad187ea02a3641c0231ba23359396297cf43370608c31e8faeb99e86e8cd","protocol_version":0,"sequence":10,"soroban_fee_write_1kb":0,"successful_transaction_count":0,"total_coins":1000000000000000000,"transaction_count":0,"tx_set_operation_count":"0"}
{"base_fee":100,"base_reserve":100000000,"closed_at":"2024-02-06T17:34:17Z","failed_transaction_count":0,"fee_pool":0,"id":47244640256,"ledger_hash":"5b9ac11c6040f4e2fa6a120b3dee9a4b338b7a25bcb8437dab0c0a5c557a41f5","ledger_header":"AAAAAPfImzXFD3TcaerNndqOnsnxrza2opKLd2GcG+tfXKjUK858NP5gM0pneHF0nRowsJBAzMwWDx0+tmbYIZkIT+8AAAAAZcJtmQAAAAAAAAABAAAAANVyadliUPdJbQeb4ug1Ejbv/+jTnC4Gv6uxQh8X/GccAAAAQDhZKPKBdeD4Sthcu+EsuzEtSyiXzXkHboOsgYT1tuV/juZyKqgrsVmg+RmMoRun+NKCdcB8LV9gaehiFm+XDgnfP2GYBKkv20BXGS3EPddI6neK3FK8SYzoBSTAFLgRGfBr+YHFQTIEJ0Y81WEOYClgyjOER8vd4qMQb3gM9nRvAAAACw3gtrOnZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkBfXhAAAAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=","max_tx_set_size":100,"operation_count":0,"previous_ledger_hash":"f7c89b35c50f74dc69eacd9dda8e9ec9f1af36b6a2928b77619c1beb5f5ca8d4","protocol_version":0,"sequence":11,"soroban_fee_write_1kb":0,"successful_transaction_count":0,"total_coins":1000000000000000000,"transaction_count":0,"tx_set_operation_count":"0"}
stellar-etl Commands
export_ledgers
stellar-etl export_ledgers --start-ledger 1000 --end-ledger 500000 --output exported_ledgers.txt
This command exports ledgers within the provided range.
export_transactions
stellar-etl export_transactions --start-ledger 1000 --end-ledger 500000 --output exported_transactions.txt
This command exports transactions within the provided range.
export_operations
stellar-etl export_operations --start-ledger 1000 --end-ledger 500000 --output exported_operations.txt
This command exports operations within the provided range.
export_effects
stellar-etl export_effects --start-ledger 1000 --end-ledger 500000 --output exported_effects.txt
This command exports effects within the provided range.
export_assets
stellar-etl export_assets --start-ledger 1000 --end-ledger 500000 --output exported_assets.txt
Exports the assets that are created from payment operations over a specified ledger range.
export_trades
stellar-etl export_trades --start-ledger 1000 --end-ledger 500000 --output exported_trades.txt
Exports trade data within the specified range to an output file
export_diagnostic_events
stellar-etl export_diagnostic_events --start-ledger 1000 --end-ledger 500000 --output export_diagnostic_events.txt
Exports diagnostic events data within the specified range to an output file
export_ledger_entry_changes
stellar-etl export_ledger_entry_changes --start-ledger 1000 --end-ledger 500000 --output exported_changes_folder/
This command exports ledger changes within the provided ledger range.
Note that this command will also exports every state change for each ledger entry type. Information on options to only output specifc ledger entry types.