Skip to content

Commit

Permalink
Merge pull request #195 from celo-org/alecps/devGuide
Browse files Browse the repository at this point in the history
ODIS CONTRIBUTING.md / dev guide
  • Loading branch information
alecps authored Jan 8, 2024
2 parents 1f41cae + d333b12 commit 8535f22
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .changeset/lucky-birds-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
90 changes: 87 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Thank you for considering making a contribution to the Celo community!
Thank you for considering making a contribution to SocialConnect and the Celo community!
Everyone is encouraged to contribute, even the smallest fixes are welcome.

If you'd like to contribute to Celo, please fork, fix, [write a changeset](../RELEASE.md), commit, and send a pull request for the maintainers to review.
Expand All @@ -9,8 +9,92 @@ If you wish to submit more complex changes, please sync with a core developer fi
This will help ensure those changes are in line with the general philosophy of the project
and enable you to get some early feedback.

See the [contributing guide](https://docs.celo.org/community/contributing) for details on how to participate.
See the [community contribution guide](https://docs.celo.org/community/contributing) for details on how to participate.

## Directory Structure

<pre>
├── <a href="./docs">docs</a>: Documentation on how SocialConnect works and how to use it
├── <a href="./kubernetes-deployments">kubernetes-deployments</a>: YAML config files and instructions for ODIS deployment
├── <a href="./apps">apps</a>: Contains deployed componentes of Oblivious Decentralized Identifier Service (ODIS) for SocialConnect
│ ├── <a href="./apps/combiner">combiner</a>: Orchestrates distributed BLS threshold signing with the set of ODIS signers - requests and combines partial signatures
│ ├── <a href="./apps/monitor">monitor</a>: Monitoriing service that sends health checks to deployed ODIS instances. Also contains code for load testing
│ ├── <a href="./apps/signer">signer</a>: Generates unique partial signatures for blinded messages
├── <a href="./packages">packages</a>: Contains all published SocialConnect components
│ ├── <a href="./packages/common">common</a>: Contains common logic for ODIS, including API schemas
│ ├── <a href="./packages/encrypted-backup">encrypted-backup</a>: PEAR account recovery SDK, powered by ODIS
│ ├── <a href="./packages/identity">identity</a>: SDK for using SocialConnect
│ ├── <a href="./packages/odis-identifiers">odis-identifiers</a>: Contains identifier prefixes and hashing functions for ODIS
├── <a href="./scripts">scripts</a>: Misc. deployment and release scripts
</pre>

## Dev Setup

We use yarn berry. You may need to run `corepack enable`. This doesnt setup yarn itself but is a node.js feature for enabling package managers.
### Pre-requisites

* [Git](https://git-scm.com/downloads)
* [NodeJS](https://nodejs.org/en/download/)
* [Node Version Manager](https://github.com/nvm-sh/nvm)

### Setup

Clone the repository and open it:

```bash
git clone [email protected]:celo-org/social-connect.git
cd social-connect
```

#### Install the Correct Version of NodeJS

Install the correct node version with [nvm](https://github.com/nvm-sh/nvm)

```bash
nvm use
```

#### Install node modules and build with yarn

First, run

```bash
corepack enable
```

This will setup the required `yarn` version

To install dependencies, run

```bash
yarn
```

To build all components (in both `/apps` and `/packages`) run

```bash
yarn build
```

#### Running tests

Our testing suite uses unit, integration and e2e tests. Integration tests spin up and run against local ODIS instances with in-memory DBs, while e2e tests run against actual deployed ODIS instances in staging, alfajores or mainnet environments.

To run all unit and integration tests (in both `/apps` and `/packages`) run

```bash
yarn test
```


To run ODIS e2e tests, navigate to the desired ODIS component subdirectory (either the Combiner or Signer) and run `yarn test:e2e`. You can specify the environment to run against as in the following example (see the relevant `package.json` file for all available test commands).

```bash
cd apps/signer
yarn test:e2e:alfajores
```

For load tests, checkout [apps/monitor](../apps/monitor/README.md)

#### PRs and Releases

See [Release.md](../RELEASE.md) and [kubernetes-deployment](/kubernetes-deployment)
4 changes: 3 additions & 1 deletion apps/monitor/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## ODIS Monitor

A firebase schedule function that monitors ODIS by regularly querying the combiner.
A firebase schedule function that monitors ODIS by regularly querying the combiner.

Also contains ODIS load testing code. Run `yarn loadTest` from within this directory to run the load testing [script](./src/scripts/run-load-test.ts)
File renamed without changes.
File renamed without changes.

0 comments on commit 8535f22

Please sign in to comment.