ppd Command

'ppd'commands are used to operate PP(resource) node

Help

List ppd usage, available sub-commands and flags

 ./ppd -h
 
 OR 
 
 ./ppd --help

Response:

Usage:
  ppd [command]

Available Commands:
  config      create default configuration file
  help        Help about any command
  start       start the node
  terminal    open terminal attached to node demon
  version     get version of the build

Flags:
  -c, --config string   configuration file path  (default "./configs/config.yaml")
  -h, --help            help for ppd
  -r, --home string     path for the node (default "/mnt/hgfs/code/devnettesting/p2p/sds/target")

Config

Create default configuration file for a PP(resource) node

./ppd config <node folder>

node folder is the folder that contains configs and accounts of the PP node. An PP node folder usually looks like

./ppd config ./example/network/node1

Response:

root@ubuntu:/mnt/hgfs/code/devnettesting/p2p/sds/target$ ./ppd config ./example/network/node1
[INFO]2021/10/31 17:24:37 setting.go:128: The config at location ./configs/config.yaml does not exist
[INFO]2021/10/31 17:24:37 node.go:86: No P2P key specified in config. Attempting to create one...
Enter password: 
Enter password again: 
[INFO]2021/10/31 17:24:47 setting.go:251: finished changing configuration file  P2PAddress:  stsdsp2p1dackjxh578kkcyj0q0s7fertxpru35t2efp09f
No wallet key specified in config. Attempting to create one...
Enter wallet nickname: eric
Enter password: 
Enter password again: 
input bip39 mnemonic (leave blank to generate a new one)
Passphrase: 
generated mnemonic is :  
=======================================================================  
pistol indicate hole asthma envelope student produce swim crew debris spare home woman owner comic thumb blood illegal bridge insane rail crane dismiss direct
======================================================================= 

input hd-path for the account, default: m/44'/606'/0'/0/0 
[INFO]2021/10/31 17:24:59 setting.go:251: finished changing configuration file  WalletAddress:  st12gj7l9jl9xmhmqnfs70f3s3n5ate4nfq8v7r59
save wallet password to config file: Y(es)/N(o)y
save the mnemonic phase properly for future recover: 
=======================================================================  
pistol indicate hole asthma envelope student produce swim crew debris spare home woman owner comic thumb blood illegal bridge insane rail crane dismiss direct
======================================================================= 

After the execution of this command, a configs/config.yaml file will be generated under the node folder.

The node folder looks like:

.
├── accounts
│   ├── st1ppcc7hmgwnr6e67ad4tcxxyskqpahuc2y4w7yq.json
│   └── stsdsp2p1faej5w4q6hgnt0ft598dlm408g4p747ymg5jq6.json
├── configs
│   └── config.yaml
├── peers
│   └── pp-list
└── tmp
    └── logs

accounts contains important account info, such as wallet and P2P key files , and thus need to be kept secret.

configs includes all configurations for this PP node. User should modify the config.yaml file to accommodate different scenarios. Please pay more attention to the following configurations:

  • StratosChainUrl: you can configure it to your own stchaincli rest-server if you already run one with your stchaind node; for Stratos Testnet, this value should be set as "https://rest-test.thestratos.org".

  • SPList: for local running, it looks like

    - P2PAddress: ""
      P2PPublicKey: ""
      NetworkAddress: 0.0.0.0:8888

    for Stratos Testnet, set NetworkAddress as:

    - P2PAddress: ""
      P2PPublicKey: ""
      NetworkAddress: 3.12.6.122:8888
  • ChainId: Set this value as your own blockchain's chain-id; for the current Stratos Testnet, set it as stratos-testnet-3.

  • NetworkAddress: make sure to set the NetworkAddress to your public IP address and port. If your node is behind a router, you probably need to configure port forwarding on the router, like

       Port: :18081
       NetworkAddress: <your node external ip>

peers the pp-list file lists all the PP nodes found in the network.

tmp stores stdout log. It is generated automatically during the node is running.

Start

Start a PP(resource) node without interactivity

 ./ppd start

Response:

root@ubuntu:/mnt/hgfs/code/devnettesting/p2p/sds/example/network/node1$ ppd start
[DEBUG]2021/10/31 19:06:12 server.go:144: register route:  /videoSlice/
[INFO]2021/10/31 19:06:13 account.go:67: st1ppcc7hmgwnr6e67ad4tcxxyskqpahuc2y4w7yq.json
[INFO]2021/10/31 19:06:13 server.go:147: Start HTTP Server...
[DEBUG]2021/10/31 19:06:13 account.go:91: publicKey [4 192 193 124 203 206 225 70 35 238 202 157 128 22 98 215 59 195 59 88 103 45 42 81 206 237 62 72 118 7 148 136 250 25 111 248 166 177 207 110 105 177 222 199 7 52 140 79 60 166 40 75 2 198 230 46 159 67 209 217 164 226 136 59 178]
unlock wallet successfully  
[INFO]2021/10/31 19:06:13 network.go:26: setting.NetworkAddress 127.0.0.1
[INFO]2021/10/31 19:06:13 network.go:26: setting.NetworkAddress 127.0.0.1
[DEBUG]2021/10/31 19:06:13 sp_peers.go:86: SendMessage(client.SPConn, req, header.ReqGetSPList)
[DEBUG]2021/10/31 19:06:13 client.go:67: 0.0.0.0:8888 connect failed
[INFO]2021/10/31 19:06:13 client.go:70: connect success
[DEBUG]2021/10/31 19:06:13 conn.go:125: conn start 127.0.0.1:57610 -> 127.0.0.1:18888 

