sei-chain
sei-chain copied to clipboard
Update run-node.py
Purpose of the Changes
addresses several issues and improvements:
-
Dynamic Version Control: Implementing version control with automated fetching based on network, fetched from 'abci_info' RPC endpoint. Additional variables at top of the script to override versioning.
-
Database Backend Selection: In response to recent updates which included additional database backend options, the script now prompts the user to choose their preferred database backend. This ensures compatibility and customization according to user needs.
-
Dependency Management: Checks for and installs missing Python packages automatically or alerts to install [requests].
-
Enhanced Error Handling and Console Logs: Added error handling just based on issues I ran into during this rework, added a few console messages during setup confirming selections.
-
"Advanced User Configs": Several variables are now near the top of the script for quick access to commonly modified parameters:
# advanced user configs
moniker = "pynode" # optional custom moniker for the node
trust_height_delta = 40000 # negative height offset for state sync
enable_unsafe_reset = True # wipe database and keys before setup
version_override = False # override version fetching. [if true, specify version(s) below]
# chain binary version ["version_override" must be true to use]
MAINNET_VERSION = "v3.9.0"
DEVNET_VERSION = "v5.2.2"
TESTNET_VERSION = "v5.2.2"
Impact of Changes
Makes the script functional again and is easy to maintain throughout version changes.
Testing
Tested on my local machine, pacific-1 + arctic-1 both using sei-db. Notifies if missing 'requests' package, prints network and version number upon selecting, node syncs without app hash.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 60.47%. Comparing base (
27637cb
) to head (c4e5f9a
).
Additional details and impacted files
@@ Coverage Diff @@
## main #1617 +/- ##
==========================================
- Coverage 60.61% 60.47% -0.14%
==========================================
Files 369 369
Lines 27035 27035
==========================================
- Hits 16387 16350 -37
- Misses 9531 9570 +39
+ Partials 1117 1115 -2