{"id":13632312,"url":"https://github.com/kleros/kleros-v2","last_synced_at":"2025-04-13T00:46:36.908Z","repository":{"id":36961601,"uuid":"426443530","full_name":"kleros/kleros-v2","owner":"kleros","description":"Kleros arbitration protocol version 2","archived":false,"fork":false,"pushed_at":"2025-04-12T15:07:38.000Z","size":167295,"stargazers_count":64,"open_issues_count":123,"forks_count":47,"subscribers_count":7,"default_branch":"dev","last_synced_at":"2025-04-13T00:46:21.267Z","etag":null,"topics":["arbitrator","backend","blockchain","dispute-resolution","ethereum","frontend","kleros","kleros-v2","layer2","middleware","monorepo","odr","protocol","smart-contracts","solidity","typescript","under-construction"],"latest_commit_sha":null,"homepage":"https://v2.kleros.builders","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kleros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-10T01:28:43.000Z","updated_at":"2025-04-11T17:44:08.000Z","dependencies_parsed_at":"2023-12-24T20:18:44.768Z","dependency_job_id":"1b270c4f-86ca-4774-a589-08e8c335a821","html_url":"https://github.com/kleros/kleros-v2","commit_stats":{"total_commits":915,"total_committers":19,"mean_commits":48.1578947368421,"dds":0.6601092896174863,"last_synced_commit":"849fcca6b3697519bc71108137581bc934aec00c"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleros%2Fkleros-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleros%2Fkleros-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleros%2Fkleros-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleros%2Fkleros-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kleros","download_url":"https://codeload.github.com/kleros/kleros-v2/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650432,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arbitrator","backend","blockchain","dispute-resolution","ethereum","frontend","kleros","kleros-v2","layer2","middleware","monorepo","odr","protocol","smart-contracts","solidity","typescript","under-construction"],"created_at":"2024-08-01T22:02:59.596Z","updated_at":"2025-04-13T00:46:36.880Z","avatar_url":"https://github.com/kleros.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://kleros.io\"\u003e\n    \u003cimg alt=\"Kleros\" src=\"https://github.com/kleros/court/blob/master/public/icon-512.png?raw=true\" width=\"128\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb style=\"font-size: 32px;\"\u003eKleros v2\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://api.securityscorecards.dev/projects/github.com/kleros/kleros-v2\"\u003e\u003cimg src=\"https://api.securityscorecards.dev/projects/github.com/kleros/kleros-v2/badge\" alt=\"OpenSSF Scorecard\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/summary/new_code?id=kleros_kleros-v2\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=kleros_kleros-v2\u0026metric=security_rating\" alt=\"Security Rating\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/summary/new_code?id=kleros_kleros-v2\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=kleros_kleros-v2\u0026metric=alert_status\" alt=\"Quality Gate Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/summary/new_code?id=kleros_kleros-v2\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=kleros_kleros-v2\u0026metric=bugs\" alt=\"Bugs\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/summary/new_code?id=kleros_kleros-v2\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=kleros_kleros-v2\u0026metric=reliability_rating\" alt=\"Reliability Rating\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/summary/new_code?id=kleros_kleros-v2\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=kleros_kleros-v2\u0026metric=sqale_rating\" alt=\"Maintainability Rating\"\u003e\u003c/a\u003e\n  \u003c/br\u003e\n  \u003ca href=\"https://github.com/kleros/kleros-v2/actions/workflows/contracts-testing.yml\"\u003e\u003cimg src=\"https://github.com/kleros/kleros-v2/actions/workflows/contracts-testing.yml/badge.svg?branch=master\" alt=\"Unit testing\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://conventionalcommits.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg\" alt=\"Conventional Commits\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://commitizen.github.io/cz-cli/\"\u003e\u003cimg src=\"https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\" alt=\"Commitizen Friendly\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prettier/prettier\"\u003e\u003cimg src=\"https://img.shields.io/badge/styled_with-prettier-ff69b4.svg\" alt=\"Styled with Prettier\"\u003e\u003c/a\u003e\n  \u003c/br\u003e\n  \u003ca href=\"https://www.gitpoap.io/gh/kleros/kleros-v2\"\u003e\u003cimg src=\"https://public-api.gitpoap.io/v1/repo/kleros/kleros-v2/badge\" alt=\"GitPoap badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Deployments\n\n##### ⛓️ [Contracts addresses](contracts/README.md#deployments)\n\n##### 🗃️ [Subgraph endpoints](subgraph/README.md#deployments)\n\n##### ⚖️ [Web frontend](web/README.md#court-deployments)\n\n## Content\n\n| Package                       | Description                                                                                                                                                 |\n| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **[bots](/bots)**             | Automation of the on-chain upkeep of the smart contracts. Anyone willing to spend some gas may run these bots and contribute to the upkeep operations.      |\n| **[contracts](/contracts)**   | Smart contracts of the arbitration protocol.                                                                                                                |\n| **[kleros-app](/kleros-app)** | Library of React hooks and utilities shared by the Kleros frontend apps.                                                                                    |\n| **[kleros-sdk](/kleros-sdk)** | SDK which facilitates the creation of arbitrable applications, the interactions with the arbitrator, the rendering of the dispute and evidence information. |\n| **[subgraph](/subgraph)**     | The indexing layer.                                                                                                                                         |\n| **[web](/web)**               | The court frontend intended for the jurors and parties in a dispute.                                                                                        |\n\n## Contributing\n\n### Prerequisites\n\n- Install NodeJS 16:\n  - on Red Hat Linux: `sudo dnf module install nodejs:16`\n  - on Ubuntu Linux: `sudo snap install node --classic`\n  - on MacOS via [brew](https://brew.sh/): `brew install node`\n- Install Yarn v1.22: `npm install -g yarn`\n  - Then [upgrade](https://yarnpkg.com/getting-started/install#updating-to-the-latest-versions) Yarn to v3: `yarn set version berry`\n- Install Volta.sh: `curl https://get.volta.sh | bash`\n- Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) to run the local graph node.\n- Shell utilities: [jq](https://stedolan.github.io/jq/), [yq](https://mikefarah.gitbook.io/yq/)\n  - on Red Hat Linux: `sudo dnf install jq yq`\n  - on Ubuntu Linux: `sudo snap install jq yq`\n  - on MacOS via [brew](https://brew.sh/): `brew install jq yq`\n\n### Install the dependencies\n\n```bash\n$ yarn install\n\n# Foundry libraries\n$ git submodule update --init --recursive -j 4\n```\n\n### [Hardhat CLI auto-completion](https://hardhat.org/guides/shorthand.html) (optional)\n\n```bash\n$ npm i -g hardhat-shorthand\n\n$ hardhat-completion install\n✔ Which Shell do you use ? · bash\n✔ We will install completion to ~/.bashrc, is it ok ? (y/N) · true\n\n$ exec bash\n```\n\n### Full Stack Local Deployment\n\nRun the commands below from the top-level folder. Alternatively, it is possible to `cd` into the relevant package first and then call yarn without `workspace @kleros/xxxx`.\n\n#### Shortcut using tmux\n\nIf you have **[tmux](https://github.com/tmux/tmux/wiki)** installed, you can get started quickly with a single command.\n\n```bash\n$ yarn local-stack\n```\n\n![terminal](/docs/local-stack-2.png)\n\n#### Shell 1 - Local RPC with Contracts Deployed\n\n```bash\n$ yarn workspace @kleros/kleros-v2-contracts start-local\n...\nStarted HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/\n\n```\n\n⏳ Wait until deployment is complete.\n\n#### Shell 2 - Local Graph Node\n\n```bash\n$ yarn workspace @kleros/kleros-v2-subgraph start-local-indexer\n...\ngraph-node-graph-node-1  | INFO Successfully connected to IPFS node at: http://ipfs:5001/\ngraph-node-graph-node-1  | INFO Pool successfully connected to Postgres, pool: main, shard: primary, component: Store\n...\ngraph-node-graph-node-1  | INFO Connected to Ethereum, capabilities: archive, traces, network_version: 31337, provider: mainnet-rpc-0\n```\n\n⏳ Wait until the graph service is ready.\n\n#### Shell 3 - Subgraph Rebuild and Local Deploy\n\n:warning: This step modifies `subgraph.yaml` and creates a backup file. See further down on how to restore it.\n\n```bash\n$ yarn workspace @kleros/kleros-v2-subgraph rebuild-deploy:local\n...\n✔ Upload subgraph to IPFS\n\nBuild completed: QmZVaZQ9qcXPia9YnFEKk7D1dEDHbfyDiJi1sqJ6E1NydB\n\nDeployed to http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local/graphql\n\nSubgraph endpoints:\nQueries (HTTP):     http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local\n```\n\n#### Shell 4 - Frontend Pointing to the Local Subgraph\n\n```bash\nyarn workspace @kleros/kleros-v2-web generate\n✔ Parse Configuration\n✔ Generate outputs\n✔ Validating plugins\n✔ Resolving contracts\n✔ Running plugins\n✔ Writing to src/hooks/contracts/generated.ts\n\n$ yarn workspace @kleros/kleros-v2-web start-local\nServer running at http://localhost:1234\n✨ Built in 2.35s\n```\n\n### Redeploying\n\n```bash\n# Contracts\n$ yarn workspace @kleros/kleros-v2-contracts deploy-local\n\n# Subgraph\n$ yarn workspace @kleros/kleros-v2-subgraph rebuild-deploy:local\n\n```\n\n### Simulating Arbitration Activity\n\n```bash\n$ yarn workspace @kleros/kleros-v2-contracts simulate-local\n\n```\n\n### Stopping\n\nJust press `Ctrl + c` in each terminal.\n\n#### Docker containers and data removal\n\n`yarn workspace @kleros/kleros-v2-subgraph stop-local-indexer`\n\n#### Restoring subgraph.yaml\n\n##### From a backup file\n\nEvery versions were saved as `subgraph.yaml.bak.\u003ctimestamp\u003e`.\n\n##### Based on the ArbitrumGoerli deployment artifacts\n\n`yarn workspace @kleros/kleros-v2-subgraph update`\n\n##### Based on the last commit\n\n`git restore subgraph.yaml`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkleros%2Fkleros-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkleros%2Fkleros-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkleros%2Fkleros-v2/lists"}