Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to SNS docs #2 (WIP) #1622

Merged
merged 40 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d022ae3
update integrations/index
Jun 26, 2023
6494cf4
update integrations/sns/index
Jun 26, 2023
debc11b
rename directories and files
Jun 26, 2023
c67bfd4
add file for ic-admin
Jun 26, 2023
9979f71
remove unneeded directories
Jun 26, 2023
8b7d18b
update sns css classes
Jun 26, 2023
b866867
update sidebars.js
Jun 26, 2023
fc75ee6
update sns files and directories
Jun 26, 2023
f800b3f
update the sns files so links all resolve
Jun 26, 2023
180b906
fix broken links
Jun 26, 2023
f7766ff
fix typo
Jun 26, 2023
31fd372
fix link
Jun 26, 2023
e02b133
fix link 2
Jun 26, 2023
ecc81bb
rename sns testing file to be clearer
Jun 26, 2023
7c68b4a
remove placeholder
Jun 26, 2023
5729c53
remove unnecessary tables
Jun 26, 2023
e184c31
fix broken link
Jun 26, 2023
64c1932
simplify doc
Jun 26, 2023
70d69e7
update SNS launch steps
Jun 26, 2023
c1dfe36
update SNS launch steps
Jun 26, 2023
cb70c44
Update docs/developer-docs/integrations/sns/index.md
dprats Jun 26, 2023
ea5a4d7
Update docs/developer-docs/integrations/sns/launching/launch-steps.md
dprats Jun 26, 2023
1b40b93
Update docs/developer-docs/integrations/sns/launching/launch-steps.md
dprats Jun 26, 2023
c20c259
Update docs/developer-docs/integrations/sns/launching/launch-summary.md
dprats Jun 26, 2023
f401ec5
Update docs/developer-docs/integrations/sns/tokenomics/index.md
dprats Jun 26, 2023
e816d92
Update docs/developer-docs/integrations/sns/launching/launch-summary.md
dprats Jun 26, 2023
586d436
Update docs/developer-docs/integrations/sns/launching/launch-summary.md
dprats Jun 26, 2023
9d97e31
Update docs/developer-docs/integrations/sns/launching/launch-summary.md
dprats Jun 26, 2023
49786b7
Update docs/developer-docs/integrations/sns/launching/launch-summary.md
dprats Jun 26, 2023
b0d924c
Merge branch 'master' into sns-launch-fixes2
dprats Jun 26, 2023
d5064ce
Merge branch 'master' of https://github.com/dfinity/portal into sns-l…
Jun 27, 2023
a105ae3
Update docs/developer-docs/integrations/sns/launching/launch-summary.md
dprats Jun 27, 2023
cebb86c
update sidebars
Jun 27, 2023
62b0935
comment out link in sidebars that does not exist (yet)
Jun 27, 2023
76d61ad
Merge branch 'sns-launch-fixes2' of https://github.com/dfinity/portal…
Jun 27, 2023
e19ce77
change states of the tables
Jun 27, 2023
31b4e2a
updates from the review
Jun 27, 2023
a345c37
Update docs/developer-docs/integrations/sns/launching/launch-summary.md
dprats Jun 27, 2023
6199ddb
fix sns asset canister
Jun 27, 2023
e04006b
Merge branch 'master' into sns-launch-fixes2
dprats Jun 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions docs/developer-docs/integrations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ Rosetta is an open standard introduced by Coinbase to simplify the integration o
## Service Nervous System (SNS)
Similar to how the NNS is the open tokenized DAO that controls the IC, SNSs are algorithmic DAOs that allow developers to create decentralized, token-based governance systems for their dapps. This section provides an [overview of the SNS documentation](./sns/index.md) and then provides the documentation aimed at developers.

* [An introduction to the SNS.](./sns/lifecycle-sns/sns-intro-highlevel.md)
* [An introduction to the SNS.](./sns/introduction/sns-intro-high-level.md)
* [An introduction to how to prepare for an SNS launch.](./sns/tokenomics/index.md)
* [SNS integration documentation.](./sns/integrate-sns/index.md)
* [SNS testing documentation.](./sns/get-sns/get-sns-intro.md)
* [An introduction to the SNS launch.](./sns/launch-sns/launch-sns.md)
* [Information on how to manage an SNS.](./sns/managing-sns/manage-sns-intro.md)
* [SNS integration documentation.](./sns/integrating/index.md)
* [SNS testing documentation.](./sns/testing/testing-before-launch.md)
* [An introduction to the SNS launch.](./sns/launching/launch-summary.md)
* [Information on how to manage an SNS.](./sns/managing/manage-sns-intro.md)

## Threshold ECDSA
A threshold ECDSA implementation on a blockchain can be viewed as the on-chain pendant to a hardware security module (HSM) that stores private keys securely and issues signatures on request of the eligible entities, and only to those. It is particularly important to facilitate direct integration with (ECDSA-based) blockchains.
Expand All @@ -61,4 +61,3 @@ A threshold ECDSA implementation on a blockchain can be viewed as the on-chain p




