Skip to content

Keystore

Debendra Oli edited this page Jan 19, 2024 · 14 revisions

The relay features built-in keystore functionality. This allows the relay to sign transactions and messages without the need for an external keystore. The relay keystore is encrypted using a password and stored in a file.

The passowrd is stored and encrypted using AWS KMS. The relay uses the AWS credentials stored in the ~/.aws/credentials file. The relay uses the default profile to access the AWS credentials. The relay also needs the AWS region to be set in the ~/.aws/config file. The relay uses the default region to access the AWS region.

The aws credentials and region configuration are also accepted as environment variables and given preference over the configuration files. This behaviour is according to the AWS SDK for Go.

Usage

crly keystore [command] [flags]

The more detailed documentation for the commands can be found here.

crly keystore --help

Create a Keystore

This is assuming that the KMS is configured correctly.

List all available chains

crly config list

1: 0xa869.fuji          -> type(evm)
2: 0x2.icon             -> type(icon)
crly keystore create --chain 0xa869.fuji  --password test

This command will create a keystore for the chain 0xa869.fuji and store it in the default keystore directory. The default keystore directory is ~/.centralized-relay/keystore/<chain-id>.

Import a keystore

crly keystore import --chain 0x2.icon --file <keystore-file-path-to-import> --password <password for existing keystore>

This command will import the keystore from the file and store it in the default keystore directory. The default keystore directory is ~/.centralized-relay/keystore/<chain-id>.

List all available keystores

crly keystore list --chain 0xa869.fuji

This command will list all the available keystores for the chain 0xa869.fuji.

Wallet Balance
0x7CE64B2479F39cA57705F328aa62Ba2be95461DE 0.000000eth
0xB89596d95b2183722F16d4C30B347dadbf8C941a 2.061747eth
0xC8eC79EB45eD273F99E0f11ed9C4A6fee456c36F 0.000000eth
0x0B958dd815195F73d6B9B91bFDF1639457678FEb 0.000000eth
0x3B4fB81FF8EdEbb163EFaBEB4A35d0E586253d87 0.000000eth

Use a keystore

crly keystore use --chain 0xa869.fuji --address 0xB89596d95b2183722F16d4C30B347dadbf8C941a

This command will use the keystore 0x7CE64B2479F39cA57705F328aa62Ba2be95461DE for the chain 0xa869.fuji. This command will also set the default keystore for the chain 0xa869.fuji.

The trust wallet address which relay will use will be also set to the centralised contract connection for the specified chain. The available chains can be listed using the command crly chains list.

Clone this wiki locally