Use commands to manage neurons

Can we use commands to manage neurons?

I want to do the following from command line:

  • Stake a new neuron
  • Set its dissolve delay (in a high-precision fashion, rather than using mouse cursor)
  • Merge maturity (with option to choose 0-100%)
  • Query neuron’s maturity yield

Can’t find any command to achieve these goals from dfx canister or dfx ledger.

You can, you do this by calling the NNS governance canister using dfx. For an airgapped setup you’d sign a message instead of calling directly, eg:

dfx canister --network=https://ic0.app --no-wallet sign rrkah-fqaaa-aaaaa-aaaaq-cai get_full_neuron '(<your_neuron_id> : nat64 )'

See this guide for more on this:
https://ic.associates/nns-command-line-guide/

You can also use the quill tool, which has built in commands for tasks like this:
https://github.com/dfinity/quill

Yes, would like to know how to merge maturity as well, ic.associates is cool but no command to merge maturity. is there a command to merge maturity on the command line?

I found it to Merge the Maturity, if it helps anyone:

dfx canister --network=https://ic0.app --no-wallet call \
    rrkah-fqaaa-aaaaa-aaaaq-cai manage_neuron \
    '(
        record { 
            id = opt record {id ='neuron--id-goes-here' : nat64}; 
            command = opt variant { 
                MergeMaturity = record { 
                    percentage_to_merge = 100 : nat32;
                }
            }
        }
    )'
2 Likes