Command Line Options - Second-Earth/setchain GitHub Wiki

Command Line Options

set

set is a Leading High-performance Ledger

set is a Leading High-performance Ledger

Usage:
  set [flags]
  set [command]

Available Commands:
  chain state clipping enable or disable
  debug pprof debug
  export Export block data to file
  help show help
  import import block data
  init initializes the genesis block
  miner control mining command
  p2p P2P network setting and query
  txpool query txpool status and set txpool minimum gas price
  version Display version information

Flags:
  -c, --config string TOML/YAML configuration file
      --contractlog bool store internal transaction log switch (default false)
      --database_cache int Database memory cache allocation (unit: MB) (default 768)
  -d, --datadir string data storage directory (default "$HOME/.set_ledger")
      --debug_blockprofilerate int Turn on block profiling at the specified frequency
      --debug_cpuprofile string Write the CPU profile to the specified file
      --debug_memprofilerate int Turn on memory profiling at the specified frequency (default 524288)
      --debug_pprof enable pprof HTTP server
      --debug_pprof_addr string pprof HTTP server listening address (default "localhost")
      --debug_pprof_port int pprof HTTP server listening port (default 6060)
      --debug_trace string Write execution trace to the specified file
  -g, --genesis string Genesis block json file
      --gpo_blocks int The number of recent blocks used to check the gas price (default 20)
      --gpo_percentile int It is recommended that the gas price refer to the percentile of the most recently traded gas price (default 60)
  -h, --help show help
      --http_cors strings The list of domain names that allow cross-domain requests (default [*])
      --http_host string HTTP RPC server address (default "localhost")
      --http_modules strings are based on the API provided by the HTTP RPC interface (default [set,dpos,fee,account])
      --http_port int HTTP RPC server port (default 8545)
      --http_vhosts strings HTTP RPC virtual address (default [localhost])
      --ipcpath string ipc file storage path (default "set.ipc")
      --log_backtrace string Request a specific log to record the stack trace (e.g. "block.go:271")
      --log_debug highlight the call location log (file name and line number)
      --log_dir string Write log records to the specified file
      --log_level int Log display level setting: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default 3)
      --log_module string Log display level setting of each module: comma-separated list of <pattern>=<level> (e.g. set/*=5,p2p=4)
      --metrics_influxdb start the database to store statistical indicators
      --metrics_influxdb_URL string metrics database URL (default "http://localhost:8086")
      --metrics_influxdb_name string metrics database name (default "metrics")
      --metrics_influxdb_namespace string metrics namespace (default "fractal/")
      --metrics_influxdb_passwd string metrics database password
      --metrics_influxdb_user string metrics database user name
      --metrics_start enable metrics collection and reporting flag that open statistical metrics
      --miner_extra string block extension information (default "system")
      --miner_delay uint Miner delay broadcast interval (default 0ms)
      --miner_name string Mining reward account (default "fractal.admin")
      --miner_private strings Mining reward private key (default [289c2857d4598e37fb9647507e47a309d6133539bf21a8b9cb6df88fd5232032])
      --miner_start start mining
      --p2p_bootnodes string node list path, used to establish connection with other nodes
      --p2p_dialratio int P2P active connection and passive connection connection ratio
      --p2p_id uint P2P network ID, the nodes cannot communicate with each other if they have different IDs
      --p2p_listenaddr string P2P listening port (default ":2018")
      --p2p_maxpeers int P2P maximum number of connections (default 10)
      --p2p_maxpendpeers int P2P maximum number of connection handshake
      --p2p_name string P2P node name (default "Fractal-P2P")
      --p2p_nodedb string Configure the database path, the nodes found in the network are written to the database, and they are stored in the memory by default
      --p2p_nodial bool True do not actively connect to any node (default False)
      --p2p_nodiscovery disable node discovery mechanism (manually add nodes)
      --p2p_staticnodes string Static node list path, the node will automatically reconnect when disconnected
      --p2p_trustnodes string Trust node list path Allow nodes to connect when the maximum number of node connections is reached
      --statepruning_enable bool enable or disable the use of pruning state (default true)
      --txpool_accountqueue uint Maximum number of non-executable transaction slots allowed per account (default 1280)
      --txpool_accountslots uint Guaranteed number of executable transaction slots per account (default 128)
      --txpool_globalqueue uint The maximum number of transaction slots that cannot be executed for all accounts (default 4096)
      --txpool_globalslots uint The maximum number of trading slots that all accounts can execute (default 4096)
      --txpool_journal string store local transaction log for node restart (default "transactions.rlp")
      --txpool_lifetime duration Maximum lifetime of unexecutable transactions in the queue (default 3h0m0s)
      --txpool_nolocals Disable exemptions for local transaction prices
      --txpool_pricebump uint Price increase percentage, replace existing transaction (default 10)
      --txpool_pricelimit uint The minimum gas price limit to join the trading pool (default 1)
      --txpool_rejournal duration The time interval to regenerate the local transaction log (default 1h0m0s)
      --ws_exposeall exposes all API modules based on the websocket RPC interface, Not just public modules
      --ws_host string listening address based on websocket RPC server (default "localhost")
      --ws_modules strings are based on the API provided by the websocket RPC interface (default [set])
      --ws_origins strings Allowed origin based on websocket RPC request
      --ws_port int listen port based on websocket RPC server (default 8546)

Use "set [command] --help" for more information about a command.

setfinder

setfinder is a fractal node discoverer, for more information, see:

setfinder is a fractal node discoverer

Usage:
  setfinder [flags]
  setfinder [command]

Available Commands:
  help Help about any command
  version Show current version

Flags:
  -d, --datadir string data storage directory (default "$HOME/.set_ledger")
  -h, --help show help
      --p2p_bootnodes string node list path, used to establish connection with other nodes
      --p2p_id uint P2P network ID, the nodes cannot communicate with each other if they have different IDs
      --p2p_listenaddr string P2P listening port (default ":2018")
      --p2p_nodedb string Configure the database path, the nodes found in the network are written to the database, and they are stored in the memory by default

Use "setfinder [command] --help" for more information about a command.

Command line IPC access node

-chain: -startpure -debug -blockprofile -cpuprofile -freeosmemory -gcstats -gotrace -memstats -mutexprofile -stacks -writememprofile -miner -force -mining -setdelay -setcoinbase -setextra -start -stop -p2p -add -addbad -addtrusted -badcount -badlist -count -list -remove -removebad -removetrusted -selfnode -txpool -content -setgasprice -status


startpure

Enable or disable clipping state

Usage:
  set chain startpure <enable/disable> [flags]

Flags:
  -h, --help show help
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set chain startpure enable

# Result
{
  "preStatePruning": true,
  "currentNumber": 111140
}

blockprofile

Open block profiling at the specified frequency and write the data to the file

Usage:
  set debug blockprofile <file> <nsec> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

cpuprofile

Open the CPU profile at the specified frequency and write the data to the file

Usage:
  set debug cpuprofile <file> <nsec> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

freeosmemory

Return unused memory to the operating system

Usage:
  set debug freeosmemory [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

gcstats

Get garbage collection statistics

Usage:
  set debug gcstats [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

gotrace

Turn on tracing at the specified frequency and write data to the file

Usage:
  set debug gotrace <file> <nsec> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

memstats

Get memory status information

Usage:
  set debug memstats [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

mutexprofile

Open mutex profiling at the specified frequency and write data to the file

Usage:
  set debug mutexprofile <file> <nsec> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

stacks

Get all goroutines stack information

Usage:
  set debug stacks [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

writememprofile

Write memory allocation information to the specified file

Usage:
  set debug writememprofile <file> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

force

Mandatory start of mining (used when the system node is autonomous)

Usage:
  set miner force [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set miner force

# Result
true

mining

Get mining status

Usage:
  set miner mining [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set miner mining -i $HOME/.set_ledger/set.ipc

# Result
true

setcoinbase

Set up a mining account

Usage:
  set miner setcoinbase <name> <privKeys file> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set miner setcoinbase "miner_account", ~/privKeyFilePath

# Result
true

setextra

Set additional data of the block packaged by the node

Usage:
  set miner setextra <extra> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set miner setextra "hello world"

# Result
true

setdelay

Miner delay broadcast interval, in milliseconds

Usage:
  set miner setdelay <delay> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set miner setdlay 100

# Result
true

start

Start mining

Usage:
  set miner start [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set miner start

# Result
true

stop

Stop mining

Usage:
  set miner stop [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set miner stop

# Result
true

add

Connection node

Usage:
  set p2p add <url> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p add "fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec19ed5a3ff4a52820d@127.00.1"

# Result
true

addbad

Add the node to the blacklist

Usage:
  set p2p addbad <url> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p addbad "fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec190.1ed5a3ff4a52820d@12

# Result
true

addtrusted

Add the node to the trusted node set

Usage:
  set p2p addtrusted <url> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p addtrusted "fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec19ed5a312ff4a52820d@"

# Result
true

badcount

Get the number of blacklisted nodes

Usage:
  set p2p badcount [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p badcount

# Result
2

badlist

Get the list of blacklisted nodes

Usage:
  set p2p badlist [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p badlist

# Result
"fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec19ed5a3ff4a52820d@127.0.0.1:2015"
"fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec19ed5a3ff4a52820d@127.0.0.1:2015"

count

Get the number of connected nodes

Usage:
  set p2p count [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p count

# Result
3

list

Get the list of connected nodes

Usage:
  set p2p list [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p list

# Result
"fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec19ed5a3ff4a52820d@127.0.0.1:2015"
"fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec19ed5a3ff4a52820d@127.0.0.1:2015"

remove

Disconnect node

Usage:
  set p2p remove <url> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p remove "fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec19ed5a3ff4a52820d@127.0.

# Result
true

removebad

Remove the node from the blacklist

Usage:
  set p2p removebad <url> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p removebad "fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec190.1ed5a3ff4a52820d@12

# Result
true

removetrusted

Remove the node from the trusted node set, but do not automatically disconnect

Usage:
  set p2p removetrusted <url> [flags]

Flags:
  -h, --help show help

Global Flags:-i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p removetrusted "fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f047.00.1ed5a312ff4a52820d@"

# Result
true

selfnode

Get node address

Usage:
  set p2p selfnode [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set p2p selfnode

# Result
"fnode://4cc261784f24f1f12b7b5251f2626c4e0749676f18ef03080d3fbdc71644bfa04b9868583f44c1c1a495afa211f4c37329a78c4ce6f04ec19ed5a3ff4a52820d@127.0.0.1:2015"

content

Query the detailed information of txpool

Usage:
  set txpool content [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set txpool content

# Result
{
    "pending": {
        "0": {
            "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "blockNumber": 0,
            "txHash": "0x2e57d7358b41f862f3694bdb6a15b9cd09a6ea63ac620c9587b245419ccc1308",
            "transactionIndex": 0,
            "actions": [
                {
                    "type": 0,
                    "nonce": 97,
                    "from": "normalaccta59",
                    "to": "contracta59",
                    "assetID": 0,
                    "gas": 2000000,
                    "value": 0,
                    "remark": "0x",
                    "payload": "0x05f030e700000000000000000000000000000000000000000000000000000000000010030000000000000000000000000000000000000000000000000000000000000001",
                    "actionHash": "0x261bd3adce4be61e7d61f48cd200acc6ef53cd9e22d3923eb2f7c27d1807ff49",
                    "actionIndex": 0
                }
            ],
            "gasAssetID": 0,
            "gasPrice": 1,
            "gasCost": 2000000
        },
    "queued": {
        "0": {
            "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "blockNumber": 0,
            "txHash": "0xb8ea35d8d2e6a342849f3ce74235a71fc0d8628f412c596a45e111ae67b560ec",
            "transactionIndex": 0,
            "actions": [
                {
                    "type": 0,
                    "nonce": 99,
                    "from": "normalaccta59",
                    "to": "contracta59",
                    "assetID": 0,
                    "gas": 2000000,
                    "value": 0,
                    "remark": "0x",
                    "payload": "0x05f030e700000000000000000000000000000000000000000000000000000000000010030000000000000000000000000000000000000000000000000000000000000001",
                    "actionHash": "0x58da7f9b770e2f5a02b376ad5b8f5d5382fbef6697ca83a763442111f5c30aca",
                    "actionIndex": 0
                }
            ],
            "gasAssetID": 0,
            "gasPrice": 1,
            "gasCost": 2000000
        }
    }
}

setgasprice

Set gas price

Usage:
  set txpool setgasprice <gasprice uint64> [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set txpool setgasprice 1000000000

# Result
true

status

Query txpool status

Usage:
  set txpool status [flags]

Flags:
  -h, --help show help

Global Flags:
  -i, --ipcpath string IPC path (default "$HOME/.set_ledger/set.ipc")

Example:

# Request
./build/bin/set txpool status
# Result
{
    "pending": 0
    "queued": 0
}
⚠️ **GitHub.com Fallback** ⚠️