Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] Missing info on workspaces-js testing #2240

Closed
flmel opened this issue Oct 2, 2024 · 0 comments · Fixed by #2241
Closed

[DOC] Missing info on workspaces-js testing #2240

flmel opened this issue Oct 2, 2024 · 0 comments · Fixed by #2241
Labels
enhancement New feature or request

Comments

@flmel
Copy link
Member

flmel commented Oct 2, 2024

Is your feature request related to a problem? Please describe.
Users had issue when trying to test their contract on testnet. Issue was related to setting up and creating accounts via the worker.

Describe the solution you'd like
@gagdiez shared info from previous experience

// init the worker like this
  const worker = t.context.worker = await Worker.init({
    network: 'testnet',
    testnetMasterAccountId: '<your account>.testnet',
    initialBalance: NEAR.parse("<X> N").toString(),
  });

and you need to create the file:

.near-credentials/workspaces/testnet/<your-account>.testnet.json with the credentials
eg.

{"account_id":"guille.testnet","public_key":"ed25519:GnsdHdSrhe8v3ssAdie3RuXy59tMredkwRAFZ9xeWxSWF","private_key":"ed25519:..."}

example snippet

 // Create accounts
  const root = worker.rootAccount;

  const alice = await root.createSubAccount("alice", { initialBalance: NEAR.parse("10 N").toString() });
  const bob = await root.createSubAccount("bob", { initialBalance: NEAR.parse("10 N").toString() });
  const auctioneer = await root.createSubAccount("auctioneer", { initialBalance: NEAR.parse("10 N").toString() });
  const contract = await root.createSubAccount("contract", { initialBalance: NEAR.parse("10 N").toString() });
@flmel flmel added the enhancement New feature or request label Oct 2, 2024
@flmel flmel changed the title [DOC] Missing info fork workspaces-js [DOC] Missing info on workspaces-js testing Oct 2, 2024
@gagdiez gagdiez linked a pull request Oct 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Shipped 🚀
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant