Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc for import & export cylinder group keys #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions band-v3-testnet-1/docs/export-and-import-cylinder-group-keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Export & Import Cylinder groups' keys

Once you have joined the TSS group, you can export the group's keys for future import. In case you set up a new node, these exported keys can be imported to ensure seamless participation in the TSS group.

## Setup Variables

Before beginning instructions, the following variables should be set to be used in further instructions. Please make sure that these variables are set every time when using the new shell session.

```bash
# Chain ID of Band V3 Testnet #1
export CHAIN_ID="band-v3-testnet-1"
# Wallet name that used as your validator's account.
export WALLET_NAME=<YOUR_WALLET_NAME>
# Reload from the .profile file
source $HOME/.profile
```

## Export Cylinder groups' keys

### Step 1: Stop Cylinder

If your cylinder is running, stop it before exporting keys

```bash
sudo systemctl stop cylinder
```


### Step 2: Export keys

```bash
cylinder export groups --all --output cylinder_key.json
```

Your keys will be at cylinder_key.json, save it in the safe place.

### Step 3: Restart Cylinder

```bash
# Start cylinder daemon
sudo systemctl start cylinder
```

After a service has been started, logs can be queried by running `journalctl -u cylinder.service -f` command. Once verified, you can stop tailing the log by typing Control-C.

### Step 4: Activate group members status

If you stop and restart Cylinder, you may be deactivated as a TSS group member. You can verify your status by running the following command:

```bash
bandd query bandtss member $(bandd keys show $WALLET_NAME -a) --chain-id $CHAIN_ID
```

If your status `is_active` is `false` (or not shown in the output, which also means `false`), you can activate after **10 minutes** with this command.

```bash
bandd tx bandtss activate --from $WALLET_NAME \
--gas-prices 0.0025uband \
--chain-id $CHAIN_ID \
-b sync \
-y
```

## Import Cylinder groups' keys

If you are setting up a new node or have lost Cylinder data, you can import the TSS group's keys to resume participation in the TSS group.

### Step 1: Stop Cylinder

If your cylinder is running, stop it before importing keys

```bash
sudo systemctl stop cylinder
```

### Step 2: Import keys


```bash
cylinder import groups <PATH_TO_YOUR_KEYS_FILE>
```

### Step 3: Restart Cylinder

```bash
# Start cylinder daemon
sudo systemctl start cylinder
```

After a service has been started, logs can be queried by running `journalctl -u cylinder.service -f` command. Once verified, you can stop tailing the log by typing Control-C.

### Step 4: Activate group members status

After restart Cylinder, you may be deactivated as a TSS group member. You can verify your status by running the following command:

```bash
bandd query bandtss member $(bandd keys show $WALLET_NAME -a) --chain-id $CHAIN_ID
```

If your status `is_active` is `false` (or not shown in the output, which also means `false`), you can activate after **10 minutes** with this command.

```bash
bandd tx bandtss activate --from $WALLET_NAME \
--gas-prices 0.0025uband \
--chain-id $CHAIN_ID \
-b sync \
-y
```
28 changes: 28 additions & 0 deletions band-v3-testnet-1/docs/import-bothan-private-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Import Bothan private key

If you are setting up a new node or have lost Bothan data, you can import the Bothan keys to resume participation in the Bothan monitoring.

### Step 1: Start Bothan

Start Bothan if not already.

```bash
sudo docker pull bandprotocol/bothan-api:v0.0.1-beta.1
CONTAINER_ID=$(sudo docker run --restart always --log-opt max-size=50m --log-opt max-file=5 -d --name bothan -v "$HOME/.bothan:/root/.bothan" -p 50051:50051 bandprotocol/bothan-api:v0.0.1-beta.1)
```

### Step 2: Import private key

```bash
sudo docker exec -it bothan /bin/sh -c "bothan key import --override"
```

You will be prompted to enter the private key. Please provide the private key you have previously saved.

### Step 3: Restart bothan

```bash
sudo docker restart bothan
```

You should then be able to continue sending Bothan monitoring data using the same account.