...

Version

get the version of the build

./ppd version

Response:

root@ubuntu:/mnt/hgfs/code/devnettesting/p2p/sds/target$ ./ppd version
v0.3.0

Terminal

Start a PP(resource) node with interactivity

 ./ppd terminal

This command need to be executed in the PP node folder

Response:

root@ubuntu:~/stratos/sds_sp_test/sds/example/network/node2$ ppd terminal

help                                                            show all the commands
wallets                                                         acquire all wallet wallets' address
newwallet ->password                                            create new wallet, input password in prompt
login <walletAddress> ->password                                unlock and log in wallet, input password in prompt
registerpeer                                                    register peer to index node
rp                                                              register peer to index node
activate <amount> <fee> <gas>                                   send transaction to stchain to become an active PP node
updateStake <stakeDelta> <fee> <gas> <isIncrStake>              send transaction to stchain to update active pp's stake
deactivate <fee> <gas>                                          send transaction to stchain to stop being an active PP node
startmining                                                     start mining
prepay <amount> <fee> <gas>                                     prepay stos to get ozone, amount in ustos
put <filepath>                                                  upload file, need to consume ozone
putstream <filepath>                                            upload video file for streaming, need to consume ozone (alpha version, encode format config impossible)
list <filename>                                                 query uploaded file by self
list                                                            query all files
delete <filehash>                                               delete file
get <sdm://account/filehash>                           download file, need to consume ozone
        e.g: get sdm://st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg/e2ba7fd2390aad9213f2c60854e2b7728c6217309fcc421de5aacc7d4019a4fe
sharefile <filehash> <expiry> <private>                         share an uploaded file
allshare                                                        list all shared files
getsharefile <sharelink> <password>                             download a shared file, need to consume ozone
cancelshare <shareID>                                           cancel a shared file
ver                                                             version
monitor                                                         show monitor
stopmonitor                                                     stop monitor
config  <key> <value>                                           set config key value

AS shown above, a set of commands can be used to communicate with Stratos-chain, SP node as well as other peers under ppd terminal.

help

show all the commands

>help

help                                       show all the commands
wallets                                    acquire all wallet wallets' address
newwallet ->password                       create new wallet, input password in prompt
login <walletAddress> ->password           unlock and log in wallet, input password in prompt
registerpeer                               register peer to index node
rp                                         register peer to index node
activate <amount> <fee> <gas>              send transaction to stchain to become an active PP node
deactivate <fee> <gas>                     send transaction to stchain to stop being an active PP node
startmining                                start mining
prepay <amount> <fee> <gas>                prepay stos to get ozone, amount in ustos
put <filepath>                             upload file, need to consume ozone
putstream <filepath>                       upload video file for streaming, need to consume ozone (alpha version, encode format config impossible)
list <filename>                            query uploaded file by self
list                                       query all files
delete <filehash>                          delete file
get <sdm://account/filehash>      download file, need to consume ozone
        e.g:get sdm://st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg/e2ba7fd2390aad9213f2c60854e2b7728c6217309fcc421de5aacc7d4019a4fe
sharefile <filehash> <expiry> <private>    share an uploaded file
allshare                                   list all shared files
getsharefile <sharelink> <password>        download a shared file, need to consume ozone
cancelshare <shareID>                      cancel a shared file
ver                                        version
monitor                                    show monitor
stopmonitor                                stop monitor
config  <key> <value>                      set config key value

rp, registerpeer

register PP node to SP(meta, or indexing) node

>rp
[INFO]2021/11/01 14:15:03 register_new_pp.go:26: get RspRegisterNewPP
[INFO]2021/11/01 14:15:03 register_new_pp.go:29: get RspRegisterNewPP RES_FAIL already PP, not register needed

wallets

acquire all wallets' address

>wallets
st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg

activate

activate <amount> <fee> <gas>

send transaction to Stratos-chain to become an active PP node

>activate 1000000000 10000 1000000
[INFO]2021/11/01 14:17:29 activate.go:23: Sending activate message to SP! stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt
[INFO]2021/11/01 14:17:29 activate.go:36: get RspActivatePP RES_SUCCESS 
[INFO]2021/11/01 14:17:29 activate.go:42: Current node is already active

