When i try to dev-deploy for any contract i get `BadRequestError`

Viewed 207

I cloned https://github.com/Learn-NEAR/sample--thanks and when I try to run the dev-deploy I am getting the below error. I am getting the same error for some other contracts too.

How can I fix this error?

BadRequestError: Error: nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.

Edit: Under the same conditions this error happens occasionally.

1 Answers

tl;dr: There is a limit on the number of accounts that can be created per second using dev-deploy, and when there is high demand, this error may occur. Retrying can help getting your account deployed.


When you run dev-deploy a new account is created for you in NEAR Testnet, by testnet account. To execute a deploy tx one of the Full Access Keys associated with this account is used.

The problem is that each key, has a nonce associated with it, and each tx executed with a key should have a nonce bigger than the previous nonce used for a tx. This means that you can't execute two transactions in parallel using the same nonce with the same key.

When several users try to creates accounts using dev-deploy on NEAR Testnet at the same time, the same nonce is used for different tx, and only the first one to be processed is included on chain.

Related