-
Notifications
You must be signed in to change notification settings - Fork 27
Admin namespace
The blutgang
namespace containts JSON-RPC methods that let you change settings, as well as giving you information about Blutgang. It can be enabled via both CLI arguments or via the config file. It's recommended you use the config file as it gives you more options when it comes to configuring how the blutgang
namespace behaves.
# Note: the admin namespace contains volatile functions and
# should not be exposed to the public.
[admin]
# Enable the admin namespace
enabled = true
# Address for the admin RPC
address = "127.0.0.1:5715"
# Only allow read-only methods
# Recommended `true` unless you 100% need write methods
readonly = true
# Enable JWT request authentication
# MUST BE ENABLED IN PROD
jwt = true
# JWT token
key = "some-token-replace-this"
For the benefit of security, methods are split into read and write categories. Read display information about blutgang, while write methods can be used to change its behaviour, and can be dangerous if abused.
Returns a list of RPCs in the active pool.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_rpc_list","id":1,"jsonrpc":"2.0"}'
Returns a list of inactive RPCs.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_poverty_list","id":1,"jsonrpc":"2.0"}'
Outputs the current config info
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_config","id":1,"jsonrpc":"2.0"}'
Returns the current ttl
. Determines when requests to RPCs time out.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_ttl","id":1,"jsonrpc":"2.0"}'
Returns the current blutgang_health_check_ttl
. Controls when requests to RPCs inside the health check time out.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_ttl","id":1,"jsonrpc":"2.0"}'
Flushes the DB and terminates the process.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_quit","id":1,"jsonrpc":"2.0"}'
Flushes sled to disk.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_flush_cache","id":1,"jsonrpc":"2.0"}'
Sets the ttl. Takes in the the ttl in milliseconds as an argument.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_set_ttl","id":1,"jsonrpc":"2.0" , "params": [100]}'
Sets the health_check_ttl. Takes in the the health_check_ttl in milliseconds as an argument.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_set_health_check_ttl","id":1,"jsonrpc":"2.0" , "params": [100]}'
Adds an RPC to the current active pool of RPCs. Takes in the URL, max consecutive, and MA length as arguments.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_add_to_rpc_list","id":1,"jsonrpc":"2.0" , "params": ["http://example.com", 5, 10]}'
Adds an RPC to the inactive pool of RPCs. Takes in the URL, max consecutive, and MA length as arguments.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_add_to_poverty_list","id":1,"jsonrpc":"2.0" , "params": ["http://example.com", 5, 10]}'
Removes an RPC from the active RPC pool. Takes in the index of the RPC as an argument. Does not move it from the inactive pool.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_remove_from_rpc_list","id":1,"jsonrpc":"2.0" , "params": [1]}'
Removes an RPC from the inactive RPC pool. Takes in the index of the RPC as an argument. Does not move it to the active pool.
curl localhost:5715 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"blutgang_remove_from_rpc_list","id":1,"jsonrpc":"2.0" , "params": [1]}'