Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'method-calls' of github.com:nearprotocol/near-shell int…
Browse files Browse the repository at this point in the history
…o method-calls
  • Loading branch information
vgrichina committed May 21, 2019
2 parents 281a0bb + 3c0cf47 commit 3569915
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion bin/near
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ yargs // eslint-disable-line
type: 'string',
default: 'http://localhost:3030'
})
.option('networkId', {
desc: 'NEAR network ID, allows using different keys based on network',
type: 'string',
default: 'default'
})
.option('helperUrl', {
desc: 'NEAR contract helper URL',
type: 'string',
Expand All @@ -125,12 +130,12 @@ yargs // eslint-disable-line
.alias({
'accountId': ['account_id'],
'nodeUrl': 'node_url',
'networkId': ['network_id'],
'wasmFile': 'wasm_file',
'projectDir': 'project_dir',
'outDir': 'out_dir'
})
.showHelpOnFail(true)
.demandCommand(1, 'Please enter a command')
.strict()
.argv;

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ exports.createDevAccount = async function(options) {

await neardev.connect(options);
await options.deps.createAccount(options.accountId, keyPair.getPublicKey());
const keyStore = new UnencryptedFileSystemKeyStore();
const keyStore = new UnencryptedFileSystemKeyStore('./', options.networkId);
keyStore.setKey(options.accountId, keyPair);
console.log("Create account complete.");
};

async function connect(options) {
const keyStore = new UnencryptedFileSystemKeyStore();
const keyStore = new UnencryptedFileSystemKeyStore('./', options.networkId);
if (!options.accountId) {
// see if we only have one account in keystore and just use that.
const accountIds = await keyStore.getAccountIds();
Expand Down

0 comments on commit 3569915

Please sign in to comment.