Appearance
User Commands
Create:
It creates a new user account by generating an Ethereum key pair (address, private key, and public key) for the user, optionally from a provided mnemonic. The user information, including the keys, can be saved to a local database or printed in JSON format.
Usage
sh
sct user create --userName <username> [--mnemonic <mnemonic>] [--format <output-format>] [--saveToFile] [--localFile <path>]
--userName
(required): The username for the user account being created.--mnemonic
: The mnemonic phrase for generating the Ethereum keys.
Example
- To create a user with a random mnemonic and save the user information to a file:
sct user create --userName alice --saveToFile --localFile userDatabase.json
- To create a user with a specific mnemonic
sct user create --userName bob --mnemonic "pistol child race luxury"
Fund:
The fund
command is used to transfer funds to a user account. Currently, it supports signing directly using a private key.
Usage
sct user fund --from_privKey <private-key-or-vault> --to <recipient-address> --amount <fund-amount> --network <rpc-url>
--from_privKey
(required): Sender’s private key--from_address:
The sender address (required iffrom_privKey
is "vault").--from_name
: The sender name (required when using "vault" as--from_privKey
).--to
: (required): The recipient user’s address.--amount
: The amount to transfer (default is0.1
ETH).--network
(required): The Ethereum network (RPC URL) to use for the transaction.
Example
- To fund a user using a private key:
sct user fund --from_privKey="0xYourPrivateKey" --to="0xRecipientAddress" --amount=2 --network="http://localhost:8545"