Coder Social home page Coder Social logo

vidhanarya / kleros-v2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kleros/kleros-v2

0.0 0.0 0.0 135.36 MB

Kleros version 2

Home Page: https://kleros-v2.netlify.app

License: MIT License

Shell 0.87% JavaScript 0.34% Python 0.53% TypeScript 61.71% HTML 0.08% Dockerfile 0.03% Solidity 36.45%

kleros-v2's Introduction

Kleros

Kleros v2

Netlify Build Status GitPoap badge
OpenSSF Scorecard Security Rating Quality Gate Status Bugs Reliability Rating Maintainability Rating
Unit testing Conventional Commits Commitizen Friendly Styled with Prettier


Deployments

Content

Package Description
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.
bot-pinner Replication and pinning of the IPFS content produced by the court, such as the pieces of evidence submitted in a case.
contracts Smart contracts of the arbitration protocol.
evidence-display display interface that should be used to render the evidence for arbitrators, as described by ERC-1497: Evidence Standard.
dynamic-script allows fetching the dynamic content for the arbitration, as described by ERC-1497: Evidence Standard.
subgraph The indexing layer.
web The court frontend intended for the jurors and parties in a dispute.

Toolchain:

  • Solidity 0.8
  • Hardhat
  • Ethers
  • Waffle
  • Typescript
  • Node 16
  • Yarn 3 without PlugnPlay

Contributing

Prerequisites

  • Install NodeJS 16:
    • on Red Hat Linux: sudo dnf module install nodejs:16
    • on Ubuntu Linux: sudo snap install node --classic
    • on MacOS via brew: brew install node
  • Install Yarn v1.22: npm install -g yarn
    • Then upgrade Yarn to v3: yarn set version berry
  • Install Volta.sh: curl https://get.volta.sh | bash
  • Install Docker Desktop to run the local graph node.
  • Shell utilities: jq, yq
    • on Red Hat Linux: sudo dnf install jq yq
    • on Ubuntu Linux: sudo snap install jq yq
    • on MacOS via brew: brew install jq yq

Install the dependencies

$ yarn install

# Foundry libraries
$ git submodule update --init --recursive -j 4
$ npm i -g hardhat-shorthand

$ hardhat-completion install
✔ Which Shell do you use ? · bash
✔ We will install completion to ~/.bashrc, is it ok ? (y/N) · true

$ exec bash

Full Stack Local Deployment

Run 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.

Shortcut using tmux

If you have tmux installed, you can get started quickly with a single command.

$ yarn local-stack

terminal

Shell 1 - Local RPC with Contracts Deployed

$ yarn workspace @kleros/kleros-v2-contracts start-local
...
Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/

⏳ Wait until deployment is complete.

Shell 2 - Local Graph Node

$ yarn workspace @kleros/kleros-v2-subgraph start-local-indexer
...
graph-node-graph-node-1  | INFO Successfully connected to IPFS node at: http://ipfs:5001/
graph-node-graph-node-1  | INFO Pool successfully connected to Postgres, pool: main, shard: primary, component: Store
...
graph-node-graph-node-1  | INFO Connected to Ethereum, capabilities: archive, traces, network_version: 31337, provider: mainnet-rpc-0

⏳ Wait until the graph service is ready.

Shell 3 - Subgraph Rebuild and Local Deploy

⚠️ This step modifies subgraph.yaml and creates a backup file. See further down on how to restore it.

$ yarn workspace @kleros/kleros-v2-subgraph rebuild-deploy-local
...
✔ Upload subgraph to IPFS

Build completed: QmZVaZQ9qcXPia9YnFEKk7D1dEDHbfyDiJi1sqJ6E1NydB

Deployed to http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local/graphql

Subgraph endpoints:
Queries (HTTP):     http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local

Shell 4 - Frontend Pointing to the Local Subgraph

$ yarn workspace @kleros/kleros-v2-web start-local

Server running at http://localhost:1234
✨ Built in 2.35s

Redeploying

# Contracts
$ yarn workspace @kleros/kleros-v2-contracts deploy-local

# Subgraph
$ yarn workspace @kleros/kleros-v2-subgraph rebuild-deploy-local

Simulating Arbitration Activity

$ yarn workspace @kleros/kleros-v2-contracts simulate-local

Stopping

Just press Ctrl + c in each terminal.

Docker containers and data removal

yarn workspace @kleros/kleros-v2-subgraph stop-local-indexer

Restoring subgraph.yaml

From a backup file

Every versions were saved as subgraph.yaml.bak.<timestamp>.

Based on the ArbitrumGoerli deployment artifacts

yarn workspace @kleros/kleros-v2-subgraph update

Based on the last commit

git restore subgraph.yaml

kleros-v2's People

Contributors

alcercu avatar jaybuidl avatar dependabot[bot] avatar kemuru avatar nhestrompia avatar unknownunknown1 avatar shotaronowhere avatar gratestas avatar fnanni-0 avatar shalzz avatar hrishibhat avatar renovate[bot] avatar andreimvp avatar donosonaumczuk avatar anukul avatar step-security-bot avatar arun9650 avatar params10 avatar renovate-bot avatar mend-bolt-for-github[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.