Validator CLI - v1.2.0
Installation
-
Download the executable
Terminal window VERSION_NUM={put the version number here} && sudo -E bash -c "curl -L https://github.com/skalenetwork/validator-cli/releases/download/$VERSION_NUM/sk-val-$VERSION_NUM-`uname -s`-`uname -m` > /usr/local/bin/sk-val" -
Apply executable permissions to the binary
Terminal window sudo chmod +x /usr/local/bin/sk-val
CLI Usage
Initialize Validator CLI
Download SKALE Manager contracts info and set the node of the network
sk-val initRequired Arguments
--endpoint/-eis the RPC endpoint of the node in the network where SKALE Manager is deployed [http or https]--contracts-url/-cis the URL to SKALE Manager contracts ABI and addresses-w/--walletis the type of the wallet that will be used to sign transactions. Must be of type software, sgx, or hardware.
Usage Example
sk-val init -e ws://geth.test.com:8546 -c https://test.com/manager.json --wallet softwareSGX Commands
Init
This command creates an SGX Wallet.
sk-val sgx init [SGX_SERVER_URL]Optional Arguments
--force/-frewrites the current sgx wallet data--ssl-portspecifies the port that is used by the sgx server to establish a TLS connection
Info
This command prints information about the SGX Wallet.
sk-val sgx infoOptional Arguments
--rawprints info in plain JSON
Validator Commands
Register
Registers as a new SKALE validator.
sk-val validator registerRequired Arguments
--name/-nis the validator name--description/-dis the validator description--commission-rate/-cis the commission rate in percentage form--min-delegationis the minimum delegation amount that the validator will accept
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesthe confirmation flag may be set in advance
Usage Example
sk-val validator register -n test -d "test description" -c 20 --min-delegation 1000 --pk-file ./pk.txtList
Lists all available validators.
sk-val validator lsOptional Arguments
--wei/-wcan be used to show the amount of tokens in wei
Delegations
Returns a list of delegations for a given validator id.
sk-val validator delegations [VALIDATOR_ID]Required Parameters
VALIDATOR_IDis the id of the validator. This is a numeric value.
Accept Pending Delegations
This command will accept pending delegations by delegation Id.
sk-val validator accept-delegation --pk-file ./pk.txtRequirement Arguments
--delegation-idis the id of he delegation request to accept
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesthe confirmation flag may be set in advance
Accept All Pending Delegations
sk-val validator accept-all-delegations ./pk.txtOptional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.
Validator Linked Addresses
Lists the linked addresses for the validator address.
sk-val validator linked-addresses [ADDRESS]Required Parameters
ADDRESSis the Ethereum address of the validator
Link Address
Links a node address to the validator account.
sk-val validator link-address [ADDRESS] [NODE_SIGNATURE] --pk-file ./pk.txtRequired Parameters
ADDRESSis the Ethereum address that will be linkedNODE_SIGNATUREis the signature of the node that you can get using theskale node signaturecommand from the SKALE Node CLI
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesthe confirmation flag may be set in advance
Unlink Address
Unlinks a node address from the validator account.
sk-val validator unlink-address [ADDRESS] --pk-file ./pk.txtRequired Parameters
ADDRESSis the Ethereum address that will be unlinked
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesthe confirmation flag may be set in advance
Validator Info
Shows info about a given validator.
sk-val validator info [VALIDATOR_ID]Required Parameters
VALIDATOR_IDis the validator id to lookup
Output Includes:
- Validator Id
- Validator Name
- Validator Address
- Validator Fee Rate (in percentage form)
- Minimum Delegation Amount (SKL)
- If the validator is accepting new delegation requests
Withdraw Fee
Withdraws earned fees to a specified address.
sk-val validator withdraw-fee [RECIPIENT_ADDRESS] --pk-file ./pk.txtRequired Parameters
RECIPIENT_ADDRESSis the address to transfer the bounties too
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesthe confirmation flag may be set in advance
Set Minimum Delegation Amount (MDA)
Sets new minimum delegation amount for the validator.
sk-val validator set-mda [NEW_MDA] --pk-file ./pk.txtRequired Parameters
NEW_MDAis the new mda value
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesthe confirmation flag may be set in advance
Request Address Change
Requests a change of Ethereum Address for the validator.
sk-val validator change-address [ADDRESS] --pk-file ./pk.txtRequired Parameters
ADDRESSis the validator Ethereum address
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesthe confirmation flag may be set in advance
Confirm Address Change
Confirms a requested address change for the validator.
sk-val validator confirm-address [VALIDATOR_ID] --pk-file ./pk.txtRequired Parameters
VALIDATOR_IDis the ID of the associated validator
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesthe confirmation flag may be set in advance
Earned Fees
Retrieves the earned fee amount for the validator address.
sk-val validator earned-fees [ADDRESS]*Required Parameters
ADDRESSis the validator address to check
Optional Arguments
--weican be used to show the amount in wei
Holder Commands
Delegate
Delegate tokens to a validator
sk-val holder delegateRequired Arguments
--validator-idis the id of the validator to delegate to--amountis the amount of SKL tokens to delegate--delegation-periodis the delegation period in months [Set to 2]--infoto request info on the delegation
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.
Delegations
Use to list out all delegations for an address.
sk-val holder delegations [ADDRESS]Required Parameters
ADDRESSis the Ethereum address of the SKL token holder
Optional Arguments
--wei/-wto show amounts in wei
Cancel Pending Delegation
Use to cancel a pending delegation request.
sk-val holder cancel-delegation [DELEGATION_ID]Required Parameters
DELEGATION_IDis the id of the delegation to cancel
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.
Request Undelegation
Request undelegation which goes into affect at the end of the undelegation period.
sk-val holder undelegate [DELEGATION_ID]Required Parameters
DELEGATION_IDis the id of the delegation to cancel
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.
Withdraw Bounty
Withdraws a bounty to the specified address
sk-val holder withdraw-bounty [VALIDATOR_ID] [RECIPIENT_ADDRESS] --pk-file ./pk.txtRequired Parameters
VALIDATOR_IDis the id of the validatorRECIPIENT_ADDRESSis the Ethereum address to have the bounty sent too
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--gas-priceallows the executor to specify the gas price value in gwei for a transaction. If not specified, the average gas price of the network will be double and set.--yesconfirmation flag can be used to auto execute
Locked
Shows the amount of locked tokens for an address.
sk-val holder locked [ADDRESS]Required Parameters
ADDRESSis the Ethereum address of the SKL token holder
Optional Arguments
--wei/-wto show amounts in wei
Earned Bounties
Reads the amount of earned bounties by a token holder for a single validator.
sk-val holder earned-bounties [VALIDATOR_ID] [ADDRESS]Required Parameters
VALIDATOR_IDis the id of the validatorADDRESSis the Ethereum address of the SKL token holder
Optional Arguments
--wei/-wto show amounts in wei
Wallet Commands
Setup Ledger
sk-val wallet setup-ledgerRequired Arguments
--address-indexis the index of the wallet to use (starts at 0)--keys-typeis the type of Ledger keys whether live or legacy
Send ETH Tokens
Executes a transfer of ETH tokens to a specific address.
sk-val wallet send-eth [ADDRESS] [AMOUNT]Required Parameters
ADDRESSis the Ethereum receiver address (e.g to)AMOUNTis the amount of ETH tokens to send
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--yesconfirmation flag can be used to auto execute
Usage Example
sk-val wallet send-eth 0x01C19c5d3Ad1C3014145fC82263Fbae09e23924A 0.01 --pk-file ./pk.txt --yesSend SKL Tokens
Executes a transfer of SKL tokens to a specific address.
sk-val wallet send-skl [ADDRESS] [AMOUNT]Required Parameters
ADDRESSis the Ethereum receiver address (e.g to)AMOUNTis the amount of ETH tokens to send
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--yesconfirmation flag can be used to auto execute
Usage Example
sk-val wallet send-skl 0x01C19c5d3Ad1C3014145fC82263Fbae09e23924A 0.01 --pk-file ./pk.txt --yesSelf-Recharging Wallet Commands
Balance
Shows the balance of the validator self-recharging wallet.
sk-val srw balance [VALIDATOR_ID]Required Parameters
VALIDATOR_IDis the ID of the validator
Optional Arguments
--wei/-wshows the amount in wei
Usage Example
sk-val srw balance 1 --weiRecharge Wallet
Recharges the validator SRW wallet (amount in ETH).
sk-val srw recharge [AMOUNT]Required Parameters
AMOUNTis the amount of ETH tokens to send
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--yesconfirmation flag can be used to auto execute
Usage Example
sk-val srw recharge 0.1 --pk-file ./tests/test-pk.txtWithdraw
Withdraw ETH from validator SRW (amount in ETH).
sk-val srw withdraw [AMOUNT]Required Parameters
AMOUNTis the amount of ETH tokens to send
Optional Arguments
--pk-fileis a path to a file with private key (only supported for software wallet type)--yesconfirmation flag can be used to auto execute
Usage Example
sk-val srw withdraw 0.1 --pk-file ./tests/test-pk.txtExit Codes
| Code | Explanation |
|---|---|
| 0 | Everything is OK |
| 1 | General error exit code |
| 3 | Bad API response |
| 4 | Script execution error |
| 5 | Transaction error |
| 6 | Revert error |