github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/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 get the latest finalized block 25 ``` 26 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-blocks", "data": { "block": "final" }}' 27 ``` 28 29 ### To get the latest sealed block 30 ``` 31 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-blocks", "data": { "block": "sealed" }}' 32 ``` 33 34 ### To get block by height 35 ``` 36 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-blocks", "data": { "block": 24998900 }}' 37 ``` 38 39 ### To get identity by peer id 40 ``` 41 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "get-latest-identity", "data": { "peer_id": "QmNqszdfyEZmMCXcnoUdBDWboFvVLF5reyKPuiqFQT77Vw" }}' 42 ``` 43 44 ### To get transactions for ranges (only available to staked access and execution nodes) 45 ``` 46 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "get-transactions", "data": { "start-height": 340, "end-height": 343 }}' 47 ``` 48 49 ### To get blocks for ranges (works for any node type, for block payload, only prints the collection ids) 50 ``` 51 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-range-blocks", "data": { "start-height": 105172044, "end-height": 105172047 }}' 52 ``` 53 54 ### To get cluster block for ranges (only available to collection nodes, only prints the transaction ids) 55 56 ``` 57 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-range-cluster-blocks", "data": { "chain-id": "cluster-576-e8af4702d837acb77868a95f61eb212f90b14c6b7d61c89f48949fd27d1a269b", "start-height": 25077, "end-height": 25080 }}' 58 ``` 59 60 ### To get execution data for a block by execution_data_id (only available execution nodes and access nodes with execution sync enabled) 61 ``` 62 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "read-execution-data", "data": { "execution_data_id": "2fff2b05e7226c58e3c14b3549ab44a354754761c5baa721ea0d1ea26d069dc4" }}' 63 ``` 64 65 #### To get a list of all updatable configs 66 ``` 67 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "list-configs"}' 68 ``` 69 70 ### To get a config value 71 ``` 72 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "get-config", "data": "consensus-required-approvals-for-sealing"}' 73 ``` 74 75 ### To set a config value 76 #### Example: require 1 approval for consensus sealing 77 ``` 78 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-config", "data": {"consensus-required-approvals-for-sealing": 1}}' 79 ``` 80 TODO remove 81 #### Example: set block rate delay to 750ms 82 ``` 83 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-config", "data": {"hotstuff-block-rate-delay": "750ms"}}' 84 ``` 85 #### Example: enable the auto-profiler 86 ``` 87 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-config", "data": {"profiler-enabled": true}}' 88 ``` 89 #### Example: manually trigger the auto-profiler for 1 minute 90 ``` 91 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "set-config", "data": {"profiler-trigger": "1m"}}' 92 ``` 93 94 ### Set a stop height 95 ``` 96 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "stop-at-height", "data": { "height": 1111, "crash": false }}' 97 ``` 98 99 ### Trigger checkpoint creation on execution 100 ``` 101 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "trigger-checkpoint"}' 102 ``` 103 104 ### Add/Remove/Get address to rate limit a payer from adding transactions to collection nodes' mempool 105 ``` 106 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "ingest-tx-rate-limit", "data": { "command": "add", "addresses": "a08d349e8037d6e5,e6765c6113547fb7" }}' 107 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "ingest-tx-rate-limit", "data": { "command": "remove", "addresses": "a08d349e8037d6e5,e6765c6113547fb7" }}' 108 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "ingest-tx-rate-limit", "data": { "command": "get" }}' 109 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "ingest-tx-rate-limit", "data": { "command": "get_config" }}' 110 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "ingest-tx-rate-limit", "data": { "command": "set_config", "limit": 1, "burst": 1 }}' 111 ``` 112 113 ### To create a protocol snapshot for latest checkpoint (execution node only) 114 ``` 115 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "protocol-snapshot"}' 116 curl localhost:9002/admin/run_command -H 'Content-Type: application/json' -d '{"commandName": "protocol-snapshot", "data": { "blocks-to-skip": 10 }}' 117 ```