diff --git a/testnet/tools/nns-tools/lib/include.sh b/testnet/tools/nns-tools/lib/include.sh index 3ecb2f7aecc..242fdff03c4 100644 --- a/testnet/tools/nns-tools/lib/include.sh +++ b/testnet/tools/nns-tools/lib/include.sh @@ -24,6 +24,7 @@ source "$LIB_DIR/canisters.sh" source "$LIB_DIR/constants.sh" source "$LIB_DIR/functions.sh" source "$LIB_DIR/installers.sh" +source "$LIB_DIR/nns_neurons.sh" source "$LIB_DIR/proposals.sh" source "$LIB_DIR/sns_upgrades.sh" source "$LIB_DIR/topology.sh" diff --git a/testnet/tools/nns-tools/lib/nns_neurons.sh b/testnet/tools/nns-tools/lib/nns_neurons.sh new file mode 100644 index 00000000000..f73edf268cb --- /dev/null +++ b/testnet/tools/nns-tools/lib/nns_neurons.sh @@ -0,0 +1,32 @@ +##: claim_or_refresh +## Usage: $1 +## Claim or refresh an NNS neuron with a particular ID +## NETWORK: The network to use. +## NEURON_ID: The neuron id to claim or refresh. +## Example: claim_or_refresh ic 1234567890 +nns_claim_or_refresh() { + local network=$1 + local neuron_id=$2 + + local IC=$(repo_root) + local GOV_DID="$IC/rs/nns/governance/canister/governance.did" + + dfx canister \ + --network ic \ + call \ + --candid "$GOV_DID" \ + rrkah-fqaaa-aaaaa-aaaaq-cai \ + manage_neuron "( + record { + id = opt record { id = ${neuron_id}: nat64 }; + command = opt variant { + ClaimOrRefresh = record { + controller = null; + by = opt variant { + NeuronIdOrSubaccount = record { } + } + } + } + } + )" +}