# How to use venus messager

messager is a component used to manage local messages, with the purpose of saving address messages, managing message status, and controlling the frequency of push messages.

# Getting start

# Clone this git repository to your machine

git clone https://github.com/filecoin-project/venus-messager.git

# Install Dependencies and Build

make

# Run messager

./venus-messager --config=xx.toml run [options]

  • Specify the directory of the configuration file by --config=xxx.toml,default: ./messager.toml
  • If the specified configuration file does not exist at startup, a configuration file with the corresponding name will be generated and the value of the set parameter will be written to the configuration file
  • When the specified configuration file exists at startup, the values of the set parameters will be used, but will not be written to the configuration file. If the parameters are not set, the values of the parameters in the configuration file will be used
options:
  --auth-url           url for auth server
  --auth-token         token for auth server
  --node-url           url for connection lotus/venus
  --node-token         token auth for lotus/venus
  --db-type            which db to use. sqlite/mysql
  --sqlite-path        sqlite db file. eg. ~/sqlite/message.db
  --mysql-dsn          mysql connection string
  --gateway-url        url for gateway server
  --gateway-token      token for gateway server
  --rate-limit-redis   limit flow using redis

# Commands

# Message commands

  1. search message
./venus-messager msg search --id=<message id>
  1. list message
./venus-messager msg list
# list messages with the same address
./venus-messager msg list --from <address>
  1. update one filled message state
./venus-messager msg update_filled_msg --id=<message id>
  1. update all filled message state
./venus-messager msg update_all_filled_msg
  1. wait a message result by id
./venus-messager msg wait <message id>
  1. republish a message by id
./venus-messager msg republish <message id>
  1. replace a message
./venus-messager msg replace --gas-feecap=[gas-feecap] --gas-premium=[gas-premium] --gas-limit=[gas-limit] --auto=[auto] --max-fee=[max-fee] <message-id>
# or
./venus-messager msg replace --gas-feecap=[gas-feecap] --gas-premium=[gas-premium] --gas-limit=[gas-limit] --auto=[auto] --max-fee=[max-fee] <from> <nonce>
  1. list failed messages, maybe signed message failed or gas estimate failed
./venus-messager msg list-fail
  1. lists message that have not been chained for a period of time
./venus-messager msg list-blocked
  1. manual mark error messages
./venus-messager msg mark-bad <message id>

# Address commands

  1. search address
./venus-messager address search <address>
  1. list address
./venus-messager address list
  1. reset address

The nonce of the address is set to nonce on the chain, and all unchain messages are marked as failed messages

./venus-messager reset <address>
  1. forbidden address
./venus-messager address forbidden <address>
  1. activate a frozen address
./venus-messager address active <address>
  1. set the number of address selection messages
./venus-messager address set-sel-msg-num --num=5 <address>
  1. set parameters related to address fee

venus message address set-fee-params [options] address

 # options
 # --gas-overestimation value  Estimate the coefficient of gas (default: 0)
 # --max-feecap value          Max feecap for a message (burn and pay to miner, attoFIL/GasUnit)
 # --max-fee value             Spend up to X attoFIL for message

./venus-messager address set-fee-params <address>

# shared params commands

  1. get shared params
./venus-messager share-params get
  1. set shared params
./venus-messager share-params set --gas-over-estimation=1.25 --max-feecap="0" --max-fee="7000000000000000" --sel-msg-num=20
  1. manual refresh shared params from DB
./venus-messager share-params refresh

# node commands

  1. search node info by name
./venus-messager node search <name>
  1. add node info
./venus-messager node add --name=<node-name> --url=<node-url> --token=<node-token>
  1. list node info
./venus-messager node list
  1. del node info by name
./venus-messager node del <name>

# log

  1. set log level
# eg. trace,debug,info,warn|warning,error,fatal,panic
./venus-messager log set-level

# send 命令

send message venus-messager send [command options] [targetAddress] [amount]

   options:
   --from value         optionally specify the address to send
   --gas-premium value  specify gas price to use in AttoFIL (default: "0")
   --gas-feecap value   specify gas fee cap to use in AttoFIL (default: "0")
   --gas-limit value    specify gas limit (default: 0)
   --method value       specify method to invoke (default: 0)
   --params-json value  specify invocation parameters in json
   --params-hex value   specify invocation parameters in hex
   --account value      optionally specify the account to send