Skip to content

BitBoxSwiss/bitbox02-api-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitBox02 Go library

The API of the api packages are currenly unstable. Expect frequent breaking changes until we start tagging versions.

Comand to update the BitBox02 protobuf message files

Clone the BitBox02 firmware repo:

Make sure you have protoc and protoc-gen-go installed:

git clone https://github.com/BitBoxSwiss/bitbox02-firmware.git

rm -rf api/firmware/messages/{*.pb.go,*.proto}
cp /path/to/bitbox02-firmware/messages/*.proto api/firmware/messages/
rm api/firmware/messages/backup.proto
./api/firmware/messages/generate.sh

Simulator tests

The TestSimulator* tests run integration against BitBox02 simulators. They are automatically downloaded based on api/firmware/testdata/simulators.json, and each one is tested with.

To run them, use:

go test -v -run TestSimulator ./...

If you want to test against a custom simulator build (e.g. when developing new firmware features), you can run:

SIMULATOR=/path/to/simulator go test -v -run TestSimulator ./...

In this case, only the given simulator will be used, and the ones defined in simulators.json will be ignored.