prepay

prepay <amount> <fee> <gas>

prepay stos to get ozone, amount in ustos

>prepay 1000000000 10000 600000
[INFO]2021/11/01 14:18:36 prepay.go:22: Sending prepay message to SP! st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg
[INFO]2021/11/01 14:18:36 prepay.go:35: get RspPrepay RES_SUCCESS 
[INFO]2021/11/01 14:18:36 rest.go:185: {"height":"0","txhash":"92FFF988D5A07CA89B0A038A53F0FD819EA0BEBE87749B8150E2C1E27E712301","raw_log":"[]"}
[INFO]2021/11/01 14:18:36 prepay.go:44: The prepay transaction was broadcast

startmining

start mining

>startmining
[INFO]2021/11/01 14:21:43 register_chain.go:93: start mining

put

put <filepath>

upload a file. It will consume ozone

>put /mnt/hgfs/code/devnettesting/p2p/sds/docs/sds_commands.md
[INFO]2021/11/01 15:14:22 requests.go:100: fileName~~~~~~~~~~~~~~~~~~~~~~~~ sds_commands.md
[INFO]2021/11/01 15:14:22 requests.go:102: fileHash~~~~~~~~~~~~~~~~~~~~~~ 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[INFO]2021/11/01 15:14:22 client.go:70: connect success

fileHash: 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
uploaded:100.00 % 
####################################################################################################
[INFO]2021/11/01 15:14:22 upload_slice.go:173: fileHash: 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[INFO]2021/11/01 15:14:22 upload_slice.go:174: uploaded:100.00 % 

[INFO]2021/11/01 15:14:23 transfer_file.go:65: get RspValidateTransferCer
[INFO]2021/11/01 15:14:24 transfer_file.go:196: get RspTransferDownload
[INFO]2021/11/01 15:14:24 transfer_file.go:154: get RspReportTransferResult
[DEBUG]2021/11/01 15:14:24 transfer_file.go:162: transfer successfully!!! 0f7e5f7501f012accccf1dc88bfbeb8ad37d85bbfd9ba82349e0203277d43750

list

query all files

>list
[INFO]2021/11/01 15:15:22 find_file.go:57: _______________________________
[INFO]2021/11/01 15:15:22 find_file.go:62: File name: config.yaml
[INFO]2021/11/01 15:15:22 find_file.go:63: File hash: 9cfa9f8918e746f195e3bbb178abb13ed6908a27ee0c9415118fec1d03165392
[INFO]2021/11/01 15:15:22 find_file.go:65: CreateTime : 1635789177
[INFO]2021/11/01 15:15:22 find_file.go:57: _______________________________
[INFO]2021/11/01 15:15:22 find_file.go:62: File name: sds_commands.md
[INFO]2021/11/01 15:15:22 find_file.go:63: File hash: 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[INFO]2021/11/01 15:15:22 find_file.go:65: CreateTime : 1635794063

list <filename>

query a specific uploaded file by filename

>list config.yaml
[INFO]2021/11/01 14:23:42 find_file.go:57: _______________________________
[INFO]2021/11/01 14:23:42 find_file.go:62: File name: config.yaml
[INFO]2021/11/01 14:23:42 find_file.go:63: File hash: 9cfa9f8918e746f195e3bbb178abb13ed6908a27ee0c9415118fec1d03165392
[INFO]2021/11/01 14:23:42 find_file.go:65: CreateTime : 1635789177

get

get <sdm://account/filehash|filename>

download a file. It will consume ozone

