Skip to content

Latest commit

 

History

History
133 lines (96 loc) · 6.44 KB

README.md

File metadata and controls

133 lines (96 loc) · 6.44 KB

Hardware wallet protobuffer

Build Status

Protocol Buffer schemas for Skycoin hardware wallet communication and scripts for supporting multiple programming languages.

Table of Contents

Installation

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

Using the scripts

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:

The following projects also use it either directly or indirectly:

Make rules

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

Environment variables

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 to foo.bar/my/project/path/where/this/project/live/as/submodule.

Development setup

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.

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.

Running tests

By design, this repository does not include a test suite. Nevertheless :

Merging Pull Requests

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.

Releases

This repository is not meant to have release packages.

Update the version

See skycoin/hardware-wallet README.