WARNING: Remember your password. If you lose the password of your account, you will not be able to access that account. There is no forgot my password option here. Never forget it.
Klaytn provides two handy command-line tools,
The Klaytn Endpoint Node binary
ken provides account management via the
account command. The command
account lets you create new accounts, lists all existing accounts, imports a private key into a new account, migrates to the newest key format, and changes your password.
$ ken account <command> [options...] [arguments...]
$ ken account -help...COMMANDS:list Print summary of existing accountsnew Create a new accountupdate Update an existing accountimport Import a private key into a new account...
You can get info about subcommands by
ken account <command> --help.
$ ken account list --helplist [command options] [arguments...]Print a short summary of all accountsKLAY OPTIONS:--dbtype value Blockchain storage database type ("leveldb", "badger") (default: "leveldb")--datadir "/Users/ethan/Library/KEN" Data directory for the databases and keystore--keystore Directory for the keystore (default = inside the datadir)DATABASE OPTIONS:--db.no-partitioning Disable partitioned databases for persistent storage
Keystore files are stored under
<DATADIR>/keystore. You can specify the data directory as below. It is highly recommended to execute
ken account command with
--datadir option. Make the data directory point to the
DATA_DIR set in the
kend.conf to seamlessly share the accounts with your Endpoint Node.
$ ken account new --datadir <DATADIR>$ ken account new --datadir "~/kend_home"
If you do not specify the data directory, the default location is as follows.
klay to get the list of available functions. In this tutorial, we are going to visit the following functions.
> personal.newAccount()> personal.importRawKey()> personal.unlockAccount()> klay.accounts> klay.getBalance()
When you create an account, the keystore file is stored under
<DATADIR> is the
DATA_DIR set in the
kend.conf. If you follow the quick start guide with the given example, it must be