26 changes: 13 additions & 13 deletions docs/developer-docs/integrations/sns/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ This page provides an overview of how the SNS developer documentation is organiz
## Introduction to the SNS
This section gives a high level overview of the SNS lifecycle, including the architecture and how an SNS is launched.
You will find
* [SNS introduction](./lifecycle-sns/sns-intro-highlevel.md) giving a quick introduction.
* [SNS architecture](./lifecycle-sns/sns-architecture.md) explaining how SNSs are deployed and upgraded and what canisters are involved.
* [SNS launch](./lifecycle-sns/sns-launch.md) explaining all the steps that are involved in launching an SNS.
* [Alternative DAOs](./lifecycle-sns/dao-alternatives.md) presenting alternatives ways how to get a DAO.
* [SNS introduction](./introduction/sns-intro-high-level.md) giving a quick introduction.
* [SNS architecture](./introduction/sns-architecture.md) explaining how SNSs are deployed and upgraded and what canisters are involved.
* [SNS launch](./launching/launch-summary.md) explaining all the steps that are involved in launching an SNS.
* [Alternative DAOs](./introduction/dao-alternatives.md) presenting alternatives ways how to get a DAO.

## Preparing an SNS launch
This section introduces the ideas and tools needed when considering to form a DAO, including less technical aspects, such as planning the tokenomics, as well as more
Expand All @@ -32,26 +32,26 @@ This section not only targets developers that have a dapp that they would like t
want to build services that integrate with SNSs, such as wallet dapps or decentralized exchanges.

It includes
* [An introduction to SNS integration](./integrate-sns/index.md). <!--Guidelines how to integrate a frontend (integrate-sns/frontend-integration.md)-->
* [Guidelines how to integrate with the ledger canister](./integrate-sns/ledger-integration.md).
* [Guidelines how to integrate with the index canister](./integrate-sns/index-integration.md).
* [An introduction to SNS integration](./integrating/index.md). <!--Guidelines how to integrate a frontend (integrate-sns/frontend-integration.md)-->
* [Guidelines how to integrate with the ledger canister](./integrating/ledger-integration.md).
* [Guidelines how to integrate with the index canister](./integrating/index-integration.md).

## SNS testing
An important part of preparing an SNS launch, integrating with an SNS, and managing an SNS, is testing.
This section provides
* [An introduction to SNS testing](./get-sns/get-sns-intro.md).
* [Guidelines how to test an SNS locally](./get-sns/local-testing.md), including the SNS lauch.
* [Guidelines how to test the operation of the dapp under SNS control](./get-sns/testflight.md), including on mainnet.
* [An introduction to SNS testing](./testing/testing-before-launch.md).
* [Guidelines how to test an SNS locally](./testing/local-testing.md), including the SNS lauch.
* [Guidelines how to test the operation of the dapp under SNS control](./testing/testflight.md), including on mainnet.
dprats marked this conversation as resolved.
Show resolved Hide resolved

## SNS launch
This parts explains how an [SNS is launched on mainnet](./launch-sns/launch-sns.md).
This parts explains how an [SNS is launched on mainnet](./launching/launch-steps.md).

## Managing an SNS
After an SNS is launched, the SNS community needs to manage it, including ensuring that the canisters have enough cycles,
govern the dapp, and manage SNS canister upgrades.
This section includes
* [An introduction to managing an SNS](./managing-sns/manage-sns-intro.md).
* [Tips regarding cycles management for the canisters](./managing-sns/cycles-usage.md).
* [An introduction to managing an SNS](./managing/manage-sns-intro.md).
* [Tips regarding cycles management for the canisters](./managing/cycles-usage.md).


<!-- Information on nervous system parameters that can be configured in each SNS (managing-sns/nervous-system-parameters.md); Information on how SNS are upgraded (managing-sns/upgradeSNS.md); A guideline for SNS proposals (managing-sns/proposal-guide.md)-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ For example, DEXs might have to interact with the SNS ledger canister.
As these considerations are not only relevant for the SNS launch but during the
full SNS lifecycle, we explain them in this separate section.
You can find more information on
* The [ledger canister integration](../integrate-sns/ledger-integration.md).
* The [index canister integration](../integrate-sns/index-integration.md).
* The [ledger canister integration](../integrating/ledger-integration.md).
* The [index canister integration](../integrating/index-integration.md).
* Swap and governance frontend integration to follow.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ called the **SNS wasm modules canister (SNS-W)**.
When an SNS is created, SNS-W is involved and responsible for deploying the latest version of
the SNS canister.
When the SNS should be updated, this happens by an NNS proposal that adds a new version of the
SNS cansiters to SNS-W.
SNS canisters to SNS-W.
Each SNS community can then simply decide to adopt these new, approved versions in their SNS instance.

### Customizability
Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,79 @@
# SNS launch
# SNS launch steps

## Overview
An SNS can be launched in production by following the steps explained on a
high level [here](../lifecycle-sns/sns-launch.md).
high level [here](../launching/launch-summary.md).

