spd Command

'spd' commands are used to operate SP(meta, or indexing) node

help

List spd usage, available sub-commands and flags

Suppose a meta(indexing) node - node0 is located in `$HOME/stratos/sdstest/sp/example/localnet/node0`.

First

cd $HOME/stratos/sdstest/sp/example/localnet/node0

Then,

 spd -h
 
 # OR 
 
 spd --help

Response:

meta(indexing) node

Usage:
  spd [command]

Available Commands:
  config      create default configuration file
  help        Help about any command
  start       start the spd demon
  tm          tendermint commands

Flags:
  -c, --config string   configuration folder path  (default "./configs")
  -h, --help            help for spd
  -r, --home string     path for the node (default "$HOME/stratos/sdstest/sp/example/localnet/node0")

Use "spd [command] --help" for more information about a command.

start

Start a meta(indexing) node.

spd start <path to SP node folder>

SP node folder is the folder that contains configs and data of the SP node. An SP node folder looks like

.
├── config
│   ├── addrbook.json
│   ├── config.toml
│   ├── genesis.json
│   ├── node_key.json
│   ├── priv_validator_key.json
│   ├── sp.yaml
│   └── st1kfz5eal3a5ev472fpyyqkxyg9jtxurt3337yjh.json
├── data
│   ├── blockstore.db
│   ├── chainstate.db
│   ├── cs.wal
│   ├── evidence.db
│   ├── priv_validator_state.json
│   ├── state.db
│   └── tx_index.db
└── tmp
    └── logs

configs folder includes all configurations for this SP node.

`data` folder holds the node's database.

tmp stores various types of logs. It is generated automatically during the node is running.

Suppose a meta(indexing) node - node0 is located in `$HOME/stratos/sdstest/sp/example/localnet/node0`.

cd $HOME/stratos/sdstest/sp/example/localnet/node0 
spd start ./

Response:

[INFO]2022/01/03 16:42:38 chainstate.go:225: Reinitialized From Database version 1626 tree_height 0 hash 
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] POST   /login                    --> github.com/stratosnet/sp/api.login (3 handlers)
[GIN-debug] GET    /data/statistics          --> github.com/stratosnet/sp/api.getStatistics (3 handlers)
[GIN-debug] GET    /pp                       --> github.com/stratosnet/sp/api.getPPList (3 handlers)
[GIN-debug] POST   /pp/activated             --> github.com/stratosnet/sp/api.getActivatedPPHandler.func1 (3 handlers)
[GIN-debug] POST   /pp/deactivated           --> github.com/stratosnet/sp/api.getDeactivatedPPHandler.func1 (3 handlers)
[GIN-debug] POST   /pp/prepaid               --> github.com/stratosnet/sp/api.getPrepaidHandler.func1 (3 handlers)
[GIN-debug] POST   /pp/unbonding             --> github.com/stratosnet/sp/api.getUnbondingPPHandler.func1 (3 handlers)
[GIN-debug] POST   /pp/uploaded              --> github.com/stratosnet/sp/api.uploaded (3 handlers)
[GIN-debug] POST   /pp/updatedStake          --> github.com/stratosnet/sp/api.getUpdatedStakePPHandler.func1 (3 handlers)
[GIN-debug] POST   /pp/:p2pAddress/backup    --> github.com/stratosnet/sp/api.backupPP (3 handlers)
[GIN-debug] POST   /slice/backup             --> github.com/stratosnet/sp/api.sliceBackup (3 handlers)
[GIN-debug] GET    /file                     --> github.com/stratosnet/sp/api.getFileList (3 handlers)
[GIN-debug] GET    /file/:hash/slice         --> github.com/stratosnet/sp/api.getSliceList (3 handlers)
[GIN-debug] GET    /sys                      --> github.com/stratosnet/sp/api.setting (3 handlers)
[GIN-debug] POST   /sys                      --> github.com/stratosnet/sp/api.save (3 handlers)
[GIN-debug] POST   /transfer                 --> github.com/stratosnet/sp/api.sliceTransfer (3 handlers)
[GIN-debug] POST   /traffic/aggregate        --> github.com/stratosnet/sp/api.aggregateTraffic (3 handlers)
[GIN-debug] POST   /chain/activate           --> github.com/stratosnet/sp/api.activateSPHandler (3 handlers)
[GIN-debug] POST   /chain/updateStake        --> github.com/stratosnet/sp/api.updateStakeSPHandler (3 handlers)
[GIN-debug] POST   /chain/vote               --> github.com/stratosnet/sp/api.vote (3 handlers)
[GIN-debug] POST   /chain/activated          --> github.com/stratosnet/sp/api.activatedSPHandler (3 handlers)
[GIN-debug] POST   /chain/updatedStake       --> github.com/stratosnet/sp/api.updatedStakeSPHandler (3 handlers)
[INFO]2022/01/03 16:42:38 server.go:91: initializing...
[DEBUG]2022/01/03 16:42:38 server.go:427: verified P2P key successfully!
[GIN-debug] Listening and serving HTTP on 0.0.0.0:8081
[DEBUG]2022/01/03 16:42:38 server.go:441: verified wallet key successfully!
[INFO]2022/01/03 16:42:38 server.go:101: listen:  0.0.0.0:8888

...

Last updated