This script monitors Solana leader slots and uploads traces to an AWS S3 bucket. It reads configuration details from a .toml
file and uses the provided slots to monitor and upload traces.
- Python3
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip3 install -r requirements.txt
Create a file named config.toml
with the following content:
[app_config]
rpc_url = "https://api.mainnet-beta.solana.com"
logfile = "logfile.log"
traces_dir_path = "/mnt/ledger/banking_trace"
traces_temp_copy_path = "./traces_copy" #keep a temporary copy to aviod file rotation
bucket_name = "traces"
aws_access_key_id = "aws_access_key_id"
aws_secret_access_key = "aws_secret_access_key"
slots = [326892300, 326894300, 326896300]
Run the script with the following command:
python uploadtraces.py --config config.toml
--config: Path to the configuration file (.toml
). Defaults to config.toml
if not specified.
Logs will be saved to the file specified by logfile
in the configuration file.
We have the leader schedule for two epochs, so the config file needs to be changed after every two epochs.
The script copies the file immediately after becoming the leader, having a minimal effect on the validator's performance.