Creating a decentralized sale - "Identity nns-ledger-default-identity does not exist"

Since the logo is not implemented in the token standard, I am now trying to set up a decentralized sale with these instructions: Internet Computer Content Validation Bootstrap.

Unfortunately I encounter two errors here and I don’t understand exactly what I’m doing wrong:

Step 5 says execute the command dfx identity use nns-ledger-default-identity

I get this error:

Error: Failed to switch default identity to 'nns-ledger-default-identity'.
Caused by: Failed to switch default identity to 'nns-ledger-default-identity'.
Identity nns-ledger-default-identity does not exist at '/home/anon/.config/dfx/identity/nns-ledger-default-identity/identity.pem'.

I thought I need to create an identity with sns-quill. I installed this in the root directory and in the project directory. When I run this: sns-quill generate --pem-file identity.pem --seed-file seed.txt

I get this error:

sns-quill command not found

What am I doing wrong?

This identity refers to the identity you should have created at the end of Step 1. You can Ctrl+f for make sure you also import the following identity
If you imported this identity, replace nns-ledger-default-identity with the name you gave to the imported identity.

You didn’t add sns-quill to your PATH.

2 Likes

Right, my mistake. That’s really logical. Thank you!

I have now created the Identity and added sns-quill to the Path. Now I am wondering at step 6 where exactly my NNS dapp is supposed to be. I did dfx nns install. The instructions say it will show me two links. For me, only one link is shown and the command has been running forever now without finishing.

Successfully installed wasm into canister with ID: renrk-eyaaa-aaaaa-aaada-cai
Installed renrk-eyaaa-aaaaa-aaada-cai with genesis-token-canister
NNS canisters installed after 22.0 s
NNS canisters set up after 24.0 s
[ic-nns-init] All NNS canisters have been set up on the replica with http://127.0.0.1:43507/
Uploading NNS configuration data...

This is how it looks for me. Where can I find my local NNS? @Severin

This shouldn’t take too long. It takes 3-5 seconds on my machine.

Comparing with my own replica it looks like II and NNS dapp canisters are not even created yet. See last two canisters:

The command is only done once it displays the following:

######################################
# NNS CANISTER INSTALLATION COMPLETE #
######################################

Backend canisters:
nns-registry          rwlgt-iiaaa-aaaaa-aaaaa-cai
nns-governance        rrkah-fqaaa-aaaaa-aaaaq-cai
nns-ledger            ryjl3-tyaaa-aaaaa-aaaba-cai
nns-root              r7inp-6aaaa-aaaaa-aaabq-cai
nns-cycles-minting    rkp4c-7iaaa-aaaaa-aaaca-cai
nns-lifeline          rno2w-sqaaa-aaaaa-aaacq-cai
nns-genesis-token     renrk-eyaaa-aaaaa-aaada-cai
nns-identity          rdmx6-jaaaa-aaaaa-aaadq-cai
nns-ui                qoctq-giaaa-aaaaa-aaaea-cai
nns-sns-wasm          qaa6y-5yaaa-aaaaa-aaafa-cai
nns-ic-ckbtc-minter   qjdve-lqaaa-aaaaa-aaaeq-cai


Frontend canisters:
internet_identity     http://qhbym-qaaaa-aaaaa-aaafq-cai.localhost:8080/
nns-dapp              http://qsgjb-riaaa-aaaaa-aaaga-cai.localhost:8080/
1 Like

I made it work!

There are two identities mentioned and I can’t exactly tell if they are different or the same.

Is nns-ledger-default-identity the same as the developer-identity?

Step 7v says:
grafik

Do I have to enter dfx --identity nns-ledger-default-identity identity get-principal? Or do I still have to create it and if so, how?

@Severin

You’re supposed to work with two dfx identities and swap between the two as needed. This step refers to the other one, not nns-ledger-default-identity.

I guess it’s possible to only use one for everything, but I haven’t tested it

1 Like

I guess it only works with two because now I have to execute this command to put myself on the WL

$(dfx cache show)/ic-admin --secret-key-pem ~/.config/dfx/identity/$(dfx identity whoami)/identity.pem --nns-url "http://localhost:$(dfx info replica-port)" propose-to-update-sns-deploy-whitelist --added-principals "$(dfx identity get-wallet)" --proposer "$DEVELOPER_NEURON_ID" --proposal-title "Let me SNS!" --summary "I am friendly."

but this error comes up(while using nns-ledger-default-identity)

thread 'main' panicked at 'Invalid secret key.: InvalidPem(Custom { kind: InvalidData, error: "PEM file doesn't start with 'BEGIN PRIVATE KEY' block" })', rs/registry/admin/src/main.rs:3196:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

How can I solve this?

And how can I give other identities the possibility to get into the WL since if I want to use the default identity, for example, this is not possible

@Severin

This will be fixed by the next dfx version. You can already try 0.13.0-beta.0 if you manually install it. The problem is that ic-admin on dfx earlier than 0.13.0 only supports secp256k1 keys, while dfx switched to producing ed25519 in version 0.12.0 (or was it the other way round? I may be switching the two curve names). Therefore: to use ic-admin from dfx version <0.13, you have to use an identity that was generated (referring to dfx identity new, not dfx identity import) with dfx <0.12. If you revert to e.g. dfx 0.11.3 to generate another identity, you can use both with ic-admin

Also: my bad for not documenting this properly. I thought the next dfx release would come much sooner, so I didn’t document this weird behaviour properly.

1 Like

I’m glad I’m getting help! Thank you for the detailed explanation.

