Difference between revisions of "How-To: Create an NNS motion proposal"

From Internet Computer Wiki
Jump to: navigation, search
(Replaced content with "Please see [https://35k4u-jqaaa-aaaam-abrma-cai.icp0.io/docs/current/developer-docs/daos/nns/concepts/proposals/proposal-submit How to create NNS proposal on ICP developer...")
Tag: Replaced
 
(40 intermediate revisions by 8 users not shown)
Line 1: Line 1:
This article explains one way to submit NNS motion proposals by using a few command line tools and a self-custody neuron.
+
Please see [https://35k4u-jqaaa-aaaam-abrma-cai.icp0.io/docs/current/developer-docs/daos/nns/concepts/proposals/proposal-submit How to create NNS proposal on ICP developer docs]
 
 
==Background==
 
 
 
To properly follow what is going on, there are a few high-level points worth highlighting:
 
 
 
===Only Neurons can submit NNS proposals===
 
 
 
Neurons with at least 1 ICP and 6 months of dissolve delay can submit NNS proposals. So the first step is to create such a neuron.
 
 
 
===The NNS Governance Canister accepts motion proposals===
 
 
 
The Governance Canister is just a canister like any other, so it has a Candid file, it accepts messages, etc... This article describes a way where you can have your local computer send a message to the governance canister (signed on behalf of a neuron) that contains a motion proposal.
 
 
 
==One-time setup==
 
 
 
===Install Tools===
 
 
 
1. Install '''dfx'''
 
 
 
* '''dfx''' is the canister SDK and it will be used to send messages from your machine to NNS
 
* [https://smartcontracts.org/ smartcontracts.org]
 
<pre>
 
$ dfx [OPTIONS] <SUBCOMMAND>
 
</pre>
 
 
 
2. Install '''keysmith'''
 
 
 
* '''keysmith''' will be used to generate a privat/public key pair for the IC
 
* https://github.com/dfinity/keysmith
 
* this article will assume that you execute '''quill''' on your local machine by running
 
 
 
<pre>
 
$ keysmith [OPTIONS] <SUBCOMMAND>
 
</pre>
 
 
 
3. Install '''quill'''
 
 
 
* '''quill''' is a minimalist "governance toolkit". It is wrapper for crafting & sending messages to the NNS and manage one's neuron.
 
* https://github.com/dfinity/quill
 
* this article will assume that you execute '''quill''' on your local machine by running
 
 
 
<pre>
 
$ target/release/quill [OPTIONS] <SUBCOMMAND>
 
</pre>
 
 
 
===Create a neuron via command-line tools===
 
 
 
====1. Create a <code>private.pem</code> (private/public keypair) and Ledger <code>account id</code>====
 
 
 
Before one starts, they need a private/public keypair.
 
 
 
<pre>
 
// Create seed phrase
 
$ keysmith generate -o seed.txt
 
 
 
//Create private.pem
 
$ keysmith private-key -o private.pem
 
 
 
//Derive Ledger account from private key
 
$ keysmith account -i 0
 
</pre>
 
 
 
When done, your <code>account id</code> should look something like this: <code>612ec300g9ec990da900d6ec45919e7d5dbb9fa0dd8e69c54d374df93aa28d57</code>.
 
 
 
====2. Link this private/public keypair to <code>dfx</code> so you can use it as an "Identity"====
 
 
 
In this case, the new identity is called "proposals"
 
 
 
<pre>
 
$ dfx identity import proposals private.pem
 
</pre>
 
 
 
* If you see “creating identity: proposals” in the terminal, this means it worked*
 
* further reading on dfx identities: [https://smartcontracts.org/docs/developers-guide/cli-reference/dfx-identity.html dfx identity]
 
 
 
====3. Send ICP to the <code>account ID</code> generated in step 1====
 
 
 
You should send at least 1.001 in order to have enough ICP to create a neuron and pay for the Ledger transaction fees.
 
 
 
To send ICP to the account, all you need is to input the <code>account id</code> in your wallet of choice.
 
 
 
====4. Now that the account has the required ICP, spawn a neuron====
 
 
 
Note: This section assumes you have '''quill'' installed properly.
 
 
 
<pre>
 
// Craft a message to "stake a the neuron by choosing a 8-character $NAME and an $AMOUNT to stake"
 
$ target/release/quill --pem-file private.pem neuron-stake --name $NAME --amount $AMOUNT > message.json
 
 
 
//Send the message crafted above.
 
$ target/release/quill send message.json
 
</pre>
 
 
 
* You should see a message with a neuron ID spawned
 
* If successful, response will return <code>neuron ID: 9_218_890_096_040_352_708</code>. This means the neuron ID is <code>9218890096040352708</code>.
 
 
 
====5. Increase neuron dissolve to at least 6 months====
 
 
 
* Time is measured in seconds in the NNS
 
* One year: 31557600 seconds
 
 
 
<pre>
 
// Craft message to send the neuron
 
$ target/release/quill --pem-file private.pem neuron-manage 148885932052941245 --additional-dissolve-delay-seconds 31557600 > message.json
 
 
 
//send just-created message to the Governance canister
 
$ target/release/quill send message.json
 
</pre>
 
 
 
==How to send a proposal==
 
 
 
===Craft a proposal in markdown===
 
 
 
===Send proposal via dfx===
 
 
 
===Check dashboard to see proposal was successful===
 

Latest revision as of 15:07, 2 September 2024