New tools for simplifying SNS operations

,

New tools for simplifying SNS operations

I’d like to show you a new tool to simplify operations for SNS communities, dfx sns health. The tool is part of the DFX SNS extension, so you can just run dfx sns health and see a summary of various health metrics for all SNSes. Here is the output when I ran it just now:

Name Memory Cycles Upgrades Remaining
BOOM DAO :+1: :x: index: (9.23 TC) 12
CYCLES-TRANSFER-STATION :+1: :+1: 8
Catalyze :+1: :x: ledger: (5.41 TC), archive: (9.33 TC) 0
DOGMI :+1: :x: archive: (9.71 TC) 13
DecideAI DAO :+1: :+1: 0
Dragginz :+1: :+1: 7
ELNA AI :+1: :+1: 14
EstateDAO :+1: :+1: 25
Gold DAO :+1: :+1: 7
ICGhost :+1: :+1: 14
ICLighthouse DAO :+1: :x: swap: (5.09 TC) 14
ICPCC DAO LLC :+1: :x: root: (9.85 TC), governance: (4.05 TC), ledger: (4.21 TC), swap: (8.25 TC) 17
ICPSwap :+1: :x: governance: (9.95 TC) 14
ICPanda DAO :+1: :x: root: (9.35 TC), archive: (8.54 TC) 2
ICVC :+1: :x: index: (7.19 TC) 12
Juno Build :+1: :+1: 7
Kinic :+1: :+1: 8
MORA DAO :+1: :x: root: (4.81 TC), governance: (6.75 TC), swap: (6.33 TC), index: (0.00 TC) 38
Motoko :+1: :x: swap: (9.46 TC), archive: (9.62 TC) 0
Neutrinite :+1: :+1: 5
Nuance :+1: :+1: 12
ORIGYN :+1: :+1: 8
OpenChat :+1: :+1: 10
OpenFPL :+1: :+1: 10
SONIC :+1: :+1: 13
Seers :+1: :+1: 10
Sneed :+1: :+1: 28
TRAX :+1: :x: root: (9.84 TC) 15
WaterNeuron :+1: :+1: 8
YRAL :+1: :x: archive: (4.71 TC) 5
Yuku DAO :+1: :x: archive: (9.58 TC) 42

A :+1: is shown if all SNS canisters have at least 10TC cycles and don’t use more than 2.5 of memory. An :x: is shown otherwise. “Upgrades Remaining” shows how many versions behind the latest the SNS is.

How to use this information

If you see an :x: for memory (which is unlikely), the best thing to do is to submit proposals to upgrade the SNS. If the problem persists after the SNS is upgraded, please make a forum post as it indicates a potential bug in the SNS.

If you see an :x: for cycles, this can be resolved by just topping up the SNS canisters with more cycles. Many SNSes use a tool called CycleOps to automate this. Otherwise, you can just send cycles to a canister directly through DFX. Just run dfx sns list to see the canister IDs for all the SNSes, or use the ICP dashboard to look up the ID of a particular SNS canister. Once you have the canister ID, you can use dfx ledger top-up. Here is an example of how it would be used:

dfx ledger top-up 4f5dx-pyaaa-aaaaq-aaa3q-cai --network=ic --amount=5

Of course, your dfx identity needs to have some ICP in it. To get some, run dfx identity get-principal to get your DFX identity’s principal ID and send some ICP to it.

Installation

These commands are implemented as a DFX extension, so if you have DFX, you can just run dfx extension install sns --version 0.4.6 to get it. This gets you the DFX SNS extension, so you can then run dfx sns <command>. In this case, the command is dfx sns health and dfx sns list

Notes on Cycles and Upgrades

Of course, the best operations work is the kind you don’t have to do at all! DFINITY plans to propose changes that simplify the process of topping up cycles and remaining upgraded. Memory is already handled by the SNS and only is a problem in the case of very rare bugs.

Implementation

For those interested in the technical side, the commands featured in this post were implemented with the ic-nervous-system-agent rust library, which is part of the monorepo. (Unfortunately it isn’t yet on crates.io.) This library makes it very simple to write rust tools that interact with SNS and NNS canisters. It was created by DFINITY to simplify writing automated tests and CLI tools, and it’s brand new. This means we don’t guarantee it has every feature you’d need and we may break backwards compatibility as we figure out the best API, but anyone interested is welcome to start using it to build on top of the SNS and NNS.

3 Likes