github.com/koko1123/flow-go-1@v0.29.6/admin/README.md (about)

     1  ## Intro
     2  Admin tool allows us to dynamically change settings of the running node without a restart. It can be used to change log level, and turn on profiler etc.
     3  
     4  ## Usage
     5  
     6  ### List all commands
     7  ```
     8  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "list-commands"}'
     9  ```
    10  
    11  ### To change log level
    12  Flow, and other zerolog-based libraries:
    13  
    14  ```
    15  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-log-level", "data": "debug"}'
    16  ```
    17  
    18  libp2p, badger, and other golog-based libraries:
    19  
    20  ```
    21  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-golog-level", "data": "debug"}'
    22  ```
    23  
    24  ### To turn on profiler
    25  ```
    26  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-profiler-enabled", "data": true}'
    27  ```
    28  
    29  ### To get the latest finalized block
    30  ```
    31  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-blocks", "data": { "block": "final" }}'
    32  ```
    33  
    34  ### To get the latest sealed block
    35  ```
    36  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-blocks", "data": { "block": "sealed" }}'
    37  ```
    38  
    39  ### To get block by height
    40  ```
    41  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-blocks", "data": { "block": 24998900 }}'
    42  ```
    43  
    44  ### To get identity by peer id
    45  ```
    46  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "get-latest-identity", "data": { "peer_id": "QmNqszdfyEZmMCXcnoUdBDWboFvVLF5reyKPuiqFQT77Vw" }}'
    47  ```
    48  
    49  ### To get transactions for ranges (only available to staked access and execution nodes)
    50  ```
    51  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "get-transactions", "data": { "start-height": 340, "end-height": 343 }}'
    52  ```
    53  
    54  ### To get execution data for a block by execution_data_id (only available execution nodes and access nodes with execution sync enabled)
    55  ```
    56  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-execution-data", "data": { "execution_data_id": "2fff2b05e7226c58e3c14b3549ab44a354754761c5baa721ea0d1ea26d069dc4" }}'
    57  ```
    58  
    59  #### To get a list of all updatable configs
    60  ```
    61  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "list-configs"}'
    62  ```
    63  
    64  ### To get a config value
    65  ```
    66  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "get-config", "data": "consensus-required-approvals-for-sealing"}'
    67  ```
    68  
    69  ### To set a config value
    70  #### Example: require 1 approval for consensus sealing
    71  ```
    72  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-config", "data": {"consensus-required-approvals-for-sealing": 1}}'
    73  ```
    74  #### Example: set block rate delay to 750ms
    75  ```
    76  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-config", "data": {"hotstuff-block-rate-delay": "750ms"}}'
    77  ```
    78  #### Example: enable the auto-profiler
    79  ```
    80  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-config", "data": {"profiler-enabled": true}}'
    81  ```
    82  #### Example: manually trigger the auto-profiler for 1 minute
    83  ```
    84  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-config", "data": {"profiler-trigger": "1m"}}'
    85  ```
    86  
    87  ### Set a stop height
    88  ```
    89  curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "stop-at-height", "data": { "height": 1111, "crash": false }}'
    90  ```