Skip to content

Commit f007411

Browse files
committed
feat: updated and reployed the fastbridge subgraph, added a local graph node config
1 parent 0b7c751 commit f007411

File tree

14 files changed

+534
-54
lines changed

14 files changed

+534
-54
lines changed

contracts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
2020
- [PNK](https://goerli-rollup-explorer.arbitrum.io/token/0x4DEeeFD054434bf6721eF39Aa18EfB3fd0D12610/token-transfers)
2121
- [DisputeKitClassic](https://goerli-rollup-explorer.arbitrum.io/address/0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE)
2222
- [DisputeResolver](https://goerli-rollup-explorer.arbitrum.io/address/0x04Fb43F2Ce076867b5ba38750Ecb2cc6BDe78D61)
23-
- [FastBridgeSenderToEthereum](https://goerli-rollup-explorer.arbitrum.io/address/0xcFc0b84419583ff7b32fD5139B789cE858517d4C)
23+
- [FastBridgeSender](https://goerli-rollup-explorer.arbitrum.io/address/0xcFc0b84419583ff7b32fD5139B789cE858517d4C)
2424
- [HomeGatewayToEthereum](https://goerli-rollup-explorer.arbitrum.io/address/0xc7e3BF90299f6BD9FA7c3703837A9CAbB5743636)
2525
- [IncrementalNG](https://goerli-rollup-explorer.arbitrum.io/address/0x99c1f883f0f5de1737099F1BCB268d1f8D450f8b)
2626
- [KlerosCore](https://goerli-rollup-explorer.arbitrum.io/address/0x87142b7E9C7D026776499120D902AF8896C07894)
@@ -38,7 +38,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
3838
- [PNK](https://testnet.arbiscan.io/token/0x364530164a2338cdba211f72c1438eb811b5c639)
3939
- [DisputeKitClassic](https://testnet.arbiscan.io/address/0xA2c538AA05BBCc44c213441f6f3777223D2BF9e5)
4040
- [DisputeResolver](https://testnet.arbiscan.io/address/0x67e8191F61466c57A17542A52F9f39f336A242fD)
41-
- [FastBridgeSenderToEthereum](https://testnet.arbiscan.io/address/0xf8A4a85e7153374A1b9BDA763a84252eC286843b)
41+
- [FastBridgeSender](https://testnet.arbiscan.io/address/0xf8A4a85e7153374A1b9BDA763a84252eC286843b)
4242
- [HomeGatewayToEthereum](https://testnet.arbiscan.io/address/0x4e894c2B60214beC53B60D09F39544518296C07B)
4343
- [IncrementalNG](https://testnet.arbiscan.io/address/0x078dAd05373d19d7fd6829735b765F12242a4300)
4444
- [KlerosCore](https://testnet.arbiscan.io/address/0x815d709EFCF5E69e2e9E2F8d3815d762496a2f0F)

contracts/deploy/02-home-chain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment)
2121
const fastBridgeReceiver = await deployments.get("FastBridgeReceiverOnEthereum");
2222
const arbSysMock = await deploy("ArbSysMock", { from: deployer, log: true });
2323

24-
const fastBridgeSender = await deploy("FastBridgeSenderToEthereumMock", {
24+
const fastBridgeSender = await deploy("FastBridgeSenderMock", {
2525
from: deployer,
2626
contract: "FastBridgeSenderMock",
2727
args: [epochPeriod, fastBridgeReceiver.address, arbSysMock.address],
@@ -63,7 +63,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment)
6363
const liveDeployer = async () => {
6464
const fastBridgeReceiver = await hre.companionNetworks.foreign.deployments.get("FastBridgeReceiverOnEthereum");
6565

66-
const fastBridgeSender = await deploy("FastBridgeSenderToEthereum", {
66+
const fastBridgeSender = await deploy("FastBridgeSender", {
6767
from: deployer,
6868
contract: "FastBridgeSender",
6969
args: [epochPeriod, fastBridgeReceiver.address],

contracts/test/integration/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
FastBridgeReceiverOnEthereum,
99
ForeignGatewayOnEthereum,
1010
ArbitrableExample,
11-
FastBridgeSenderToEthereumMock,
11+
FastBridgeSenderMock,
1212
HomeGatewayToEthereum,
1313
DisputeKitClassic,
1414
InboxMock,
@@ -62,7 +62,7 @@ describe("Integration tests", async () => {
6262
fastBridgeReceiver = (await ethers.getContract("FastBridgeReceiverOnEthereum")) as FastBridgeReceiverOnEthereum;
6363
foreignGateway = (await ethers.getContract("ForeignGatewayOnEthereum")) as ForeignGatewayOnEthereum;
6464
arbitrable = (await ethers.getContract("ArbitrableExample")) as ArbitrableExample;
65-
fastBridgeSender = (await ethers.getContract("FastBridgeSenderToEthereumMock")) as FastBridgeSenderToEthereumMock;
65+
fastBridgeSender = (await ethers.getContract("FastBridgeSenderMock")) as FastBridgeSenderMock;
6666
homeGateway = (await ethers.getContract("HomeGatewayToEthereum")) as HomeGatewayToEthereum;
6767
inbox = (await ethers.getContract("InboxMock")) as InboxMock;
6868
});

subgraph-fastbridge/README.md

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,108 @@
11
# @kleros/kleros-v2-subgraph-fastbridge
22

3-
🚧 ⚖️ 🚧
3+
## Deployments
4+
5+
- [kleros/fastbridge-arbitrum-rinkeby](https://thegraph.com/hosted-service/subgraph/kleros/fastbridge-arbitrum-rinkeby)
6+
7+
## Build
8+
9+
```bash
10+
$ yarn
11+
12+
$ yarn codegen
13+
14+
$ yarn build
15+
```
16+
17+
## Deployment to The Graph (hosted service)
18+
19+
### Authentication
20+
21+
Get an API key from the thegraph.com, then authenticate.
22+
23+
```bash
24+
$ yarn run graph auth --product hosted-service
25+
```
26+
27+
### Deployment
28+
29+
```bash
30+
yarn deploy
31+
```
32+
33+
## Deployment to a local Graph node
34+
35+
_Credits to the [scaffold-eth service package](https://github.com/scaffold-eth/scaffold-eth/tree/b03d07f15882db626300ffa04f222736b2a22f81/packages/services/graph-node)_
36+
37+
Preconfigured Docker image for running a Graph Node.
38+
39+
## Usage
40+
41+
**Prerequisite**: docker and docker-compose.
42+
43+
```bash
44+
$ docker-compose up -d
45+
Starting graph-node_postgres_1 ... done
46+
Starting graph-node_ipfs_1 ... done
47+
Starting graph-node_graph-node_1 ... done
48+
49+
$ docker-compose logs -f
50+
...
51+
```
52+
53+
This will start docker containers for the following services:
54+
55+
- IPFS,
56+
- Postgres
57+
- **Graph Node** connecting to the Arbitrum Rinkeby official RPC
58+
59+
This also creates persistent data directories for IPFS and Postgres in `./data/ipfs` and `./data/postgres`.
60+
61+
Once this is up and running, you can use [`graph-cli`](https://github.com/graphprotocol/graph-cli) to create and deploy your subgraph to the running Graph Node.
62+
63+
```bash
64+
# First time only.
65+
$ yarn create-local
66+
Created subgraph: fastbridge
67+
68+
$ yarn deploy-local --version-label v0.0.1
69+
✔ Apply migrations
70+
✔ Load subgraph from subgraph.yaml
71+
Compile data source: FastBridgeSender => build/FastBridgeSender/FastBridgeSender.wasm
72+
✔ Compile subgraph
73+
Copy schema file build/schema.graphql
74+
Write subgraph file build/FastBridgeSender/abis/FastBridgeSender.json
75+
Write subgraph manifest build/subgraph.yaml
76+
✔ Write compiled subgraph to build/
77+
Add file to IPFS build/schema.graphql
78+
.. Qmb3Uahj4qKh5u3V4KuraXJqsrUVwPtvva1KQQSb5tLov9
79+
Add file to IPFS build/FastBridgeSender/abis/FastBridgeSender.json
80+
.. QmQas2SuTQH6zybTVMGBym76kyBoTp7MwkogcmtHAeMoRj
81+
Add file to IPFS build/FastBridgeSender/FastBridgeSender.wasm
82+
.. QmSLfCYp19WW5JEiaKdmcGFgBCJ5DA723dEkM6QvXE2eCa
83+
✔ Upload subgraph to IPFS
84+
85+
Build completed: QmWjRVXec6auQdnpvYJ7F8vW7PzkJHYJhFtorWZAhtP9A3
86+
87+
Deployed to http://localhost:8000/subgraphs/name/fastbridge/graphql
88+
89+
Subgraph endpoints:
90+
Queries (HTTP): http://localhost:8000/subgraphs/name/fastbridge
91+
```
92+
93+
## Access
94+
95+
### Graph Node
96+
97+
- GraphiQL: `http://localhost:8000/`
98+
- HTTP: `http://localhost:8000/subgraphs/name/<subgraph-name>`
99+
- WebSockets: `ws://localhost:8001/subgraphs/name/<subgraph-name>`
100+
- Admin: `http://localhost:8020/`
101+
102+
### IPFS
103+
104+
- `127.0.0.1:5001` or `/ip4/127.0.0.1/tcp/5001`
105+
106+
### Postgres
107+
108+
- `postgresql://graph-node:let-me-in@localhost:5432/graph-node`

0 commit comments

Comments
 (0)