- Prerequisites
- Understanding the directory structure
- Development Setup
- Local setup
- Other commands
- Contributing
Before you get started, please make sure you have the following setup -
- Node.js v16 (use nvm if already using a different Node version).
pnpm
npm i -g pnpm
- Install
protoc
- Python >=3.6
- Download and install the latest Python version.
- Run
npm config set python /path/to/executable/python
to configure.
- Install and set up node-gyp -
npm i -g node-gyp
to install.- For Windows, follow an additional step -
- Install Visual C++ 2017 Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio Community (using the "Desktop development with C++" workload).
- For more details, please refer to the node-gyp documentation.
- pip3 install -r requirements.txt
├── apps # Contains all the applications
│ └── browser # Browser application to test sdk
│ └── node # Nodejs application to test sdk
│ └── docs # Documentation for sdk
│
├── packages # Holds packages required for sdk
│ └── app-manager # Manager application containing all
│ └── core # Handles low level communication protocol necessary for device communication
│ └── hw-hid # Handles device connection with HID protocol
│ └── hw-serialport # Handles device connection with SerialPort protocol
│ └── hw-webusb # Handles device connection with WebUSB protocol
│ └── interfaces # Contains common interfaces between other packages
│ └── util-* # Common utilities shared between packages
│
├── submodules # Contains all submodules required for sdk
│ └── common # Common configs and protobufs shared between device and sdk
│
├── package.json
The repository contains submodules, which need to be downloaded as well. Clone the repository along with its submodules using -
git clone git@github.com:Cypherock/sdk.git --recurse-submodules
Once you have cloned the repository, follow these steps -
pnpm i # Install packages
pnpm build # build all modules
pnpm start:node
: Start demo app on nodejspnpm start:browser
: Start demo app on browserpnpm test
: Run all testspnpm lint
: Lint all filespnpm pretty
: Prettify all files
- Create a new file
.turbo/config.json
and add the following content -{ "teamid": "team_<TEAMID>", "apiurl": "<CACHE API URL>" }
- Set the
TURBO_TOKEN=yourToken
environment variable
Please consider making a contribution to the project. Contributions can include bug fixes, feature proposal, or optimizations to the current code.