Difference between revisions of "How-To: Participate in the SNS decentralization swap via quill"

From Internet Computer Wiki
Jump to: navigation, search
Line 7: Line 7:
  
 
(1)
 
(1)
'''quill sns --pem-file <PEM_FILE> --canister-ids-file <SNS_CANISTER_IDS_FILE> new-sale-ticket --amount-icp-e8s <AMOUNT>'''
+
  quill sns \
 +
  --pem-file <PEM_FILE> \
 +
  --canister-ids-file <SNS_CANISTER_IDS_FILE> \
 +
  new-sale-ticket \
 +
  --amount-icp-e8s <AMOUNT>
  
 
(2)
 
(2)
'''quill sns --pem-file <PEM_FILE> --canister-ids-file <SNS_CANISTER_IDS_FILE> pay --amount-icp-e8s <AMOUNT> --ticket-creation-time <TICKET_CREATION_TIME> --ticket-id <TICKET_ID>'''
+
  quill sns \
 +
  --pem-file <PEM_FILE> \
 +
  --canister-ids-file <SNS_CANISTER_IDS_FILE> \
 +
  pay \
 +
  --amount-icp-e8s <AMOUNT> \
 +
  --ticket-creation-time <TICKET_CREATION_TIME> \
 +
  --ticket-id <TICKET_ID>
 +
 
  
 
where
 
where
Line 18: Line 29:
 
* <TICKET_CREATION_TIME> is the ticket creation time returned in the response from the `new-sale-ticket` quill command.
 
* <TICKET_CREATION_TIME> is the ticket creation time returned in the response from the `new-sale-ticket` quill command.
 
* <TICKET_ID> is the ticket id returned in the response from the `new-sale-ticket` quill command.
 
* <TICKET_ID> is the ticket id returned in the response from the `new-sale-ticket` quill command.
 +
 +
=== Example ===
 +
 +
Assume that you have a set-up where your PEM file is called identity.pem and the contents of the <SNS_CANISTER_IDS_FILE> looked like this:
 +
 +
{
 +
    "governance_canister_id": "53zcu-tiaaa-aaaaa-qaaba-cai",
 +
    "index_canister_id": "5o6tz-saaaa-aaaaa-qaacq-cai",
 +
    "ledger_canister_id": "54yea-6qaaa-aaaaa-qaabq-cai",
 +
    "root_canister_id": "5s2ji-faaaa-aaaaa-qaaaq-cai",
 +
    "swap_canister_id": "5j7vn-7yaaa-aaaaa-qaaca-cai"
 +
  }

Revision as of 23:29, 24 February 2023

Background and objective

  • The goal of this page is to explain how you participate in the SNS decentralization sale via quill, including an example.
  • We assume that you have a working installation of quill and are familiar with the tool. For an introduction into quill, please see here. For instructions on how to install and use quill please see the readme on GitHub and the quill documentation.

Command syntax to participate in the SNS decentralization sale via quill

To participate in the sale via quill, two sequential commands are required. The first (1) command is to get a ticket from the sale canister specifying the amount you'd like to participate with. The second (2) command uses fields from the response of the first command to transfer tokens and notify the sale canister. The syntax is as follows

(1)

 quill sns \
 --pem-file <PEM_FILE> \
 --canister-ids-file <SNS_CANISTER_IDS_FILE> \
 new-sale-ticket \
 --amount-icp-e8s <AMOUNT>

(2)

 quill sns \
 --pem-file <PEM_FILE> \
 --canister-ids-file <SNS_CANISTER_IDS_FILE> \
 pay \
 --amount-icp-e8s <AMOUNT> \
 --ticket-creation-time <TICKET_CREATION_TIME> \
 --ticket-id <TICKET_ID>


where

  • <PEM_FILE> is the path to the Privacy-Enhanced Mail (PEM) file created when quill was set up.
  • <SNS_CANISTER_IDS_FILE> is the path to the json file containing the canister ids of an SNS.
  • <AMOUNT> is the amount of ICP you'd like to participate with denoted in "e8s equivalent" (10E-8 of ICP)
  • <TICKET_CREATION_TIME> is the ticket creation time returned in the response from the `new-sale-ticket` quill command.
  • <TICKET_ID> is the ticket id returned in the response from the `new-sale-ticket` quill command.

Example

Assume that you have a set-up where your PEM file is called identity.pem and the contents of the <SNS_CANISTER_IDS_FILE> looked like this:

{
    "governance_canister_id": "53zcu-tiaaa-aaaaa-qaaba-cai",
    "index_canister_id": "5o6tz-saaaa-aaaaa-qaacq-cai",
    "ledger_canister_id": "54yea-6qaaa-aaaaa-qaabq-cai",
    "root_canister_id": "5s2ji-faaaa-aaaaa-qaaaq-cai",
    "swap_canister_id": "5j7vn-7yaaa-aaaaa-qaaca-cai"
 }