Skip to content

digital-strategies/casper-ds-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Casper CLI

Special made CLI to help with undelegating and scheduling transactions.

Installation

Download the latest executable here (linux only for now): https://github.com/digital-strategies/casper-ds-cli/releases or

Grab the repo https://github.com/digital-strategies/casper-ds-cli and run:

  • npm install
  • npm run build

If you go with the latter option then in the examples below you need to write npm start -- <command> [options] instead of ./casper-ds <command> [options]

Setup

It's recommended that you put your public_key.pem and secret_key.pm files (make sure the file names match) in the same directory as the CLI so they are detected automatically. Otherwise you can specify custom paths for those files with --pub and --pk parameters.

Running commands

Open a terminal in the directory where you downloaded / built the CLI and run any of the commands below.

Available Commands

All commands and parameters are documented in the CLI when you run ./casper-ds it will give you the available commands and if you run ./casper-ds <command> it will list all possible parameters for that command.

As a general rule, commands that generate a transaction do not broadcast it to the network by default but return the signed transaction instead. To broadcast immediately, add the --broadcast param.

transfer

Creates a transfer transaction to the specified address.

Examples:

  • Send 23 CSPR on mainnet ./casper-ds transfer --to 0181dd6e2f7ed815c0246f210aa169882f8e821d874a43f817f77a795147beed61 --amount 23000000000 --network casper
  • Send 5 CSPR with specific timestamp on testnet ./casper-ds transfer --to 0181dd6e2f7ed815c0246f210aa169882f8e821d874a43f817f77a795147beed61 --amount 5000000000 --network casper-test --timestamp "2021-06-29T15:01:00.552Z"

undelegate

Creates an undelegate transaction from a specified validator node.

Examples:

  • Undelegate 123 CSPR from 017d96b9a63abcb61c870a4f55187a0a7ac24096bdb5fc585c12a686a4d892009e on mainnet ./casper-ds transfer --validator 017d96b9a63abcb61c870a4f55187a0a7ac24096bdb5fc585c12a686a4d892009e --amount 123000000000 --network casper
  • Undelegate 5 CSPR from 017d96b9a63abcb61c870a4f55187a0a7ac24096bdb5fc585c12a686a4d892009e with specific timestamp on testnet ./casper-ds transfer --to 017d96b9a63abcb61c870a4f55187a0a7ac24096bdb5fc585c12a686a4d892009e --amount 5000000000 --network casper-test --timestamp "2021-06-29T15:01:00.552Z"

deploy

Broadcasts a given serialized tx (e.g. generated by one of the other commands) to the network.

Examples:

  • Broadcast serialized tx ./casper-ds deploy --json <serialized_tx>
  • Broadcast serialized tx only when tx's timestamp is greater than or equal to current time (this allows for simple tx scheduling) ./casper-ds deploy --json <serialized_tx> --wait