You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note: If you are using react, you can take the hook we built [here](https://github.com/kleros/light-gtcr-example/blob/master/src/hooks/tcr-view.js) or use it as an example.
28
-
29
-
Copy the contract's ABI from [here](../../.gitbook/assets/light-gtcr-view-abi.json).
30
-
31
-
Using `ethers`, instantiate the contract.
27
+
> Note: If you are using react, you can take the hook we built [here](https://github.com/kleros/gtcr/blob/5e313ced24f5e3fc3a54f812e07fb1f86a6b2621/src/hooks/tcr-view.js) or use it as an example.
32
28
33
29
### Item Submission.
34
30
35
31
With light Curate, item submission consists of first uploading the item to IPFS and then submitting a transaction with the required deposit.
32
+
33
+
Since we use `@graphprotocol/graph-ts` we must submit items to its ipfs endpoint until they allow custom endpoints. In addition, we also upload to kleros ipfs node.
34
+
35
+
> In addition to Kleros' and The Graph's, we strongly advise pin the data to ipfs nodes you control as well. Update the provided below for this.
36
+
37
+
Full example [here](https://github.com/kleros/gtcr/blob/5e313ced24f5e3fc3a54f812e07fb1f86a6b2621/src/utils/ipfs-publish.js)
> We break down this section into two as list views and details view have different requirements.
257
+
258
+
Fetchin items is best done via the subgraph we provide. If you deployed an list using the factory, it already has a subgraph deployed and available (here)[https://thegraph.com/explorer/subgraph/kleros/light-curate-kovan].
259
+
260
+
#### List
261
+
262
+
Whenever we want to fetch items, or a specific item, we must pass the TCR address to the subgraph.
263
+
264
+
See (this react example)[https://github.com/kleros/gtcr/blob/5e313ced24f5e3fc3a54f812e07fb1f86a6b2621/src/pages/items/index.js] for more details.
265
+
266
+
A standard query for the first page of a given list, ordered by the most recent requests, looks like this.
This is the easiest part of the application. All items are referenced by their ID which is the keccak256 hash of the IPFS URI.
365
+
366
+
With it you can:
367
+
368
+
- Execute requests: This is for when a request passed the challenge period without any challenges.
369
+
- Challenge requests (registration or removal) via the contract's `challengeRequest` function
370
+
- Submit evidence: `submitEvidence` by passing the evidence json file following (ERC-1497)[https://kleros.gitbook.io/docs/developer/erc-1497-evidence-standard] standard.
0 commit comments