Technically, these are the same steps that the
[SNS local testing repository](../get-sns/local-testing.md) guides you through,
[SNS local testing repository](../testing/local-testing.md) guides you through,
with the difference that the commands target the canisters on the mainnet.

To make the most important commands and what they need to look like for
mainnet more accessible, they are listed below.

## Submitting an NNS proposal to approve the SNS {#SNS-launch-command-NNSproposal1}
After preparations and choosing the parameters
([Step 1: Preparation](../lifecycle-sns/sns-launch.md/#SNS-launch-step-preparation),
an [NNS proposal approves the creation of the SNS](#SNS-launch-step-NNSapproval).
Anyone who owns and NNS neuron with enough stake can submit such a proposal
that lists a principal wallet in SNS-W who can then deploy the SNS canisters.
For the larger context, you can consider how this command is used in the SNS
local testing repository
[here](https://github.com/dfinity/sns-testing/blob/main/deploy_sns.sh#L18-L23).
```
## Requirements

### 1. IC SDK

See: [installing the IC SDK](../../../setup/install).

### 2. `ic-admin`

See: [installing the `ic-admin`](../../../setup/ic-admin.md).

### 3. `sns` CLI

:::note
The version of the sns CLI that is bundled with your dfx version may not have the latest commands described in the Usage section. If needed, it is recommended to build and use the sns CLI tool yourself.
:::

```bash
git clone [email protected]:dfinity/ic.git
cd ic
bazel build //rs/sns/cli:sns
ls bazel-bin/rs/sns/cli/sns
```
## Stages

### 1. Dapp developers choose the initial parameters of the SNS for a dapp

Typically, dapp developers typically choose initial parameters that will be used in subsequent proposals.

### 2. Dapp developers submit NNS proposal so they can deploy to the SNS subnet

Anyone who owns an NNS neuron with enough stake can submit a proposal
that lists a principal wallet in [SNS-W](../introduction/sns-architecture.md#SNS-W) who can then deploy the SNS canisters.

To create such a proposal, a common path is to use `ic-admin` and run the following:

```bash
ic-admin \
--nns-url "${NETWORK_URL}" propose-to-update-sns-deploy-whitelist \
--added-principals "${WALLET}" \
--proposal-title "Let me SNS!" \
--summary "This proposal whitelists developer's principal to deploy SNS"
```

For the ic-admin command you could substitute `NETWORK_URL` with `https://nns.ic0.app` and for the `dfx`
there is a shorthand where you can just provide `dfx canister -- network ic`.
* One can substitute `WALLET` with the principal in question
* One can substitute `NETWORK_URL` with `https://nns.ic0.app`
dprats marked this conversation as resolved.
Show resolved Hide resolved

dprats marked this conversation as resolved.
Show resolved Hide resolved
### 3. Proposal #1 (of 3) is passed or rejected

### 4. Dapp developers trigger the SNS canisters to be created on SNS subnet

## SNS canister creation calling SNS-W {#SNS-launch-command-SNSW}
After the wallet canister is listed in SNS-W,
the [SNS canisters are created triggered by a manual call to SNS-W](../lifecycle-sns/sns-launch.md/#SNS-launch-step-deployment).
You can find this command in an example in the SNS local testing repository [here](https://github.com/dfinity/sns-testing/blob/main/deploy_sns.sh#L33)
```
the [SNS canisters are created triggered by a manual call to SNS-W](../launching/launch-steps.md/#SNS-launch-step-deployment).

The `sns CLI` command to trigger the creation of SNS canisters on the SNS subnet:

```bash
sns deploy --network "${NETWORK}" --init-config-file "${CONFIG}" --save-to "sns_canister_ids.json"
```

## Submitting an NNS proposal to start the SNS swap {#SNS-launch-command-NNSproposal2}
### 5. Dapp developers submit an SNS proposal to handover control of their dapp to the SNS

After the SNS canisters are deployed and the dapp's control is handed over to
the SNS, an [NNS proposal starts the swap](../lifecycle-sns/sns-launch.md/#SNS-launch-step-startSwap).
the SNS, an [NNS proposal starts the swap](../launching/launch-steps.md/#SNS-launch-step-startSwap).
Again, anyone who owns an NNS neuron with enough stake can submit this proposal.
Of course it is crucial to set the right parameters in this proposal.
You can also find an example how this command is used in the SNS local testing
Expand All @@ -64,8 +96,22 @@ ic-admin \
--summary "Decentralize this SNS"
```

### 6. Proposal #2 (of 3) is passed or rejected

Nothing technical for dapp developers to do. Community votes.

### 7. Proposal to start the decentralization swap

### 8. Proposal #3 (of 3) is passed or rejected

Nothing technical for dapp developers to do. Community votes.

### 9. SNS participants participate in the decentralization swap

Nothing technical for dapp developers to do. Community participates in the swap.

### 10. SNS canisters become SNS DAO

## Finalizing the SNS swap {#SNS-launch-command-finalizingswap}
When the swap ends, either because its deadline is reached or because the maximum
ICP have been collected, its finalization has to be triggered by a manual call
to the SNS swap that can be done by anyone.
Expand Down
Loading
Loading