Questions about commands & actions to go through SNS launch

I started reading about the preparation and launch of SNS but couldn’t figure out two questions while reading “Commands & actions to go through SNS launch”. Therefore, I’m asking here:

  • In Chapter 2, it mentions that the NNS root should be added as a co-controller. Does “NNS root” mean the NNS Governance canister ID or something else?

  • I couldn’t find in the documentation how to submit an SNS without using dfx, a tool which I do not use for my projects (I’m in the process of getting rid of it). Moreover, I was thinking about maybe adding the type to proposals.network. So, in chapter 3, I was wondering what type of proposal and parameters should be used to submit an NNS proposal to create an SNS. Is that documented anywhere?

1 Like

Hi @peterparker ,

  1. Indeed by adding it as a controller we mean adding its canister ID as controller. NNS root is the canister that controls NNS governance and all other system canisters (except itself). You can find the canister and its canister ID here: https://dashboard.internetcomputer.org/canister/r7inp-6aaaa-aaaaa-aaabq-cai

  2. What do your mean by “adding the type to proposals.network”? There are quite many parameters to define, let me get back to you where this is documented best.

1 Like

Hi @peterparker, a good place to look for description of SNS init parameters is sns-testing/example_sns_init.yaml at main · dfinity/sns-testing · GitHub

Some of the example parameters are described as optional; the remaining ones are mandatory.

1 Like

Answered too quickly. Thanks for the first hints😃, looking forward for the details of the types and parameters.

Hi @lara

  1. Gotcha. :+1:

  2. I’m guessing the proposal has to be created by a manage_neuron call on the Governance canister, so my curiosity is about what all indeed parameters are required to call that endpoint (action, neurond id, title etc. etc.). Thanks in advance for letting me know where that is best documented.

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.

2 Likes

here is an example ManageNeuron candid argument for creating a proposal to create an SNS. Edit: By the way, these arguments should pass validation but aren’t DFINITY-approved or anything, they’re just some random ones I picked.

The CreateServiceNervousSystem corresponds to this sns_init.yaml file.

As @aterga mentions, sns-testing/example_sns_init.yaml is a good place to find documentation for most of the fields under CreateServiceNervousSystem

2 Likes

Thanks @Andre-Popovitch, that’s excellent! That’s excellent and exactly what I was looking for.

To summarize the answers:

  1. The “NNS Root” controller that should be added to the canisters proposed for the SNS submission is r7inp-6aaaa-aaaaa-aaabq-cai.

It is not the “NNS Governance Canister ID” but, the root that controls all canisters of NNS.

  1. The type (action) of the proposal is CreateServiceNervousSystem, and all the required parameters are listed in this gist.

While I understand it’s important for the Internet Computer website to display a unique track about proposing an SNS, I think it would be nice to also document (on the website or elsewhere) how one can submit the proposal without using any specific tool. Just to align with the spirit of using open smart contracts, my two cents of course.

Thanks again for the time and answers; I appreciate it!

P.S.: Please, Andre, do not delete your Gist and keep it alive for some time. :wink:

Not sure if I misunderstood this sentence, but this doesn’t sound right (and doesn’t seem to be the same thing as what @lara said).

“NNS Root”: is r7inp-6aaaa-aaaaa-aaabq-cai
“NNS Governance” is rrkah-fqaaa-aaaaa-aaaaq-cai.

The controller of the SNS Dapp canisters should be NNS Root, not NNS Governance.

1 Like

Thanks a lot for the heads-up! I’ve edited the post I marked as the solution with the “NNS Root” r7inp-6aaaa-aaaaa-aaabq-cai.