Skip to content
by Unity Nodes
Development

Master account can't create in Terminal

2 posts177 viewsLast activity Nov 2022

  1. Kaz-T-entreOP

    Hi.
    Trying to create Masteraccount in Terminal in NEAR, but there’s shown [必須の引数が見つかりません:masterAccount] ([Required argument not found: masterAccount])

    I’d just started learning Rust, but I’ve been experienced C and Javascript for about two month. Installed Hardhat and I can write some codes by following some instructions. I’ve used to develop my app in Nocode so I’d know a basic database knowledges.

    Now I’m trying to build smart contract in NEAR by using Rust, but it doesn’t work.

    I’m using this tutorial Figment Learn | How to write and deploy a smart contract in Rust and already installed NEAR CLI and Rust, and already done until chapter “Deploying the contract”

    I did this command:

    near create-account CONTRACT_NAME.ACCOUNT_ID --masterAcount ACCOUNT_ID --initialBalance 10

    Then expected result is as follows:
    Saving key to ‘/home/xxx/.near-credentials/testnet/CONTRACT_NAME.ACCOUNT_ID.json’
    Account CONTRACT_NAME.ACCOUNT_ID.testnet for network “testnet” was created.

    And as the instruction says “For example, assuming your current account_id on near testnet is fido.testnet and you’d like to name the contract dodo then you’ll end up creating the following new account_id dodo.fido.testnet which will stand for the contract_id.”

    So I changed the command above to this:
    near create-account test.dragonrapper.testnet --masterAcount dragon rapper.testnet --initialBalance 10

    (dragonrapper.testnet is my NEAR account name)

    But it doesn’t work, show like this:
    kazt@Marengo src % near create-account test.dragonrapper.testnet --masterAcount dragon rapper.testnet --initialBalance 10
    near create-account

    create a new developer account (subaccount of the masterAccount, ex: app.alice.test)

    オプション:
    –help ヘルプを表示 [真偽]
    –version バージョンを表示 [真偽]
    –nodeUrl, --node_url NEAR node URL [文字列] [デフォルト: “https://rpc.testnet.near.org”]
    –networkId, --network_id NEAR network ID, allows using different keys based on network [文字列] [デフォルト: “testnet”]
    –helperUrl NEAR contract helper URL [文字列]
    –keyPath Path to master account key [文字列]
    –accountId, --account_id Unique identifier for the newly created account [文字列] [必須]
    –useLedgerKey Use Ledger for signing with given HD key path [文字列] [デフォルト: “44’/397’/0’/0’/1’”]
    –seedPhrase Seed phrase mnemonic [文字列]
    –seedPath HD path derivation [文字列] [デフォルト: “m/44’/397’/0’”]
    –walletUrl Website for NEAR Wallet [文字列]
    –contractName Account name of contract [文字列]
    –masterAccount Account used to create requested account. [文字列] [必須]
    –helperAccount Expected top-level account for a network [文字列]
    -v, --verbose Prints out verbose output [真偽] [デフォルト: false]
    -f, --force Forcefully execute the desired action even if it is unsafe to do so [真偽] [デフォルト: false]
    –publicKey Public key to initialize the account with [文字列]
    –newLedgerKey HD key path to use with Ledger. Used to generate public key if not specified directly [文字列] [デフォルト: “44’/397’/0’/0’/1’”]
    –initialBalance Number of tokens to transfer to newly created account [文字列] [デフォルト: “100”]

    必須の引数が見つかりません: masterAccount

    Although the output will be:

    Saving key to ‘/home/xxx/.near-credentials/testnet/CONTRACT_NAME.ACCOUNT_ID.json’
    Account CONTRACT_NAME.ACCOUNT_ID.testnet for network “testnet” was created.

    How can I deal with it??

  2. mm-near

    Hey @Kaz-T-entre - welcome to NEAR.

    Seems that you have a typo: the flag is called --masterAccount (and you typed --masterAcount).

    The following command should work:

    near create-account test.dragonrapper.testnet --masterAccount dragonrapper.testnet --initialBalance 10