How do I create a new account?

Hello,
I’m a software developer. Using the Aeternity node, I want to create a transaction for users on my system. But I couldn’t find a method to create an address for my users in your documentation.

What method will I use to generate a new address in the Node? The HTTP Status 404 occurs when I try the account methods at http://aeternity.com/api-docs/ .

The 404 error also occurs when I perform the operations mentioned at http://aeternity.com/documentation-hub/protocol/node/api/account_api_usage/.

Thanks.

1 Like

You create an account by spending to it. There is no way to create an empty account.

Is there a way to create an address?

you can do that locally by using one of the available SDKs (javascript, python, go, exixir, java)

I wrote an RPC Service and tried to use the Javascript SDK. But when running with Node js, I get the error below.

/home/aeternity/node_modules/@aeternity/aepp-sdk/es/index.js:18
import * as Crypto from './utils/crypto'
       ^

SyntaxError: Unexpected token *
    at Module._compile (internal/modules/cjs/loader.js:720:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/home/aeternity/dist/controller.js:6:14)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)

What I use to create addresses that I would like to actually use later (ie: create also the private key and have it in an usable format) is aecli tool. You just:

$ aecli account create wallet_filename

It will ask for a passphrase to use to save private key. In the genrated wallet_filename you’ll have the new address and the ciphered private key.

You can spend to that new address (as you can to whichever address).

But to sign tx from this new address you’ll need to provide your secretKey or wallet file to the sdk along with your passphrased.

Thanks for reply.

I’d fix the problem. But now when I try to use the Universal class to find out the block height (https://github.com/aeternity/aepp-sdk-js#5-play-with-aetenitys-blockchain-features), the error “Please provide KEY_PAIR for sign transaction” occurs. Why keypair was required when I tried to get the block height.

@noandrea might be able to help here

Thanks. I waiting for @noandrea’s reply.

Hello @sistemkoin-mahsum,

Currently Universal stamp require to provide account. In next sdk release we will change this behaviour and you will have ability manage more then one account or init stamp without accounts at all.

Thanks,
Naz

Thank you, Naz. Please also consider typing for TypeScript.

1 Like