5

If I understand it correctly, near dev-deploy creates temporary dev-123-456 account for smart contract while near deploy will use testnet account.

What are different use cases of when to use near deploy to testnet and near dev-deploy?

Ondřej Ševčík
  • 1,049
  • 3
  • 15
  • 31

1 Answers1

5

near dev-deploy is used during development to help save time while creating, deleting and recreating accounts.

NEAR accounts allow contract redeployment (you can redeploy a contract as many times as you like if you have a FullAccess key attached to the account)

but deploying a contract does NOT change account state

this can leave developers with an updated contract but old state on the account which is a common source of errors for beginners

to help people avoid this problem of mismatched contract code and state during development, the near dev-deploy command was introduced

you use it to quickly deploy a contract to a generated account name which you can then delete and recreate from scratch anytime because you don't care about the account name


near deploy is the command you would use when you have a specific account in mind to which you want to deploy your contract

this makes perfect sense when deploying a version of your contract that you want to share with others on TestNet and definitely when moving to MainNet

amgando
  • 1,563
  • 8
  • 12