>get sdm://st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg/5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
>[DEBUG]2021/11/01 15:27:17 conn.go:125: read handler: 0xbda1e0 RspQDLF
[INFO]2021/11/01 15:27:17 query_file_info.go:204: get,RspFileStorageInfo
[DEBUG]2021/11/01 15:27:17 requests.go:915: msgBuf len =  464
[DEBUG]2021/11/01 15:27:17 requests.go:921: target =  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"  slice_info:{slice_storage_info:{slice_size:38599  slice_hash:"9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa"}  slice_number:1  visit_result:true  task_id:"4d2b6e7c3eec238c0a106ca630066b18339a975cc04e24a87467ad5335a3cce1"  slice_offset:{slice_offset_end:38599}}  file_hash:"5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68"  file_name:"sds_commands.md"  result:{}  file_size:38599  rest_address:"127.0.0.1:18092"  sign:"\xf3\xf5\x8b\x02\x8d\t\xab\xeb\xb0u\x00\xeaf\xbe\xa0\x94(\x9b\xbf\x04\x82l\xbc\xe3\xdd\xe9\xf1A\x8d-\xc0\xca\xf6a\xb9[Z\x1c\x1a\xdcd\xcbO<$\xf7\x88\xac\x007\xa1\xe9+\x9b\xa6g\xef5\xf2\xbcK\x8c\xb7\x0b"  sp_p2p_address:"stsdsp2p162xm62m75cjv2529p7yydkxmqfwhknslen0wgt"
[DEBUG]2021/11/01 15:27:17 query_file_info.go:208: file hash 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[INFO]2021/11/01 15:27:17 query_file_info.go:212: download starts: 
[DEBUG]2021/11/01 15:27:17 download_slice.go:206: file size:  38599
[DEBUG]2021/11/01 15:27:17 file.go:211: CheckFileExisting: file Hash 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[DEBUG]2021/11/01 15:27:17 file.go:221: filePath sds_commands.md
[DEBUG]2021/11/01 15:27:17 file.go:225: no directory specified, thus no file slices
[DEBUG]2021/11/01 15:27:17 download_slice.go:215: taskid =======  4d2b6e7c3eec238c0a106ca630066b18339a975cc04e24a87467ad5335a3cce1
[DEBUG]2021/11/01 15:27:17 file.go:241: CheckSliceExisting sliceHash 9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa
[DEBUG]2021/11/01 15:27:17 download_slice.go:220: request download data
[DEBUG]2021/11/01 15:27:17 download_slice.go:231: req =  slice_info:{slice_hash:"9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa"  slice_offset:{slice_offset_end:38599}}  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"  file_hash:"5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68"  task_id:"4d2b6e7c3eec238c0a106ca630066b18339a975cc04e24a87467ad5335a3cce1"  req_id:"e252bfca-20bc-4093-aca7-346059ebca05"
[INFO]2021/11/01 15:27:17 client.go:70: connect success
[DEBUG]2021/11/01 15:27:17 conn.go:125: conn start 127.0.0.1:40096 -> 127.0.0.1:18082 

[DEBUG]2021/11/01 15:27:17 client.go:72: on connect
[DEBUG]2021/11/01 15:27:17 conn.go:125: read start
[DEBUG]2021/11/01 15:27:17 download_slice.go:242: WWWWWWWWWWWWWWWWWW &{127.0.0.1:18082 {0xbb5920 0xbb5d40 0xbb5a20 0xbb59a0 100 false true true} 0 0xc0005900d8 0xc000206430 0xc000206440 0xc000cc9020 0xc000cc9080 {0 0} 127.0.0.1:18082 [] 0xc0005a4700 0x50a0c0 <nil> 0 0 0xc000206410 0xc000206418 0 0xc000206420 0 0xc000206428 false}
[DEBUG]2021/11/01 15:27:17 download_slice.go:243: ccccccccccccccc &{127.0.0.1:18082 {0xbb5920 0xbb5d40 0xbb5a20 0xbb59a0 100 false false true} 0 0xc000590028 0xc00056e190 0xc00056e1a0 0xc00007c6c0 0xc00007ca20 {0 0} 127.0.0.1:18082 [] 0xc00051a100 0x50a0c0 0xc0001243f0 0 0 0xc00056e170 0xc00056e178 291 0xc00056e180 0 0xc00056e188 false}
[DEBUG]2021/11/01 15:27:17 query_file_info.go:218: DownloadFileSlice(&target) {{{} [] [] 0xc000141ae8} 0 []  stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg [slice_storage_info:{slice_size:38599  slice_hash:"9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa"}  slice_number:1  visit_result:true  task_id:"4d2b6e7c3eec238c0a106ca630066b18339a975cc04e24a87467ad5335a3cce1"  slice_offset:{slice_offset_end:38599}] 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68 sds_commands.md    38599 false 127.0.0.1:18092 [243 245 139 2 141 9 171 235 176 117 0 234 102 190 160 148 40 155 191 4 130 108 188 227 221 233 241 65 141 45 192 202 246 97 185 91 90 28 26 220 100 203 79 60 36 247 136 172 0 55 161 233 43 155 166 103 239 53 242 188 75 140 183 11] stsdsp2p162xm62m75cjv2529p7yydkxmqfwhknslen0wgt}
[INFO]2021/11/01 15:27:17 pp.go:46: on connect
[INFO]2021/11/01 15:27:17 download_slice.go:27: ReqDownloadSlice &{1 0xc00002e000 0xc0005900e0 0xc000206700 0xc000206710 0xc000cc92c0 0xc000cc9320 {0 0} 127.0.0.1:55524 1635794837534299003 0xc0005a4780 0x50a0c0}
[DEBUG]2021/11/01 15:27:17 requests.go:915: msgBuf len =  336
[DEBUG]2021/11/01 15:27:17 requests.go:921: target =  slice_info:{slice_hash:"9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa"  slice_offset:{slice_offset_end:38599}}  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"  file_hash:"5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68"  task_id:"4d2b6e7c3eec238c0a106ca630066b18339a975cc04e24a87467ad5335a3cce1"  req_id:"e252bfca-20bc-4093-aca7-346059ebca05"
[DEBUG]2021/11/01 15:27:17 download_slice.go:63: storagePP received ReqDownloadSlice,send data to PP 
[DEBUG]2021/11/01 15:27:17 download_slice.go:82: dataLen========= 38599
[DEBUG]2021/11/01 15:27:17 download_slice.go:88: _____________________________
[DEBUG]2021/11/01 15:27:17 download_slice.go:89: 0 3145728 0 3145728
[DEBUG]2021/11/01 15:27:17 requests.go:443: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~reqReportTaskBPDatareqReportTaskBPData  taskID == 4d2b6e7c3eec238c0a106ca630066b18339a975cc04e24a87467ad5335a3cce1 traffic ==  38599
[DEBUG]2021/11/01 15:27:17 download_slice.go:70: reqReportTaskBPDatareqReportTaskBPDatareqReportTaskBPData
[DEBUG]2021/11/01 15:27:17 conn.go:125: read handler: 0xbc75a0 RspDLFS
[DEBUG]2021/11/01 15:27:17 download_slice.go:105: get RspDownloadSlice
[DEBUG]2021/11/01 15:27:17 requests.go:915: msgBuf len =  38951
[DEBUG]2021/11/01 15:27:17 requests.go:923: analyse target
[DEBUG]2021/11/01 15:27:17 download_slice.go:133: get a slice -------
[DEBUG]2021/11/01 15:27:17 download_slice.go:134: SliceHash 9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa
[DEBUG]2021/11/01 15:27:17 download_slice.go:135: SliceOffset slice_offset_end:38599
[DEBUG]2021/11/01 15:27:17 download_slice.go:136: length 38599
[DEBUG]2021/11/01 15:27:17 download_slice.go:137: sliceSize 38599
downloaded:100.00 % 
####################################################################################################
[DEBUG]2021/11/01 15:27:17 file.go:128: sliceHash 9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa
[DEBUG]2021/11/01 15:27:17 download_task.go:250: CheckDownloadOver
[DEBUG]2021/11/01 15:27:18 download_task.go:230: CheckFileOver
[DEBUG]2021/11/01 15:27:18 download_task.go:237: info 0
[DEBUG]2021/11/01 15:27:18 download_task.go:238: sp.TotalSize 38599
[DEBUG]2021/11/01 15:27:18 download_slice.go:184: ReportDownloadResult report result target.FileHash =  5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[DEBUG]2021/11/01 15:27:18 requests.go:281: ################################################################# 9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa
[DEBUG]2021/11/01 15:27:18 setting.go:173: GetSign ==  [192 31 193 71 244 172 159 36 181 162 44 77 177 22 85 54 65 15 171 187 240 198 240 68 102 32 120 56 163 1 252 248 195 175 125 11 216 21 166 224 239 111 132 228 73 209 56 66 248 162 123 195 173 36 152 31 143 248 32 40 107 101 85 9]
[DEBUG]2021/11/01 15:27:18 requests.go:443: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~reqReportTaskBPDatareqReportTaskBPData  taskID == 4d2b6e7c3eec238c0a106ca630066b18339a975cc04e24a87467ad5335a3cce1 traffic ==  38599
[DEBUG]2021/11/01 15:27:18 download_slice.go:189: reqReportTaskBPDatareqReportTaskBPDatareqReportTaskBPData
[DEBUG]2021/11/01 15:27:18 conn.go:125: read handler: 0xbc8a20 RspDLRep
[DEBUG]2021/11/01 15:27:18 download_slice.go:249: get RspReportDownloadResult
[DEBUG]2021/11/01 15:27:18 requests.go:915: msgBuf len =  72
[DEBUG]2021/11/01 15:27:18 requests.go:921: target =  result:{}  slice_info:{slice_storage_info:{slice_hash:"9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa"}}
[DEBUG]2021/11/01 15:27:18 download_slice.go:252: result RES_SUCCESS 
[DEBUG]2021/11/01 15:27:20 download_task.go:230: CheckFileOver
[DEBUG]2021/11/01 15:27:20 download_task.go:237: info 38599
[DEBUG]2021/11/01 15:27:20 download_task.go:238: sp.TotalSize 38599
[DEBUG]2021/11/01 15:27:20 download_task.go:240: ok!
————————————————————————————————————————————————————
download finished
————————————————————————————————————————————————————

sharefile

sharefile <filehash> <expiry> <private>

share an uploaded file

>sharefile 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68 6000 0
[INFO]2021/11/01 15:33:09 share.go:93: ShareId 3f1a942f942fd33b
[INFO]2021/11/01 15:33:09 share.go:94: ShareLink Y3AagF_3f1a942f942fd33b
[INFO]2021/11/01 15:33:09 share.go:95: SharePassword 

allshare

list all shared files

>allshare
[INFO]2021/11/01 15:34:18 share.go:62: _______________________________
[INFO]2021/11/01 15:34:18 share.go:63: file_name: sds_commands.md
[INFO]2021/11/01 15:34:18 share.go:64: file_hash: 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[INFO]2021/11/01 15:34:18 share.go:65: file_size: 38599
[INFO]2021/11/01 15:34:18 share.go:66: link_time: 1635795189
[INFO]2021/11/01 15:34:18 share.go:67: link_time_exp: 1635801189
[INFO]2021/11/01 15:34:18 share.go:68: ShareId: 3f1a942f942fd33b
[INFO]2021/11/01 15:34:18 share.go:69: ShareLink: Y3AagF_3f1a942f942fd33b

getsharefile

getsharefile <sharelink> <password>

download a shared file, need to consume ozone

>getsharefile Y3AagF_3f1a942f942fd33b
[DEBUG]2021/11/01 15:38:48 share.go:132: GetShareFile for file  Y3AagF_3f1a942f942fd33b
>[DEBUG]2021/11/01 15:38:48 conn.go:125: read handler: 0xbdd800 RspGSF
[DEBUG]2021/11/01 15:38:48 requests.go:915: msgBuf len =  277
[DEBUG]2021/11/01 15:38:48 requests.go:921: target =  share_request:{keyword:"Y3AagF_3f1a942f942fd33b"  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"}  result:{msg:"request success"}  file_info:{file_size:38599  file_hash:"5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68"  file_name:"sds_commands.md"  create_time:1635795189  owner_wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"}
[INFO]2021/11/01 15:38:48 share.go:160: get RspGetShareFile RES_SUCCESS request success
[INFO]2021/11/01 15:38:48 share.go:165: FileInfo: [file_size:38599  file_hash:"5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68"  file_name:"sds_commands.md"  create_time:1635795189  owner_wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"]
[DEBUG]2021/11/01 15:38:48 setting.go:173: GetSign ==  [20 226 33 232 148 245 175 153 186 207 40 206 204 4 246 171 40 130 4 34 124 106 115 121 226 90 6 150 237 51 207 226 165 143 3 75 21 164 101 33 20 116 194 205 98 33 31 181 131 69 9 42 104 52 161 52 176 140 252 204 52 97 208 11]
[DEBUG]2021/11/01 15:38:50 conn.go:125: read handler: 0xbda1e0 RspQDLF
[INFO]2021/11/01 15:38:50 query_file_info.go:204: get,RspFileStorageInfo
[DEBUG]2021/11/01 15:38:50 requests.go:915: msgBuf len =  464
[DEBUG]2021/11/01 15:38:50 requests.go:921: target =  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"  slice_info:{slice_storage_info:{slice_size:38599  slice_hash:"9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa"}  slice_number:1  visit_result:true  task_id:"53e62dc6f79a09fbb8672d14d663ff3276593a402edc4ba359f9a02364f1eef3"  slice_offset:{slice_offset_end:38599}}  file_hash:"5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68"  file_name:"sds_commands.md"  result:{}  file_size:38599  rest_address:"127.0.0.1:18092"  sign:"\xf3\xf5\x8b\x02\x8d\t\xab\xeb\xb0u\x00\xeaf\xbe\xa0\x94(\x9b\xbf\x04\x82l\xbc\xe3\xdd\xe9\xf1A\x8d-\xc0\xca\xf6a\xb9[Z\x1c\x1a\xdcd\xcbO<$\xf7\x88\xac\x007\xa1\xe9+\x9b\xa6g\xef5\xf2\xbcK\x8c\xb7\x0b"  sp_p2p_address:"stsdsp2p162xm62m75cjv2529p7yydkxmqfwhknslen0wgt"
[DEBUG]2021/11/01 15:38:50 query_file_info.go:208: file hash 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[INFO]2021/11/01 15:38:50 query_file_info.go:212: download starts: 
[DEBUG]2021/11/01 15:38:50 download_slice.go:206: file size:  38599
[DEBUG]2021/11/01 15:38:50 file.go:211: CheckFileExisting: file Hash 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[DEBUG]2021/11/01 15:38:50 file.go:221: filePath sds_commands.md
[DEBUG]2021/11/01 15:38:50 file.go:230: hash 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[DEBUG]2021/11/01 15:38:50 file.go:232: file hash matched
file exist already!
[DEBUG]2021/11/01 15:38:50 query_file_info.go:218: DownloadFileSlice(&target) {{{} [] [] 0xc000141ae8} 0 []  stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg [slice_storage_info:{slice_size:38599  slice_hash:"9a5b9d532f46bd07cc2300c3eebbbddb6abfdb11854642adc3f3032ae2aca1aa"}  slice_number:1  visit_result:true  task_id:"53e62dc6f79a09fbb8672d14d663ff3276593a402edc4ba359f9a02364f1eef3"  slice_offset:{slice_offset_end:38599}] 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68 sds_commands.md    38599 false 127.0.0.1:18092 [243 245 139 2 141 9 171 235 176 117 0 234 102 190 160 148 40 155 191 4 130 108 188 227 221 233 241 65 141 45 192 202 246 97 185 91 90 28 26 220 100 203 79 60 36 247 136 172 0 55 161 233 43 155 166 103 239 53 242 188 75 140 183 11] stsdsp2p162xm62m75cjv2529p7yydkxmqfwhknslen0wgt}

cancelshare

cancelshare <shareID>

cancel a shared file

>cancelshare 3f1a942f942fd33b
>[DEBUG]2021/11/01 15:42:31 conn.go:125: read handler: 0xbdd1e0 RspDSF
[DEBUG]2021/11/01 15:42:31 requests.go:915: msgBuf len =  112
[DEBUG]2021/11/01 15:42:31 requests.go:921: target =  share_id:"3f1a942f942fd33b"  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"  result:{}
[INFO]2021/11/01 15:42:31 share.go:118: cancel share success: 3f1a942f942fd33b

>allshare
>[DEBUG]2021/11/01 15:42:59 conn.go:125: read handler: 0xbdc760 RspSL
[DEBUG]2021/11/01 15:42:59 share.go:56: RspShareLink(ctx context.Context, conn core.WriteCloser) {RspShareLink(ctx context.Context, conn core.WriteCloser) {
[DEBUG]2021/11/01 15:42:59 requests.go:915: msgBuf len =  94
[DEBUG]2021/11/01 15:42:59 requests.go:921: target =  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"  result:{}

delete

delete <filehash>

delete a file

>delete 5913fe47e26243cb9e65e67d070f41aa1e7425487e5be1081a68b85109197e68
[DEBUG]2021/11/01 15:45:40 setting.go:173: GetSign ==  [192 31 193 71 244 172 159 36 181 162 44 77 177 22 85 54 65 15 171 187 240 198 240 68 102 32 120 56 163 1 252 248 195 175 125 11 216 21 166 224 239 111 132 228 73 209 56 66 248 162 123 195 173 36 152 31 143 248 32 40 107 101 85 9]
>[DEBUG]2021/11/01 15:45:41 conn.go:125: read handler: 0xbc4900 RspDF
[DEBUG]2021/11/01 15:45:41 requests.go:915: msgBuf len =  94
[DEBUG]2021/11/01 15:45:41 requests.go:921: target =  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  wallet_address:"st1jn9skjsnxv26mekd8eu8a8aquh34v0m4mwgahg"  result:{}
delete success

monitor

show monitor

>monitor
>__________________________________________________________________________
        Mem         : 12073 MB  Free: 6188 MB Used:5599 Usage:46.376039%
        CPU          : Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz   1 cores 
        CPU          : Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz   1 cores 
        CPU          : Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz   1 cores 
        CPU          : Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz   1 cores 
        CPU Used    : 18.694362% 
        HD          : 137 GB  Free: 101 GB Usage:22.446849%
        Upload      : 0.000000 MB/s 
        Download    : 0.000000 MB/s 
__________________________________________________________________________

newwallet

newwallet <nodeName> <hdPath>

create new wallet, input password in prompt

>newwallet ericNode m/44'/606'/0'/0/0
input password
Passphrase: 
Repeat passphrase: 
input bip39 mnemonic (leave blank to generate a new one)
Passphrase: 
input bip39 passphrase
Passphrase: 
[INFO]2021/11/02 11:07:24 setting.go:251: finished changing configuration file  WalletAddress:  st1mnmm8rs7hrxcndk93sduhcx6q6msegjnps2zep
[DEBUG]2021/11/02 11:07:24 account.go:91: publicKey [4 251 244 213 164 118 62 66 127 125 119 222 118 79 152 225 0 244 63 94 47 144 202 244 238 113 17 221 136 226 69 49 188 112 134 79 100 210 169 31 51 141 229 143 240 236 225 63 150 169 107 11 114 104 252 25 94 40 123 196 45 202 107 224 224]
unlock wallet successfully  st1mnmm8rs7hrxcndk93sduhcx6q6msegjnps2zep
[INFO]2021/11/02 11:07:24 account.go:41: Create account success , st1mnmm8rs7hrxcndk93sduhcx6q6msegjnps2zep

login

login <>wallet-address>

unlock and log in wallet, input password in prompt

>login st1mnmm8rs7hrxcndk93sduhcx6q6msegjnps2zep
input password
Passphrase: 
[DEBUG]2021/11/02 11:11:16 account.go:118: walletAddress =  st1mnmm8rs7hrxcndk93sduhcx6q6msegjnps2zep
[INFO]2021/11/02 11:11:16 account.go:139: st1mnmm8rs7hrxcndk93sduhcx6q6msegjnps2zep.json
[DEBUG]2021/11/02 11:11:16 account.go:91: publicKey [4 251 244 213 164 118 62 66 127 125 119 222 118 79 152 225 0 244 63 94 47 144 202 244 238 113 17 221 136 226 69 49 188 112 134 79 100 210 169 31 51 141 229 143 240 236 225 63 150 169 107 11 114 104 252 25 94 40 123 196 45 202 107 224 224]
unlock wallet successfully  st1mnmm8rs7hrxcndk93sduhcx6q6msegjnps2zep
[DEBUG]2021/11/02 11:11:16 start.go:24: InitPeer InitPeerInitPeer InitPeerInitPeer InitPeer
[DEBUG]2021/11/02 11:11:16 sp_peers.go:86: SendMessage(client.SPConn, req, header.ReqGetSPList)
[INFO]2021/11/02 11:11:16 client.go:70: connect success
[DEBUG]2021/11/02 11:11:16 conn.go:125: conn start 127.0.0.1:41254 -> 127.0.0.1:18082 

[DEBUG]2021/11/02 11:11:16 client.go:72: on connect
[INFO]2021/11/02 11:11:16 start.go:39: SendMessage(conn, req, header.ReqRegister) to PP
[DEBUG]2021/11/02 11:11:16 conn.go:125: read start
>[DEBUG]2021/11/02 11:11:16 conn.go:125: read handler: 0xbcd8a0 RspGSPL
[DEBUG]2021/11/02 11:11:16 get_splist.go:19: get GetSPList RSP
[DEBUG]2021/11/02 11:11:16 requests.go:915: msgBuf len =  2
[DEBUG]2021/11/02 11:11:16 requests.go:921: target =  result:{}
[DEBUG]2021/11/02 11:11:16 get_splist.go:24: get GetSPList RSP []
[DEBUG]2021/11/02 11:11:16 conn.go:125: read handler: 0xbda820 RspReg
[INFO]2021/11/02 11:11:17 register_chain.go:52: get RspRegister &{127.0.0.1:18082 {0xbb5920 0xbb5d40 0xbb5a20 0xbb59a0 100 false false true} 0 0xc000010060 0xc000264940 0xc000264950 0xc000c42840 0xc000c428a0 {0 0} 127.0.0.1:18082 [] 0xc000498480 0x50a0c0 0xc00014ab60 69 0 0xc000264920 0xc000264928 272 0xc000264930 0 0xc000264938 false}
[DEBUG]2021/11/02 11:11:17 requests.go:915: msgBuf len =  53
[DEBUG]2021/11/02 11:11:17 requests.go:921: target =  result:{}  p2p_address:"stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt"  isPP:true
[INFO]2021/11/02 11:11:17 register_chain.go:57: target.RspRegister stsdsp2p1gl9ywg6jdfdgcja70ffum4ectq4fmt26n6z7tt
[INFO]2021/11/02 11:11:17 register_chain.go:64: get RspRegister  RES_SUCCESS 
[INFO]2021/11/02 11:11:17 register_chain.go:72: login successful 
[DEBUG]2021/11/02 11:11:17 register_chain.go:74: @@@@@@@@@@@@@@@@@@@@@@@@@@@@ 127.0.0.1:18082
[DEBUG]2021/11/02 11:11:17 start.go:48: Sending ReqMining message to SP
[DEBUG]2021/11/02 11:11:17 setting.go:173: GetSign ==  [193 179 149 3 47 77 1 146 0 20 202 53 79 73 164 127 70 5 9 239 115 82 191 215 34 37 14 227 209 224 92 133 238 68 211 218 228 119 186 158 75 171 156 115 38 24 255 84 204 139 224 24 250 159 18 175 254 234 29 96 121 236 75 6]
[DEBUG]2021/11/02 11:11:17 conn.go:125: read handler: 0xbdae00 RspMin
[DEBUG]2021/11/02 11:11:17 register_chain.go:89: get RspMining &{127.0.0.1:8888 {0xbb5920 0xbb5d40 0xbb5a20 0xbb59a0 100 false false true} 0 0xc000272910 0xc0001308b0 0xc000130910 0xc0004d17a0 0xc0004d1800 {0 0} 127.0.0.1:8888 [] 0xc000150380 0x50a0c0 0xc0002fa540 18 18 0xc000130890 0xc000130898 244 0xc0001308a0 127 0xc0001308a8 false}
[DEBUG]2021/11/02 11:11:17 requests.go:915: msgBuf len =  2
[DEBUG]2021/11/02 11:11:17 requests.go:921: target =  result:{}
[INFO]2021/11/02 11:11:17 register_chain.go:93: start mining
[DEBUG]2021/11/02 11:11:17 register_chain.go:108: Start reporting node status to SP

config

config <key> <value>

set config key value, separated by one space

>config NetworkAddress 3.12.6.122:8888
[INFO]2021/11/02 11:50:00 setting.go:251: finished changing configuration file  NetworkAddress:  3.12.6.122:8888

Last updated