_____ _____ _____
/\ \ /\ \ /\ \
/::\____\ /::\____\ /::\ \
/:::/ / /:::/ / /::::\ \
/:::/ / /:::/ _/___ /::::::\ \
/:::/ / /:::/ /\ \ /:::/\:::\ \
/:::/____/ /:::/ /::\____\ /:::/__\:::\ \
/::::\ \ /:::/ /:::/ / /::::\ \:::\ \
/::::::\ \ _____ /:::/ /:::/ _/___ /::::::\ \:::\ \
/:::/\:::\ \ /\ \ /:::/___/:::/ /\ \ /:::/\:::\ \:::\____\
/:::/ \:::\ /::\____\|:::| /:::/ /::\____\/:::/ \:::\ \:::| |
\::/ \:::\ /:::/ /|:::|__/:::/ /:::/ /\::/ \:::\ /:::|____|
\/____/ \:::\/:::/ / \:::\/:::/ /:::/ / \/_____/\:::\/:::/ /
\::::::/ / \::::::/ /:::/ / \::::::/ /
\::::/ / \::::/___/:::/ / \::::/ /
/:::/ / \:::\__/:::/ / \::/____/
/:::/ / \::::::::/ / ~~
/:::/ / \::::::/ /
/:::/ / \::::/ /
\::/ / \::/____/
\/____/ ~~
The purpose of this repository is to provide an easy to setup development & test environment for hardware wallets & their integration with particl-core. All builds are executed inside docker containers, the binaries created by these docker files are transferable and can be ran on other machines. A docker-compose is used to setup the test environment.
This playground is only available for linux.
Requirements:
- Git
- Docker
- Docker Compose
git clone https://github.com/particl/hardware-wallet-playground.git
cd hardware-wallet-playground/
make init
make test
A comprehensive list of all commands that are available.
Clones all the required repositories into the subdirectories & writes it to the configuration file.
make init
Builds everything (default target = all):
make build
Builds a specific target:
make target=core build
Executes build command on core (+ specified target) first. Boots up the containers (emulators & particl-core). Once an emulator container is up and running, it will add that emulator to particl-core and run the respective test suite (ledger / trezor). Tests against the different emulators are ran sequentially. Will shutdown the existing docker containers and clean up everything.
Tests everything (default target = all):
make test
Test a specific target:
make target=ledger test
Runs make clean in every source folder.
Cleans everything (default target = all):
make clean
Clean a specific target:
make target=ledger clean
Get a shell into a the container of node
.
make node=stake shell
Only available as long as the test environment is up.
Runs command
againt a particular node
through particl-cli.
Retrieve the network information from node 0:
make node=stake command="getnetworkinfo" rpc
Only available as long as the test environment is up.
Opens instance of vncviewer
to the device for manual inspection.
make model=nanos vnc
Brand | Model | Supported |
---|---|---|
Ledger | NanoS | WIP |
Ledger | NanoX | WIP |
Trezor | Trezor One | WIP |
Trezor | Trezor T | WIP |
src/
contains all the source repositories cloned through git. You can directly work & edit in these.bin/
contains the particl-core binary & emulator firmware.scripts/
contains all the scripts that you can execute through themake
commands.docker/
contains all docker files to build & run each repo in src/ & a docker-compose file for the test environment.configs/
contains the datadirectory for particl-core (which is binded to the container in the testing orchestration)test/
contains all the tests & test related utilities.
All processes (compiling source codes & executing tests) runs inside docker containers that are orchestrated using docker-compose. This simplifies the bootstrapping process for new developers and provides an additional level of security to protect your host system.
build-legder-app-particl
:- builds the ledger app firmware (when executing the docker container)
- stores the binary under
bin/
asparticl.elf
build-particl-core
:- builds particl-core daemon and cli (when executing the docker container)
- stores the binaries under
bin/
asparticld
&particl-cli
.
run-particl-core
:- binaries & data directory must be mounted inside as (
particld
+particl-cli
) &/data
respectively. - runs particl-core daemon (particld),
- binaries & data directory must be mounted inside as (
run-tests
:- Setup: sets up the wallet & connects the right particl-core instances with their respective hardware emulator.
- Testing: runs test suite against the particl-core daemons.
The orchestration of the test environment is provided by docker/test-compose.yaml
.
The compose file will spin up a network of multiple containers:
- 1 Ledger NanoS emulator
ledger-speculos-nanos
:
- 1 Trezor One emulator
- 3 particl-core daemons:
core-stake-node
: this node is responsible for generating blocks on the regnet.core-ledger-nanos-node
: this node is connected with the Ledger NanoS emulator & can be tested against.core-trezor-one-node
: this node is connected with the Trezor One emulator & can be tested against.