Hey @peterparker . manage_neuron
is an endpoint that takes a single candid struct. The struct must be of type ManageNeuron
. The definition of ManageNeuron
can be found in the candid API definitions for NNS governance under type ManageNeuron = ...
.
type ManageNeuron = record {
id : opt NeuronId;
command : opt Command;
neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
};
Disregard id
as it is the legacy way of specifying the id of the neuron submitting the command, and can be set to null
. (In general it is not always true that a candid field being of type opt
means that the call will still work with that field set to null
, but it is in this case). Edit: id
is fine to use, it is just redundant if you specify the other fields.
neuron_id_or_subaccount
determines the neuron that this call is being made on behalf of. (The caller of manage_neuron
must be a controller of that neuron.) The command
determines the neuron should do. In this case, you want the neuron to create a proposal to create an SNS, so the Sommand is MakeProposal
which is a variant containing a Proposal
. This is where the title and action are set.
type Proposal = record {
url : text;
title : opt text;
action : opt Action;
summary : text;
};
The action specifies what should happen when the proposal is executed. In this case, you want CreateServiceNervousSystem
, which can be found in the same file:
type CreateServiceNervousSystem = record {
url : opt text;
governance_parameters : opt GovernanceParameters;
fallback_controller_principal_ids : vec principal;
logo : opt Image;
name : opt text;
ledger_parameters : opt LedgerParameters;
description : opt text;
dapp_canisters : vec Canister;
swap_parameters : opt SwapParameters;
initial_token_distribution : opt InitialTokenDistribution;
};
And in general you repeat this process into GovernanceParameters
, LedgerParameters
, etc.
It would be helpful to know what language you’re working with, as if you’re using Rust there are many examples that would be useful inside the tests in the ic repo that I would be happy to point you towards. Otherwise, I could create an example candid value of type ManageNeuron
which would hopefully serve as a base for you to build from.