What is the recommended way to work with the developer identity in terms of ICP funds?

I’ve been working with the ICP tutorials locally and I want to start experimenting with the real network.

I bought ICP on Coinbase and created an ICP identity through NNS. In order to create my identity I used ledger nano as a physical security device. Now, I have ICP tokens in NNS but I’m still confused with the following:

  • I found that for each computer I have a different developer identity, is there a way to link those developer identities to the identity I created in NNS which has the funds? For example, I have a laptop, my work computer and a desktop at home. I work with the three of them depending the situation since I use git for each project.
  • Maybe it would be easier to create a developer identity based on my NNS identity. Is that possible? If this is true, how can I do that?

Thanks in advance !!!

There is a .pem file somewhere in a usr/*/dfinity folder that the private keys for your developer identity. You should be able to copy this between computers. I don’t think you can do development with your NNS identity because the key is hidden away in the device enclave. You need to send the icp to your developer account/wallet so that you can send them as cycles. I’d recommend the dfx commands as they do list of the hard work.

2 Likes

@skilesare Thanks for your quick response.

So, this your recommendation which I will list it in terms of steps:

  • Choose a .pem file from one of the computers and copy it to the other two computers. That way I will have ONLY one developer identity in the three computers I work with.
  • Send ICP from my NNS account to my developer’s account to fund it.
  • Convert to cycles and work normal from the command line to deploy to mainnet, etc.

One more thing, in my case I found the .pem file in the following path:
/home/my_user_id/.config/dfx/identity/default/identity.pem

I found it with this command in linux:

sudo find / -type f -name '*.pem'

By the way it is the same path on my Mac.

Looks like you’ve got it right. I’d back up that pem file somewhere safe.

@skilesare yeah, I will back up that pem file.

I noticed that just to deploy a simple ‘hello’ project as specified in this tutorial consumed 8000000000000 TC. That is a hefty price just for deploying on mainnet. Do you know if every time I do a change to a canister and re-deploy I will be charged again 4000000000000 TC per canister?

Thanks for the help by the way!!!

That’s the amount used to create a new canister, and seed it with an initial balance. It is a one-time cost, and you can re-use those canisters for whatever you want by installing a new project over them with --mode=reinstall

1 Like

@kpeacock

Thanks for the quick response and clarification.

Any idea what would be the network fee for --mode=reinstall with changes to that canister?
Do I assume that the amount of code in the modified canister will increase/decrease that fee?

It’s trivial enough that I haven’t bothered to look it up

1 Like

@kpeacock

On my first try my assets canister was not deployed because I had insufficient funds, so only one canister was deployed.
When I make a call to the canister like the following, I’m having an error. See below call and error.

dfx canister --network ic call hello_prod greet everyone
error: parser error
  ┌─ Candid argument:1:1
  │
1 │ everyone
  │ ^^^^^^^^ Unexpected token
  │
  = Expects "("

Invalid argument: Invalid Candid values: Candid parser error: Unrecognized token `Id("everyone")` found at 0:8
Expected one of "("

My first thought was that I really don’t need the assets canister if I’m just invoking the greet function on the back end canister that was deployed. Am I missing something?

For future reference, if I re-deploy with:

dfx deploy --network ic

What is going to happen?

Will I be charged again for the back-end canister?
I know you said that using --mode=reinstall will charge a small fee but adding the mode flag to deploy does not work.

Sorry for all the questions but I don’t want to be charged again for nothing.
So far, I’m really impressed how everything works with ICP and I want to test for real in mainnet.

Thanks again!

candid
try calling it with dfx canister --network ic call hello_prod greet '("everyone": text)'
I don’t know if the compatibility for the shorthand may have changed recently

only need backend
If you don’t need the asset canister, just delete the reference to it in dfx.json and you should be good to go.

re-deploy
We haven’t added the --mode flag to deploy, so you’ll need to do the individual steps:

dfx build hello_prod
dfx canister --network ic install hello_prod --mode reinstall

Just to report back that I re-deployed with:

dfx deploy --network ic

I was charged roughly another 4000000000000 TC. I’m guessing for the assets canister.

Now the call to the ‘greet’ function works. I’m just not sure if we ‘really’ need to deploy the assets canister for the backend canister to work or on my first deploy something went wrong besides not deploying the assets canister.

It will be great to see info like this on the documentation.

Thanks again for the support!!!