Skip to content

User Test Guide

zhaojun.sh edited this page Dec 28, 2018 · 2 revisions

Fusion DCRM Interactive Console testing

The dcrm CLI executable gdcrm has a JavaScript console, which can be started with the console or attach subcommand. The console subcommands starts the gdcrm node and then opens the console. The attach subcommand will not start the gdcrm node but instead tries to open the console on a running gdcrm node.

$ gdcrm --networkid 40410 console

The attach node accepts an endpoint in case the gdcrm node is running with a non default ipc endpoint or you would like to connect over the rpc interface.

$ gdcrm attach ipc:/some/custom/path
$ gdcrm attach http://127.0.0.1:8214
$ gdcrm attach ws://127.0.0.1:8215

Note that by default the gdcrm node doesn't start the http and weboscket service and not all functionality is provided over these interfaces due to security reasons. These defaults can be overridden when the --rpcapi and --wsapi arguments when the gdcrm node is started.

If you need log information, start with:

$ gdcrm --verbosity 5 console 2>> /tmp/dcrm.log

Otherwise mute your logs, so that it does not pollute your console:

$ gdcrm console 2>> /dev/null

or

$ gdcrm --verbosity 0 console

gdcrm has support to load custom JavaScript files into the console through the --preload argument. This can be used to load often used functions, setup web3 contract objects, or ...

gdcrm --preload "/my/scripts/folder/utils.js,/my/scripts/folder/contracts.js" console

You can exit the console cleanly by typing exit or simply with CTRL-C.

Account Management Test

WARNING Remember your password.

If you lose the password you use to encrypt your account, you will not be able to access that account. Repeat: It is NOT possible to access your account without a password and there is no forgot my password option here. Do not forget it.

The fusion CLI gdcrm provides account management via the account command:

$ gdcrm account <command> [options...] [arguments...]

Manage accounts lets you create new accounts, list all existing accounts, import a private key into a new account, migrate to newest key format and change your password.

It supports interactive mode, when you are prompted for password as well as non-interactive mode where passwords are supplied via a given password file. Non-interactive mode is only meant for scripted use on test networks or known safe environments.

Make sure you remember the password you gave when creating a new account (with new, update or import). Without it you are not able to unlock your account.

Note that exporting your key in unencrypted format is NOT supported.

Keys are stored under <DATADIR>/keystore. Make sure you backup your keys regularly! If a custom datadir and keystore option are given the keystore option takes preference over the datadir option.

The newest format of the keyfiles is: UTC--<created_at UTC ISO8601>-<address hex>. The order of accounts when listing, is lexicographic, but as a consequence of the timespamp format, it is actually order of creation

It is safe to transfer the entire directory or the individual keys therein between fusion nodes. Note that in case you are adding keys to your node from a different node, the order of accounts may change. So make sure you do not rely or change the index in your scripts or code snippets.

And again. DO NOT FORGET YOUR PASSWORD

COMMANDS:
     list    Print summary of existing accounts
     new     Create a new account
     update  Update an existing account
     import  Import a private key into a new account

You can get info about subcommands by gdcrm account <command> --help.

$ gdcrm account list --help
list [command options] [arguments...]

Print a short summary of all accounts

OPTIONS:
  --datadir "/home/bas/.fusion"  Data directory for the databases and keystore
  --keystore                       Directory for the keystore (default = inside the datadir)

Accounts can also be managed via the Javascript Console.

creating an account

$ gdcrm account new
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase:
Repeat Passphrase:
Address: {10C8e424d15EC1da73D5431366500D60746662a2}

Listing your current accounts

From the command line, call the CLI with:

$ gdcrm account list
Account #0: {bfa394397f7b812A440897337b3bE53ae2aC879B} keystore:///tmp/mykeystore/UTC--2018-11-28T08-46-27.437847599Z--bfa394397f7b812A440897337b3bE53ae2aC879B
Account #1: {8DEc6a2D8697c2110FCA3A5c953b5d046f6366De} keystore:///tmp/mykeystore/UTC--2018-11-28T08-46-52.180688336Z--8DEc6a2D8697c2110FCA3A5c953b5d046f6366De

to list your accounts in order of creation.

Test the lockin and lockout

Visit: lilo-console-test