Kleros v2
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. |
kleros-sdk | SDK which facilitates the creation of arbitrable applications, the interactions with the arbitrator, the rendering of the dispute and evidence information. |
subgraph | The indexing layer. |
web | The court frontend intended for the jurors and parties in a dispute. |
sudo dnf module install nodejs:16
sudo snap install node --classic
brew install node
npm install -g yarn
yarn set version berry
curl https://get.volta.sh | bash
sudo dnf install jq yq
sudo snap install jq yq
brew install jq yq
$ 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
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
.
If you have tmux installed, you can get started quickly with a single command.
$ yarn local-stack
$ 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.
$ 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.
:warning: 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
yarn workspace @kleros/kleros-v2-web generate
✔ Parse Configuration
✔ Generate outputs
✔ Validating plugins
✔ Resolving contracts
✔ Running plugins
✔ Writing to src/hooks/contracts/generated.ts
$ yarn workspace @kleros/kleros-v2-web start-local
Server running at http://localhost:1234
✨ Built in 2.35s
# Contracts
$ yarn workspace @kleros/kleros-v2-contracts deploy-local
# Subgraph
$ yarn workspace @kleros/kleros-v2-subgraph rebuild-deploy:local
$ yarn workspace @kleros/kleros-v2-contracts simulate-local
Just press Ctrl + c
in each terminal.
yarn workspace @kleros/kleros-v2-subgraph stop-local-indexer
Every versions were saved as subgraph.yaml.bak.<timestamp>
.
yarn workspace @kleros/kleros-v2-subgraph update
git restore subgraph.yaml