Another week, and deeper down the rabbit hole we go. I’ve got more updates below

Datatypes Repo
Because I got constantly annoyed of parsing serde_json::Value
and catching every little parse error or missing field, I made a new repo sn_node_rpc_data_types that Im’ using for the time being to sync up the serialization of parameter and result. It’s been a lot more convenient and less verbose. As mentioned earlier, if we ever do move to tunneling through safe
in some future timeline, these kinds of structured types would make that transition easier.
More Working Commands (CLI and Node Support implemented):
(I’m just going to copy/paste these mostly from my CLI output to save time)
Logs
Prints out a specified number of log lines starting at some specified offset.
USAGE:
safe.exe node logs [FLAGS] [OPTIONS]
OPTIONS:
--node-path <node-path> Path of node root dir (default is ~./safe/node). Th SN_NODE_PATH env var can also
be used [env: SN_NODE_PATH=]
--rpc-port <node-rpc-port> [default: 34000]
--log-id <log-id> Which log to fetch by id (options: 0 = plaintext logs) [default: 0]
--num-lines <num-lines> How many log lines to fetch [default: 10]
--start-idx <start-idx> Start line index of log fetch. start_idx > 0 implies offset from the start
start_idx < 0 implies start from index abs(start_idx) from the end (e.g. -1 means
start at the last line) [default: -10]
Note the log_id
field. While right now we only have plaintext logs that live on disk, there’s an interesting possibility of adding more log varieties later for structured data collection. Examples include maybe a structured log for QoS and similar things. These don’t even need to live on disk, it’s structured in such a way that, even if these lived in a circular buffer in RAM it would work out fine. It’s pretty flexible.
Rewards
Right now this fetches the reward key (and lets you set it via --set-key
, although I’m still debugging set-key
right now. Seems my node fails to launch with a serialization error from sn_routing
. That might be an issue in upstream though, I haven’t investigated yet). More info like farm attempt success rate and such could be useful to add in later down the line, so it’s also pretty flexible in that sense.
USAGE:
safe.exe node rewards [FLAGS] [OPTIONS]
OPTIONS:
--node-path <node-path> Path of node root dir (default is ~./safe/node). Th SN_NODE_PATH env var can also
be used [env: SN_NODE_PATH=]
--rpc-port <node-rpc-port> What port to issue node remote procedure calls on [default: 34000]
--set-key <set-key> If provided, sets a new reward key from a hex string before fetching rewards info
Storage
Right now this just reports basic information on used space (e.g. total offered vs used), but I’m working on getting a --detailed
flag going.
USAGE:
safe.exe node storage [FLAGS] [OPTIONS]
OPTIONS:
--node-path <node-path> Path of node root dir (default is ~./safe/node). Th SN_NODE_PATH env var can also
be used [env: SN_NODE_PATH=]
--rpc-port <node-rpc-port> [default: 34000]
Conclusion
I got some more features working in the past week and this is rather functional right now, allowing for some rough edges. Once I get the last of the functionality included for these commands, as well as a status
command going, I’ll take a look at sn_launch_tool
and sn_cli
to make it easier to launch a node with the RPC enabled and to issue RPCs with fewer flags.