@ledgerhq/coin-tester
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

Coin-tester

What is the coin config

Find more information here

Prerequisites

  • Ledger Live development setup
git clone git@github.com:LedgerHQ/ledger-live.git
cd ledger-live
pnpm install
pnpm build:libs

Build the speculos image

You only have to build speculos locally if you are on a Mac M1. Otherwise you can uncomment the image provided in the docker-compose.yml

  1. Clone speculos: git clone git@github.com:LedgerHQ/speculos.git

  2. Patch Dockerfile:

# before
FROM ghcr.io/ledgerhq/speculos-builder:latest AS builder
# after
FROM speculos-builder:latest AS builder
  1. Build image
cd speculos
docker build -f build.Dockerfile -t speculos-builder:latest .
docker build -f Dockerfile -t speculos:latest .

Environment variables

  • Generate a Github token classic and give it full "repo" and "project" rights. Make sure to authorize Ledger SSO.

  • Go in the coin-module you want to test and create a .env in the folder where your test resides. For exemple for coin-evm create the file should be located in: src/__test__/coin-tester/.env.

Copy .env.example.

cp .env.example .env

A .env should have at the very least the following attributes:

SEED=chronic find success crew board merit elder life achieve scout gravity soul brief pen job
GH_TOKEN=
SPECULOS_API_PORT=4040
SPECULOS_IMAGE=speculos

If you want you can generate a new seed using this tool

Coin Module Specific setup

Polkadot

To coin Polkadot Coin tester we will need to build the local test node Docker image.

cd libs/coin-modules/coin-polkadot/src/test/coin-tester
make build
pnpm coin:<coin-module-name> coin-tester

# e.g
# pnpm coin:evm coin-tester
# pnpm coin:polkadot coin-tester

Troubleshooting

EVM Coin tester

The "RPC" variable is not set. Defaulting to a blank string.

This error can safely be ignored. The RPC is passed as a variable env at runtime. Check here and here

Package Sidebar

Install

npm i @ledgerhq/coin-tester

Weekly Downloads

159

Version

0.2.3

License

Apache-2.0

Unpacked Size

84.6 kB

Total Files

37

Last publish

Collaborators

  • ledger-releaser
  • thomas.coudray
  • ldg-github-ci
  • aboissiere
  • vbouzon
  • gbrahm-ledger
  • sergii-shkolin
  • phenry-ledger