# How to use sophon 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/ipfs-force-community/sophon-messager.git
# Install Dependencies and Build
make
# Run messager
./sophon-messager run [options]
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
--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
- search message
./sophon-messager msg search --id=<message id>
- list message
./sophon-messager msg list
# list messages with the same address
./sophon-messager msg list --from <address>
- update one filled message state
./sophon-messager msg update_filled_msg --id=<message id>
- update all filled message state
./sophon-messager msg update_all_filled_msg
- wait a message result by id
./sophon-messager msg wait <message id>
- republish a message by id
./sophon-messager msg republish <message id>
- replace a message
./sophon-messager msg replace --gas-feecap=[gas-feecap] --gas-premium=[gas-premium] --gas-limit=[gas-limit] --auto=[auto] --max-fee=[max-fee] <message-id>
# or
./sophon-messager msg replace --gas-feecap=[gas-feecap] --gas-premium=[gas-premium] --gas-limit=[gas-limit] --auto=[auto] --max-fee=[max-fee] <from> <nonce>
- list failed messages, maybe signed message failed or gas estimate failed
./sophon-messager msg list-fail
- lists message that have not been chained for a period of time
./sophon-messager msg list-blocked
- manual mark error messages
./sophon-messager msg mark-bad <message id>
# Address commands
- search address
./sophon-messager address search <address>
- list address
./sophon-messager address list
- reset address
The nonce of the address is set to nonce on the chain, and all unchain messages are marked as failed messages
./sophon-messager reset <address>
- forbidden address
./sophon-messager address forbidden <address>
- activate a frozen address
./sophon-messager address active <address>
- set the number of address selection messages
./sophon-messager address set-sel-msg-num --num=5 <address>
- set parameters related to address fee
sophon-messager address set-fee-params [options] address
# options
# --gas-overestimation value Estimate the coefficient of gas (default: 0)
# --gas-feecap value Gas feecap for a message (burn and pay to miner, attoFIL/GasUnit)
# --max-fee value Spend up to X attoFIL for message
# --gas-over-premium value Coefficient of gas premium (default: 0)
./sophon-messager address set-fee-params <address>
# shared params commands
- get shared params
./sophon-messager share-params get
- set shared params
./sophon-messager share-params set --gas-over-estimation=1.25 --gas-feecap="0" --max-fee="7000000000000000" --sel-msg-num=20 --gas-over-premium 1
- manual refresh shared params from DB
./sophon-messager share-params refresh
# node commands
- search node info by name
./sophon-messager node search <name>
- add node info
./sophon-messager node add --name=<node-name> --url=<node-url> --token=<node-token>
- list node info
./sophon-messager node list
- del node info by name
./sophon-messager node del <name>
# log
- set log level
# eg. trace,debug,info,warn|warning,error,fatal,panic
./sophon-messager log set-level
# send 命令
send message sophon-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