Create default configuration file for a PP(resource) node
node folder is the folder that contains configs and accounts of the PP node. An PP node folder usually looks like
Response:
After the execution of this command, a configs/config.yaml file will be generated under the node folder.
The node folder looks like:
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
for Stratos Testnet, set NetworkAddress as:
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
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
Response:
Version
get the version of the build
Response:
Terminal
Start a PP(resource) node with interactivity
This command need to be executed in the PPnode folder
Response:
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
rp,registerpeer
register PP node to SP(meta, or indexing) node
wallets
acquire all wallets' address
activate
activate <amount> <fee> <gas>
send transaction to Stratos-chain to become an active PP node
prepay
prepay <amount> <fee> <gas>
prepay stos to get ozone, amount in ustos
startmining
start mining
put
put <filepath>
upload a file. It will consume ozone
list
query all files
list <filename>
query a specific uploaded file by filename
get
get <sdm://account/filehash|filename>
download a file. It will consume ozone
sharefile
sharefile <filehash> <expiry> <private>
share an uploaded file
allshare
list all shared files
getsharefile
getsharefile <sharelink> <password>
download a shared file, need to consume ozone
cancelshare
cancelshare <shareID>
cancel a shared file
delete
delete <filehash>
delete a file
monitor
show monitor
newwallet
newwallet <nodeName> <hdPath>
create new wallet, input password in prompt
login
login <>wallet-address>
unlock and log in wallet, input password in prompt
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
=======================================================================
root@ubuntu:/mnt/hgfs/code/devnettesting/p2p/sds/target$ ./ppd version
v0.3.0
./ppd terminal
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
>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
[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