I have now selected my default identity, which I created <0.12 and now the following message comes up

How to authorize my identity?

I don’t see anything wrong with what you’re doing. I’ll ask around and if I don’t answer within a day or so, feel free to ping me again.

1 Like

The team says the error comes from this check and that likely the error is that you forgot to add the developer identity as a hotkey to the neuron you’re trying to propose with. That would be step 2.7.5 with the current version of the instructions.

1 Like

Thank you so much, that worked!

Now when I want to run dfx sns deploy

anon@DESKTOP-TO5O5UE:~/ic-projects/inusnslaunch/inusnslaunch$ dfx sns deploy
Creating SNS canisters.  This typically takes about one minute...
Error: Failed to deploy SNS with config: /home/anon/ic-projects/inusnslaunch/inusnslaunch/sns.yml
Caused by: Failed to deploy SNS with config: /home/anon/ic-projects/inusnslaunch/inusnslaunch/sns.yml
  Failed to call sns CLI.
    Call failed:
"/home/anon/.cache/dfinity/versions/0.12.1/sns" deploy --init-config-file /home/anon/ic-projects/inusnslaunch/inusnslaunch/sns.yml --candid candid/nns-sns-wasm.did --save-to .dfx/local/canister_ids.json
Stdout:


Stderr:
Error encountered when generating the SnsInitPayload: Couldn't parse the initial parameters file ("/home/anon/ic-projects/sns/sns.yml"): invalid type: string "0,", expected u64 at line 1 column 20

I do not understand what exactly is expected? Did I not format the yaml file correctly?

transaction_fee_e8s: 10000
token_name: Token Name 
token_symbol: SYMBOL
proposal_reject_cost_e8s: 100000000
neuron_minimum_stake_e8s: 100000000
neuron_minimum_dissolve_delay_to_vote_seconds: 15778800
logo: /home/anon/ic-projects/sns/logo.jpg
url: null
name: Token Name
description: null
reward_rate_transition_duration_seconds: 1
initial_reward_rate_percentage: 0
final_reward_rate_percentage: 0
max_dissolve_delay_seconds: 252460800
max_neuron_age_seconds_for_age_bonus: 126230400
max_dissolve_delay_bonus_multiplier: 2
max_age_bonus_multiplier: 1.25
fallback_controller_principal_ids:
  - kuusj-tqvcq-c3upw-yx6wm-m7pf6-fmiew-hzksq-xieyv-k7rzp-ozbuh-2qe
  - ios5o-qvdml-4tptp-e5ybr-ktvc3-woli6-yy6nt-tvoa4-ytnm2-i5q3w-4ae
initial_voting_period_seconds: 345600
wait_for_quiet_deadline_increase_seconds: 86400
initial_token_distribution:
  FractionalDeveloperVotingPower:
    developer_distribution:
      developer_neurons:
        - controller: kuusj-tqvcq-c3upw-yx6wm-m7pf6-fmiew-hzksq-xieyv-k7rzp-ozbuh-2qe
          stake_e8s: 1500000000
          memo: "0,"
          dissolve_delay_seconds: 0
        - controller: ios5o-qvdml-4tptp-e5ybr-ktvc3-woli6-yy6nt-tvoa4-ytnm2-i5q3w-4ae
          stake_e8s: 1500000000
          memo: "1,"
          dissolve_delay_seconds: 0
    treasury_distribution:
      total_e8s: 5000000000
    swap_distribution:
      total_e8s: 6000000000
      initial_swap_amount_e8s: 3000000000
    airdrop_distribution:
      airdrop_neurons:
        - controller: kuusj-tqvcq-c3upw-yx6wm-m7pf6-fmiew-hzksq-xieyv-k7rzp-ozbuh-2qe
          stake_e8s: 500000000
          memo: "0,"
          dissolve_delay_seconds: 15780000

@Severin

The error message invalid type: string "0,", expected u64 gives a hint. If you search for "0,", it’ll point you to the second last line, where you have memo: "0,". Change this to a valid u64 (e.g. 534, then it should work. If you want to compare, here is a valid sns.yml.

expected u64 at line 1 column 20
The wrong location indicator is probably because of some parsing library that gets called recursively.

1 Like

Wow yes right that solved it!

I am now running into:

Argument list too long (os error 7)', rs/sns/cli/src/main.rs:337:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I tried the whole thing with the sample version you sent me and other principal IDs but I still get the same error so it can’t be the yaml file probably. @Severin

This is a limitation of bash/your shell, see this SO answer.

Since this didn’t happen on my machine (macOS with zsh), and not on CI (both macOS and Ubuntu, not sure which shells they use), I’d recommend you try with a different shell.

Can you also tell me which shell you’re using? I’d like to reproduce this on CI so we can figure out a way to circumvent that limit and also make sure we test for it.

1 Like

I was using /bin/bash. I’m trying other shells right now, but can’t find the right one yet.

Which should I use?
grafik
@Severin

I’m not sure, I guess you’ll have to try it out. I know that on my machine zsh works well. Maybe it is also possible to somehow adjust the max parameter length?

1 Like

I tried that and also tried to increase the parameters length but I’m still stuck to this day. Is there anything else I can try? @Severin

I’ll ping the team, maybe they have an idea that works without code changes. Otherwise someone would have to do something like this PR that added support for an argument file. Feel free to ping me again if you don’t receive help within a few days.

1 Like

Hello @mindfulanon . May I ask which version of bash? Just checking as Mac ships with a version that is over a decade old and a lot goes wrong with it.

1 Like