diff --git a/.changeset/lucky-birds-end.md b/.changeset/lucky-birds-end.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/lucky-birds-end.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0c190172a..7329bd613 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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. @@ -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 + +
+├── docs: Documentation on how SocialConnect works and how to use it
+├── kubernetes-deployments: YAML config files and instructions for ODIS deployment
+├── apps: Contains deployed componentes of Oblivious Decentralized Identifier Service (ODIS) for SocialConnect
+│   ├── combiner: Orchestrates distributed BLS threshold signing with the set of ODIS signers - requests and combines partial signatures
+│   ├── monitor: Monitoriing service that sends health checks to deployed ODIS instances. Also contains code for load testing
+│   ├── signer: Generates unique partial signatures for blinded messages
+├── packages: Contains all published SocialConnect components
+│   ├── common: Contains common logic for ODIS, including API schemas
+│   ├── encrypted-backup: PEAR account recovery SDK, powered by ODIS
+│   ├── identity: SDK for using SocialConnect
+│   ├── odis-identifiers: Contains identifier prefixes and hashing functions for ODIS
+├── scripts: Misc. deployment and release scripts
+
## 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 git@github.com: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) diff --git a/apps/monitor/README.md b/apps/monitor/README.md index c538bb9ce..b32ba95b8 100644 --- a/apps/monitor/README.md +++ b/apps/monitor/README.md @@ -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) diff --git a/docs/kubernetes-deployment/combiner/README.md b/kubernetes-deployment/combiner/README.md similarity index 100% rename from docs/kubernetes-deployment/combiner/README.md rename to kubernetes-deployment/combiner/README.md diff --git a/docs/kubernetes-deployment/combiner/values/values-alfajores.yaml b/kubernetes-deployment/combiner/values/values-alfajores.yaml similarity index 100% rename from docs/kubernetes-deployment/combiner/values/values-alfajores.yaml rename to kubernetes-deployment/combiner/values/values-alfajores.yaml diff --git a/docs/kubernetes-deployment/combiner/values/values-mainnet.yaml b/kubernetes-deployment/combiner/values/values-mainnet.yaml similarity index 100% rename from docs/kubernetes-deployment/combiner/values/values-mainnet.yaml rename to kubernetes-deployment/combiner/values/values-mainnet.yaml diff --git a/docs/kubernetes-deployment/combiner/values/values-staging.yaml b/kubernetes-deployment/combiner/values/values-staging.yaml similarity index 100% rename from docs/kubernetes-deployment/combiner/values/values-staging.yaml rename to kubernetes-deployment/combiner/values/values-staging.yaml diff --git a/docs/kubernetes-deployment/signer/README.md b/kubernetes-deployment/signer/README.md similarity index 100% rename from docs/kubernetes-deployment/signer/README.md rename to kubernetes-deployment/signer/README.md diff --git a/docs/kubernetes-deployment/signer/values/alfajores/values-signer0-alfajores.yaml b/kubernetes-deployment/signer/values/alfajores/values-signer0-alfajores.yaml similarity index 100% rename from docs/kubernetes-deployment/signer/values/alfajores/values-signer0-alfajores.yaml rename to kubernetes-deployment/signer/values/alfajores/values-signer0-alfajores.yaml diff --git a/docs/kubernetes-deployment/signer/values/alfajores/values-signer1-alfajores.yaml b/kubernetes-deployment/signer/values/alfajores/values-signer1-alfajores.yaml similarity index 100% rename from docs/kubernetes-deployment/signer/values/alfajores/values-signer1-alfajores.yaml rename to kubernetes-deployment/signer/values/alfajores/values-signer1-alfajores.yaml diff --git a/docs/kubernetes-deployment/signer/values/alfajores/values-signer2-alfajores.yaml b/kubernetes-deployment/signer/values/alfajores/values-signer2-alfajores.yaml similarity index 100% rename from docs/kubernetes-deployment/signer/values/alfajores/values-signer2-alfajores.yaml rename to kubernetes-deployment/signer/values/alfajores/values-signer2-alfajores.yaml diff --git a/docs/kubernetes-deployment/signer/values/mainnet/values-signer0-mainnet.yaml b/kubernetes-deployment/signer/values/mainnet/values-signer0-mainnet.yaml similarity index 100% rename from docs/kubernetes-deployment/signer/values/mainnet/values-signer0-mainnet.yaml rename to kubernetes-deployment/signer/values/mainnet/values-signer0-mainnet.yaml diff --git a/docs/kubernetes-deployment/signer/values/mainnet/values-signer1-mainnet.yaml b/kubernetes-deployment/signer/values/mainnet/values-signer1-mainnet.yaml similarity index 100% rename from docs/kubernetes-deployment/signer/values/mainnet/values-signer1-mainnet.yaml rename to kubernetes-deployment/signer/values/mainnet/values-signer1-mainnet.yaml diff --git a/docs/kubernetes-deployment/signer/values/staging/values-signer0-staging.yaml b/kubernetes-deployment/signer/values/staging/values-signer0-staging.yaml similarity index 100% rename from docs/kubernetes-deployment/signer/values/staging/values-signer0-staging.yaml rename to kubernetes-deployment/signer/values/staging/values-signer0-staging.yaml diff --git a/docs/kubernetes-deployment/signer/values/staging/values-signer1-staging.yaml b/kubernetes-deployment/signer/values/staging/values-signer1-staging.yaml similarity index 100% rename from docs/kubernetes-deployment/signer/values/staging/values-signer1-staging.yaml rename to kubernetes-deployment/signer/values/staging/values-signer1-staging.yaml diff --git a/docs/kubernetes-deployment/signer/values/staging/values-signer2-staging.yaml b/kubernetes-deployment/signer/values/staging/values-signer2-staging.yaml similarity index 100% rename from docs/kubernetes-deployment/signer/values/staging/values-signer2-staging.yaml rename to kubernetes-deployment/signer/values/staging/values-signer2-staging.yaml