test(2433): capsule wallet script (#2447)

* chore: added bash script for vega wallet

* chore: update readme

* chore: fix lint
This commit is contained in:
Joe Tsang 2022-12-21 11:36:27 +00:00 committed by GitHub
parent b6c448b630
commit d7365c4b66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 4 deletions

View File

@ -8,10 +8,6 @@ outputs:
runs:
using: 'composite'
steps:
- name: Create passphrase
shell: bash
run: echo "${{ inputs.passphrase }}" > ./passphrase
- name: Initialize wallet
shell: bash
run: vega wallet init -f --home ~/.vegacapsule/testnet/wallet

View File

@ -156,6 +156,23 @@ In order to run the bootstrap command to generate and start a new network, we mu
vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl
```
In order to setup and run vegawallet for e2e capsule tests, in a separate terminal window:
1. cd into `./vegacapsule`
2. run:
```bash
bash setup-vegawallet.sh
```
3. copy generated `api-token` and paste the token into `CYPRESS_VEGA_WALLET_API_TOKEN` environment variable in either `apps/token-e2e/.env` or `apps/explorer-e2e/.env` depending on which project needs testing.
Note: The script is only needed if capsule was built for first time or fresh. To run existing wallet service for capsule:
```bash
vega wallet service run -n DV --load-tokens --tokens-passphrase-file passphrase --no-version-check --automatic-consent --home ~/.vegacapsule/testnet/wallet
```
# 📑 License
[MIT](./LICENSE)

1
vegacapsule/passphrase Normal file
View File

@ -0,0 +1 @@
0123245

View File

@ -0,0 +1,22 @@
#!/bin/bash
# Initialise wallet
vega wallet init -f --home ~/.vegacapsule/testnet/wallet
# Import wallet
vega wallet import -w capsule_wallet --recovery-phrase-file ./recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet
# Generate public key
vega wallet key generate -w capsule_wallet -p ./passphrase --home ~/.vegacapsule/testnet/wallet
# Import network
vega wallet network import --force --from-file ./wallet-config.toml --home ~/.vegacapsule/testnet/wallet
# Initialise api-token
vega wallet api-token init --home ~/.vegacapsule/testnet/wallet --passphrase-file passphrase
# Generate api-token
vega wallet api-token generate --wallet-name capsule_wallet --tokens-passphrase-file passphrase --wallet-passphrase-file passphrase --home ~/.vegacapsule/testnet/wallet
# Wallet service run
vega wallet service run -n DV --load-tokens --tokens-passphrase-file passphrase --no-version-check --automatic-consent --home ~/.vegacapsule/testnet/wallet