Skip to content

Commit

Permalink
0.3.7 Added: --version VERSION search for a snapshot from a specific …
Browse files Browse the repository at this point in the history
…node version
  • Loading branch information
c29r3 committed Jun 4, 2024
1 parent 7725e5b commit 8bb795d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,41 @@ options:
-t THREADS_COUNT, --threads-count THREADS_COUNT
the number of concurrently running threads that check snapshots for rpc nodes
-r RPC_ADDRESS, --rpc_address RPC_ADDRESS
RPC address of the node from which the current slot number will be taken https://api.mainnet-beta.solana.com
RPC address of the node from which the current slot number will be taken
https://api.mainnet-beta.solana.com
--slot SLOT search for a snapshot with a specific slot number (useful for network restarts)
--version VERSION search for a snapshot from a specific version node
--max_snapshot_age MAX_SNAPSHOT_AGE
How many slots ago the snapshot was created (in slots)
--min_download_speed MIN_DOWNLOAD_SPEED
Minimum average snapshot download speed in megabytes
--max_download_speed MAX_DOWNLOAD_SPEED
Maximum snapshot download speed in megabytes - https://github.com/c29r3/solana-snapshot-finder/issues/11.
Example: --max_download_speed 192
Maximum snapshot download speed in megabytes - https://github.com/c29r3/solana-
snapshot-finder/issues/11. Example: --max_download_speed 192
--max_latency MAX_LATENCY
The maximum value of latency (milliseconds). If latency > max_latency --> skip
--with_private_rpc Enable adding and checking RPCs with the --private-rpc option.This slow down checking and searching but
potentially increases the number of RPCs from which snapshots can be downloaded.
--with_private_rpc Enable adding and checking RPCs with the --private-rpc option.This slow down
checking and searching but potentially increases the number of RPCs from which
snapshots can be downloaded.
--measurement_time MEASUREMENT_TIME
Time in seconds during which the script will measure the download speed
--snapshot_path SNAPSHOT_PATH
The location where the snapshot will be downloaded (absolute path). Example: /home/ubuntu/solana/validator-
ledger
The location where the snapshot will be downloaded (absolute path). Example:
/home/ubuntu/solana/validator-ledger
--num_of_retries NUM_OF_RETRIES
The number of retries if a suitable server for downloading the snapshot was not found
The number of retries if a suitable server for downloading the snapshot was not
found
--sleep SLEEP Sleep before next retry (seconds)
--sort_order SORT_ORDER
Priority way to sort the found servers. latency or slots_diff
-ipb IP_BLACKLIST, --ip_blacklist IP_BLACKLIST
Comma separated list of ip addresse (ip:port) that will be excluded from the scan. Example: -ipb
1.1.1.1:8899,8.8.8.8:8899
Comma separated list of ip addresse (ip:port) that will be excluded from the
scan. Example: -ipb 1.1.1.1:8899,8.8.8.8:8899
-b BLACKLIST, --blacklist BLACKLIST
If the same corrupted archive is constantly downloaded, you can exclude it. Specify either the number of the
slot you want to exclude, or the hash of the archive name. You can specify several, separated by commas.
Example: -b 135501350,135501360 or --blacklist 135501350,some_hash
If the same corrupted archive is constantly downloaded, you can exclude it.
Specify either the number of the slot you want to exclude, or the hash of the
archive name. You can specify several, separated by commas. Example: -b
135501350,135501360 or --blacklist 135501350,some_hash
-v, --verbose increase output verbosity to DEBUG
```
![alt text](https://raw.githubusercontent.com/c29r3/solana-snapshot-finder/aec9a59a7517a5049fa702675bdc8c770acbef99/2021-07-23_22-38.png?raw=true)
Expand Down
7 changes: 4 additions & 3 deletions snapshot-finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,12 @@ def download(url: str):
try:
# dirty trick with wget. Details here - https://github.com/c29r3/solana-snapshot-finder/issues/11
if MAX_DOWNLOAD_SPEED_MB is not None:
process = subprocess.run([wget_path, f'--limit-rate={MAX_DOWNLOAD_SPEED_MB}M', '--trust-server-names', url, f'-O{temp_fname}'],
process = subprocess.run([wget_path, '--progress=dot:giga', f'--limit-rate={MAX_DOWNLOAD_SPEED_MB}M',
'--trust-server-names', url, f'-O{temp_fname}'],
stdout=subprocess.PIPE,
universal_newlines=True)
else:
process = subprocess.run([wget_path, '--trust-server-names', url, f'-O{temp_fname}'],
process = subprocess.run([wget_path, '--progress=dot:giga', '--trust-server-names', url, f'-O{temp_fname}'],
stdout=subprocess.PIPE,
universal_newlines=True)

Expand Down Expand Up @@ -454,7 +455,7 @@ def main_worker():
return 1


logger.info("Version: 0.3.6")
logger.info("Version: 0.3.7")
logger.info("https://github.com/c29r3/solana-snapshot-finder\n\n")
logger.info(f'{RPC=}\n'
f'{MAX_SNAPSHOT_AGE_IN_SLOTS=}\n'
Expand Down

0 comments on commit 8bb795d

Please sign in to comment.