This article will introduce in detail the use of the command line function of the keeper-Node of the MEMO system; the keeper needs to download the binary and execute the program 'mefs-keeper' to start a Memo keeper-Node.
Usage
Use the following command to view all commands
mefs-keeper -h
COMMANDS:
init Initialize a memoriae repo
daemon Run a network-connected Memoriae node.
auth Interact with auth
wallet Interact with wallet
net Interact with net
config Interact with config
state Interact with state manager
role Interact with role manager
info print information of this node
register register an account id for the wallet first, then register a role for it, at last, add it into a group.
version Print version
backup backup export or import
bootstrap bootstrap
recover recover
log Manage logging
settle Interact with settlement chain
order Interact with order
restrict Interact with restrict
transfer transfer eth or memo
help, h Shows a list of commands or help for one command
Used to create a wallet in the specified path. If the wallet information already exists in this path, the existing wallet will be used directly without recreating the wallet. Assign the MEFS_PATH environment virable to specify a path for this node.
Usage
mefs-keeper init -h
Options
--setPass set password using input (default: false)
--password value, --pwd value set password for access secret key (default: "memoriae")
--secretKey value, --sk value secret key
--keyfile value, --kf value absolute path of keyfile
--kpw value password to decrypt keyfile
--help, -h show help (default: false)
The command is used to start and stop an keeper-Node
Usage
mefs-keeper daemon start -h
COMMANDS:
start Start a running mefs daemon
stop Stop a running mefs daemon
help, h Shows a list of commands or help for one command
Options
--password value, --pwd value Use the password when registering (default: memoriae)
--api value Set the api address to use (default: /ip4/127.0.0.1/tcp/5001)
--secretKey value, --sk value Use the private key to create the node, if not, please initialize the node
--swarm-port value Set the swarm port to be used by the node (default: 4001)
--group value Set the group the node will enter (default: 0 )
--price value set the price (default: 0, means not modify the price in config.json)
--secureAPI Whether it is a secure API (default: true)
--help, -h View more help
This command implements the related functions of operating the wallet.
Usage
mefs-keeper wallet -h
COMMANDS:
new create a new wallet address
list list all addrs
default print default wallet address
export export wallet secret key
help, h Shows a list of commands or help for one command
This command is used to modify the configuration file, which takes effect only when the node is not started; if the config is modified while the node is running, the node needs to be restarted to make it take effect;
The path where the configuration file is located: config.json in the root directory of the node which is specified when init the node.
Usage
mefs-keeper config -h
COMMANDS:
set Set config key
get Get config key
help, h Shows a list of commands or help for one command
The set subcommand is used to set the value of the specified option in the configuration file
Usage
mefs-keeper config set -h
Options
--key value The key of the config entry (eg "api.address")
--value value The value with which to set the config entry
--help, -h show help (default: false)
Example
Configure the value of contract.endPoint
mefs-keeper config set --key=contract.endPoint --value="https://testchain.metamemo.one:24180"
This command is used to set the bootstrap node in the configuration file, multiple bootstrap nodes can be added.
Usage
mefs-keeper bootstrap -h
COMMANDS:
list list bootstrap addresses
add add bootstrap addresses
clear remove all bootstrap addresses
help, h Shows a list of commands or help for one command
./mefs-keeper net -h
COMMANDS:
info get net info
connect connet a peer
peers print peers
findpeer find peers
declare declare public network address
help, h Shows a list of commands or help for one command
mefs-keeper info -h
USAGE:
mefs-keeper info command [command options] [arguments...]
COMMANDS:
self print node id
help, h Shows a list of commands or help for one command
Example
mefs-keeper net info
Network ID 12D3K..., IP [/ip4/172.xx.xx.xx/tcp/4001 /ip4/128.xx.xx.xx/tcp/39525 /ip4/10.xx.xx.xx/tcp/39525], Type: Private
This command interacts with state db to obtain pay and penalty information about this node, or settle current income of this node.
Usage
mefs-provider state -h
COMMANDS:
post list post
pay list pay
withdraw provider income of storing data
help, h Shows a list of commands or help for one command
mefs-keeper settle -h
COMMANDS:
setDesc Set description for a node. Especially for keepers, if desc is set to 'cloud', they will be selected as dc in buckets preferentially.
withdraw withdraw memo from fs
pledgeAdd add pledge value
pledgeGet get pledge information
pledgeWithdraw move pledge value to fs, then call settle withdraw
pledgeRewardWithdraw move pledge reward value to fs, then call settle withdraw
quitRole change its state to inactive, this op is invocatable and daemon will fail at next start
alterPayee alter current payee to a new one, need to be comfirmed by new payee to finish.
help, h Shows a list of commands or help for one command
Subcommands
Note
About parameter 'amount' in subcommands
Quotes should be used for the amount parameter, and there must be a space between the amount and the unit. The unit is not case-sensitive. It can be Memo, NanoMemo, AttoMemo. The relationship between them is: 1 Memo=10^9 NanoMemo=10 ^ 18 AttoMemo
This command makes the node exit the current role. Wallet address and the balance in it is not effected.
Caution
Role-related functions will no longer be available at this time. However, the wallet balance will not be affected. For keepers and keepers, the role pledge amount provided when registering the role can be withdrawn after run quitRole.
It is used to repair the db as much as possible when the node starts abnormally. Warning: Do not exit the node abnormally. When you want to exit the node, you should use the daemon stop command to exit normally. Failure to do so may result in db corruption beyond repair
Usage
mefs-keeper recover db -h
--path specifies the database path to repair --deType the type of repair data (meta or state)
Example
Repair state database
mefs-keeper recover db --path=/root/.memo-keeper/state --dbType=state
Export the state database to a file, using the following method:
Usage
mefs-keeper backup export -h
USAGE:
mefs-keeper backup export [command options] [arguments...]
OPTIONS:
--path value path to store
--dbType value export dbtype: meta or state (default: "state")
--help, -h show help (default: false)
Example
Export the state database to the current directory
To import a database from a file, use the following method:
Usage
mefs-keeper backup import -h
USAGE:
mefs-keeper backup import [command options] [arguments...]
OPTIONS:
--path value path of file import from
--dbType value export dbtype: meta or state (default: "state")
--help, -h show help (default: false)
The keeper node sets the whitelist function. When creating a bucket, the nodes in the whitelist are given priority.
Usage
mefs-keeper restrict -h
USAGE:
mefs-keeper restrict command [command options] [arguments...]
COMMANDS:
list list all accepted keepers/keepers
add add node(s) to restrict list
delete remove node(s) from restrict list
has test whether node(s) in restrict list
set enable/disable restrict
stat restrict stat(enable/disable)
help, h Shows a list of commands or help for one command
Query the value of the token file of the node. The token file is located in the root directory of the node. Ordinary keepers do not need to pay attention to this value.
Usage
mefs-keeper auth info -h
USAGE:
mefs-keeper restrict command [command options] [arguments...]
COMMANDS:
list list all accepted keepers/keepers
add add node(s) to restrict list
delete remove node(s) from restrict list
has test whether node(s) in restrict list
set enable/disable restrict
stat restrict stat(enable/disable)
help, h Shows a list of commands or help for one command
This command is used to set the log level. Different levels display log information of different alarm levels. The default is info level, which only displays normal status information. Ordinary keepers should use info log level. The debug/warn/error level is used by developers to view detailed error logs. This level will generate a large number of logs and cannot be in debug mode for a long time, otherwise it will take up a lot of disk space. It is not recommended for ordinary keepers to use.