Python based CLI tool for staking (nominating) in Polkadot
run python StakingManager.py dot -h
- NOTE: because only polkadot is supported, you must give dot
as the first argument.
In the future, when we support additional networks, there will be other options to dot
- Pretty intuitive ArgParser (see examples.py) for:
- Creating a mnemonic, keypair, getting acct info
- Bonding, unbonding, rebonding, withdrawing
- Nominating (Staking), setting staker requirements
- Validations and error handling for staking:
- Keep-alive checks (existential deposit)
- https://wiki.polkadot.network/docs/maintain-errors
- StakingManager.py is the cli executed file
- Most "unique" logic is in fxn_decorator_implementations folder
- config.py specifies the network (see bottom of config file), right now only Polkadot mainnet and Westend are really functional
- Under the hood:
- SubstrateInterface (py):
- SS58:
- TODO: Testing Tools:
- SOLID - https://gist.github.com/dmmeteo/f630fa04c7a79d3c132b9e9e5d037bfd
- If a filename has a corresponding Utils file, one should not ever need to import the Utils file except in its pair.
- For example, accountManager.py should import accountManagerUtils.py, but no other files should import accountManagerUtils.py. Instead, all other files should only ever have to import accountManager.py.
- Pass "generic" arguements first in a function and more unique arguements subsequently
- For example, in
def __init__(self, logger, accountManager)
,self
andlogic
are generic and therefore passed beforeaccountManager
- For example, in
- Add local network docker deployment for better testing
- Adding new substrate based chains to stake on
- check TODOs in substrateCallImplementationUtils
- rename all cases of "bounder" to "bonder"
- rename code_src > src