@@ -4,12 +4,6 @@ These are convenience scripts for interacting with the contracts.
4
4
5
5
The scripts expect the following:
6
6
7
- - ` ts-node ` to be installed globally on your system. This can be achieved with:
8
-
9
- ``` sh
10
- npm install -g typescript ts-node
11
- ```
12
-
13
7
- A ` .privkey.txt ` file at the root of this repository with the mnemonics for
14
8
your Ethereum account.
15
9
@@ -19,76 +13,110 @@ The scripts expect the following:
19
13
following at the root of the repository:
20
14
21
15
``` sh
22
- yarn contracts && yarn typechain
16
+ yarn build && yarn typechain
23
17
```
24
18
25
- ## Set the Graph subgraph ID and bootstrap indexers
19
+ All scripts that are working are below. Run the script without arguments for more usage info,
20
+ as the CLI will print the information
26
21
22
+
23
+ ## GNS
24
+ ** Publishing a subgraph**
27
25
``` sh
28
- ./set-graph-subgraph-id.ts \
29
- --subgraph-id < ipfs-hash> \
30
- --indexers < addr1> [,< addr2> ,...]
26
+ ts-node ./gns.ts
27
+ --func publish
28
+ --ipfs https://api.thegraph.com/ipfs/
29
+ --subgraphName davesSubgraph
30
+ --subgraphID QmdiX6GsbFaz7HDzNxmWCh1oi3bmy19C4te8YSkHbvLbQQ
31
+ --metadataPath ./data/metadata.json
31
32
```
32
-
33
- Run the script without arguments for more usage info.
34
-
35
- ## Set bootstrap index node URLs
36
-
33
+ ** Unpublishing a subgraph**
37
34
``` sh
38
- ./set-bootstrap-indexer-url .ts \
39
- --indexer < ethereum-address > \
40
- --url < index-node >
35
+ ts-node ./gns .ts
36
+ --func unpublish
37
+ --subgraphName davesSubgraph
41
38
```
42
39
43
- Run the script without arguments for more usage info.
44
-
45
- ## Register a top-level domain
46
-
40
+ ** Transferring ownership of a subgraph**
47
41
``` sh
48
- ./register-domain.ts --domain < name>
42
+ ts-node ./gns.ts
43
+ --func transfer
44
+ --subgraphName davesSubgraph
45
+ --newOwner 0x7F11E5B7Fe8C04c1E4Ce0dD98aC5c922ECcfA4ed
49
46
```
50
47
51
- Run the script without arguments for more usage info.
52
-
53
- ## Create a subgraph (with meta data)
54
-
48
+ ## Graph Token
49
+ ** Mint**
55
50
``` sh
56
- ./create-subgraph.ts \
57
- --ipfs < ipfs-node> \
58
- --subgraph < subgraph-name> \
59
- --display-name " ..." \
60
- ...
51
+ ts-node ./graph-token.ts
52
+ --func mint
53
+ --account 0x7F11E5B7Fe8C04c1E4Ce0dD98aC5c922ECcfA4ed
54
+ --amount 100
61
55
```
62
56
63
- Run the script without arguments for more usage info.
64
-
65
- ## Update a subgraph to a new ID
66
-
57
+ ** Transfer**
67
58
``` sh
68
- ./update-subgraph-id.ts \
69
- --subgraph < subgraph-name> \
70
- --id < ipfs-hash>
59
+ ts-node ./graph-token.ts
60
+ --func transfer
61
+ --account 0x7F11E5B7Fe8C04c1E4Ce0dD98aC5c922ECcfA4ed
62
+ --amount 100
71
63
```
72
64
73
- Run the script without arguments for more usage info.
65
+ ** Approve**
66
+ ``` sh
67
+ ts-node ./graph-token.ts
68
+ --func approve
69
+ --account 0x7F11E5B7Fe8C04c1E4Ce0dD98aC5c922ECcfA4ed
70
+ --amount 100
71
+ ```
74
72
75
- ## Stake for indexing on a subgraph ID
73
+ ## Service Registry
74
+ ** Register**
75
+ ``` sh
76
+ ts-node ./service-registry.ts
77
+ --func register
78
+ --url https://172.0.0.1
79
+ --geohash gbsuve
80
+ ```
76
81
82
+ ** Unregister**
77
83
``` sh
78
- ./stake-for-indexing.ts \
79
- --subgraph-id < ipfs-hash> \
80
- --amount < number> # minimum: 100
84
+ ts-node ./service-registry.ts
85
+ --func unregister
81
86
```
82
87
83
- Run the script without arguments for more usage info.
88
+ ## Curation
89
+ ** stake**
90
+ ``` sh
91
+ ts-node ./curation.ts
92
+ --func stake
93
+ --amount 520
94
+ ```
84
95
85
- ## Update an indexer's node URL
96
+ ** redeem**
97
+ ``` sh
98
+ ts-node ./curation.ts
99
+ --func redeem
100
+ --amount 520
101
+ ```
86
102
87
- This sets the current Ethereum account's index node URL in the service registry.
103
+ ## Staking
104
+ ** stake**
105
+ ``` sh
106
+ ts-node ./staking.ts
107
+ --func stake
108
+ --amount 520
109
+ ```
88
110
111
+ ** unstake**
89
112
``` sh
90
- ./set-url.ts \
91
- --url < index-node-url>
113
+ ts-node ./staking.ts
114
+ --func unstake
115
+ --amount 520
92
116
```
93
117
94
- Run the script without arguments for more usage info.
118
+ ** withdraw**
119
+ ``` sh
120
+ ts-node ./staking.ts
121
+ --func withdraw
122
+ ```
0 commit comments