Protocol Buffer schemas for Skycoin hardware wallet communication and scripts for supporting multiple programming languages.
All tools needed , including protoc
, language-specific generators and dependencies, will be installed after executing the following commands.
git clone https://github.com/skycoin/hardware-wallet-protob
cd hardware-wallet-protob
make install
It is highly recommended to invoke code generation scripts by executing the suitable make targets. This repository is meant to be included as a submodule in (at least) the following projects:
- Skycoin hardware wallet : Implements bootloader and firmware for the hardware wallet
- Skycoin hardware wallet library for go language :
- Skycoin hardware wallet library for Javascript :
The following projects also use it either directly or indirectly:
The following make targets are defined
$ make help
all Generate protobuf classes for all languages
install Install protocol buffer tools
clean Delete temporary and output files
install-deps-go Install tools to generate protobuf classes for go lang
build-go Generate protobuf classes for go lang
install-deps-js Install tools to generate protobuf classes for javascript
build-js Generate protobuf classes for javascript
install-deps-nanopb Install tools to generate protobuf classes for C and Python with nanopb
build-c Generate protobuf classes for C with nanopb
build-py Generate protobuf classes for Python with nanopb
Code generation commands (i.e. build-*
targets) can generate source code at any location should the following variables be properly set:
-
OUT_C
env var allows to output protobuf C code onto a custom directory -
OUT_GO
env var allows to output protobuf go code onto a custom directory -
OUT_JS
env var allows to output protobuf js code onto a custom directory -
OUT_PY
env var allows to output protobuf Python code onto a custom directory -
When using this projets as submodule of a go project foo.bar/my/project consider using the env var
GO_PREFIX_IMPORT_PATH
tofoo.bar/my/project/path/where/this/project/live/as/submodule
.
To start using these scripts see installation instructions. In order to import these specifications and scripts as part of another project follow the following steps:
- Include this repository as submodule e.g.
git submodule add https://github.com/skycoin/hardware-wallet-protob protob
- In your
Makefile
(or equivalent)- Define a variable for the target corresponding to the programming language that needs to be generated e.g.
PROTOB_CMD=build-py
to generate Python code - Define a variable for the path to the folder containing protocol buffer classes e.g.
PROTOB_DIR=protob/py
- Include a step that executes the target e.g.
make -C protob $(PROTOB_CMD) OUT_PY=$(PROTOB_DIR)
, read about environment variables for further details.
- Define a variable for the target corresponding to the programming language that needs to be generated e.g.
The project has two branches: master
and develop
.
develop
is the default branch and will always have the latest development code.master
will always be equal to the current stable release on the website, and should correspond with the latest release tag.
Versioning scheme will match the one of the hardware wallet firmware contract. Release tags will have exactly the same name as skycoin/hardware-wallet's using it to build firmware deliverables.
By design, this repository does not include a test suite. Nevertheless :
- continuous integration of the generation process in skycoin/hardware-wallet-protob @ Travis
- external projects do have a test suite that relies upon clases generated by these specifications
After changes are merged into this hardware-wallet-protob
repository the corresponding changes should be updated into the following repositories:
-
Hardware Wallet: Hardware Wallet has a submodule which depends on this repository. To update the submodule execute the following commands
$ cd $(GOPATH)/src/github.com/skycoin/hardware-wallet $ git submodule foreach git pull origin master
-
Hardware Wallet Go: Hardware Wallet Go has a dep dependency on this repository. To update it take the commit hash from master of hardware wallet protob and update that in respective constraint in
Gopkg.toml
. Then execute:$ dep ensure -update -v
-
Hardware Wallet Daemon: Hardware Wallet Daemon has a dep dependency on this repository. To update it take the commit hash from master of hardware wallet protob and update that in respective constraint in
Gopkg.toml
. Then execute:$ dep ensure -update -v
After updating the submodule or depdency PR the changes in the respective respositories.
This repository is not meant to have release packages.