Skip to content

Commit 170572f

Browse files
authored
Merge pull request #1069 from graphprotocol/tmigone/ignition-v0.15.7
2 parents 27afeb8 + cd24658 commit 170572f

File tree

9 files changed

+93
-73
lines changed

9 files changed

+93
-73
lines changed

packages/horizon/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ Graph Horizon is the next evolution of the Graph Protocol.
44

55
## Deployment
66

7-
We use Hardhat Ignition to deploy the contracts. To build and deploy the contracts run the following commands:
7+
We use Hardhat Ignition to deploy the contracts. To build and deploy Graph Horizon run the following commands:
88

99
```bash
1010
yarn install
1111
yarn build
1212
npx hardhat ignition deploy ./ignition/modules/horizon.ts \
13-
--parameters ./ignition/configs/horizon.hardhat.json \
13+
--parameters ./ignition/configs/horizon.hardhat.json5 \
1414
--network hardhat
1515
```
1616

17-
You can use any network defined in `hardhat.config.ts` by replacing `hardhat` with the network name.
17+
You can use any network defined in `hardhat.config.ts` by replacing `hardhat` with the network name.
18+
19+
Note that this will deploy a standalone version of Graph Horizon contracts, meaning the Subgraph Service or any other data service will not be deployed. If you want to deploy the Subgraph Service please refer to the [Subgraph Service README](../subgraph-service/README.md) for deploy instructions.

packages/horizon/ignition/configs/horizon.hardhat.json renamed to packages/horizon/ignition/configs/horizon.hardhat.json5

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,27 @@
11
{
2-
"GraphProxyAdmin": {
3-
"governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"
4-
},
5-
"Controller": {
2+
"$global": {
63
"governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",
7-
"pauseGuardian": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC"
8-
},
9-
"RewardsManager": {
4+
"pauseGuardian": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC",
105
"subgraphAvailabilityOracle": "0xd03ea8624C8C5987235048901fB614fDcA89b117",
11-
"issuancePerBlock": "114155251141552511415n",
6+
// Placeholder address for a standalone Horizon deployment, see README.md for more details
127
"subgraphServiceAddress": "0x0000000000000000000000000000000000000000"
138
},
9+
"RewardsManager": {
10+
"issuancePerBlock": "114155251141552511415n"
11+
},
1412
"EpochManager": {
1513
"epochLength": 60
1614
},
17-
"GraphTokenGateway": {
18-
"pauseGuardian": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC"
19-
},
2015
"Curation": {
2116
"curationTaxPercentage": 10000,
2217
"minimumCurationDeposit": 1
2318
},
2419
"GraphToken": {
25-
"initialSupply": "10000000000000000000000000000n",
26-
"governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"
20+
"initialSupply": "10000000000000000000000000000n"
2721
},
2822
"HorizonStaking": {
29-
"subgraphServiceAddress": "0x0000000000000000000000000000000000000000",
3023
"maxThawingPeriod": 2419200
3124
},
32-
"HorizonStakingExtension": {
33-
"subgraphServiceAddress": "0x0000000000000000000000000000000000000000"
34-
},
3525
"GraphPayments": {
3626
"protocolPaymentCut": 10000
3727
},

packages/horizon/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
1818
"@nomicfoundation/hardhat-ethers": "^3.0.8",
1919
"@nomicfoundation/hardhat-foundry": "^1.1.1",
20-
"@nomicfoundation/hardhat-ignition": "^0.15.5",
21-
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.5",
20+
"@nomicfoundation/hardhat-ignition": "^0.15.8",
21+
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.8",
2222
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
2323
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
2424
"@nomicfoundation/hardhat-verify": "^2.0.10",
25-
"@nomicfoundation/ignition-core": "^0.15.5",
25+
"@nomicfoundation/ignition-core": "^0.15.8",
2626
"@openzeppelin/contracts": "^5.0.2",
2727
"@openzeppelin/contracts-upgradeable": "^5.0.2",
2828
"@typechain/ethers-v6": "^0.5.0",

packages/horizon/scripts/deploy.ts

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
1+
require('json5/lib/register')
2+
13
import { ignition } from 'hardhat'
24

3-
import Parameters from '../ignition/configs/horizon.hardhat.json'
4-
import PeripheryModule from '../ignition/modules/periphery'
5+
import HorizonModule from '../ignition/modules/horizon'
56

67
async function main() {
7-
await ignition.deploy(PeripheryModule, {
8-
parameters: Parameters,
8+
const HorizonConfig = removeNFromBigInts(require('../ignition/configs/horizon.hardhat.json5'))
9+
10+
// Deploy Horizon
11+
await ignition.deploy(HorizonModule, {
12+
parameters: HorizonConfig,
913
})
1014
}
15+
main().catch((error) => {
16+
console.error(error)
17+
process.exit(1)
18+
})
1119

12-
main()
13-
.catch((error) => {
14-
console.error(error)
15-
process.exit(1)
16-
})
20+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
21+
function removeNFromBigInts(obj: any): any {
22+
// Ignition requires "n" suffix for bigints, but not here
23+
if (typeof obj === 'string') {
24+
return obj.replace(/(\d+)n/g, '$1')
25+
} else if (Array.isArray(obj)) {
26+
return obj.map(removeNFromBigInts)
27+
} else if (typeof obj === 'object' && obj !== null) {
28+
for (const key in obj) {
29+
obj[key] = removeNFromBigInts(obj[key])
30+
}
31+
}
32+
return obj
33+
}

packages/subgraph-service/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
# Sample Hardhat Project
1+
# 🌅 Subgraph Service 🌅
22

3-
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
3+
The Subgraph Service is a data service designed to work with Graph Horizon that supports indexing subgraphs and serving queries to consumers.
44

5-
Try running some of the following tasks:
5+
## Deployment
66

7-
```shell
8-
npx hardhat help
9-
npx hardhat test
10-
REPORT_GAS=true npx hardhat test
11-
npx hardhat node
12-
npx hardhat run scripts/deploy.ts
7+
We use Hardhat Ignition to deploy the contracts. To build and deploy the Subgraph Service run the following commands:
8+
9+
```bash
10+
yarn install
11+
yarn build
12+
npx hardhat run scripts/deploy.ts --network hardhat
1313
```
14+
15+
You can use any network defined in `hardhat.config.ts` by replacing `hardhat` with the network name.
16+
17+
Note that this will deploy and configure Graph Horizon contracts as well as the Subgraph Service.

packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json renamed to packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json5

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2+
"$global": {
3+
"arbitrator": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"
4+
},
25
"DisputeManager": {
3-
"arbitrator": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",
46
"disputePeriod": 2419200,
57
"disputeDeposit": "10000000000000000000000n",
68
"fishermanRewardCut": 500000,

packages/subgraph-service/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
1919
"@nomicfoundation/hardhat-ethers": "^3.0.8",
2020
"@nomicfoundation/hardhat-foundry": "^1.1.1",
21-
"@nomicfoundation/hardhat-ignition": "^0.15.5",
22-
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.5",
21+
"@nomicfoundation/hardhat-ignition": "^0.15.8",
22+
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.8",
2323
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
2424
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
2525
"@nomicfoundation/hardhat-verify": "^2.0.10",
26-
"@nomicfoundation/ignition-core": "^0.15.5",
26+
"@nomicfoundation/ignition-core": "^0.15.8",
2727
"@openzeppelin/contracts": "^5.0.2",
2828
"@openzeppelin/contracts-upgradeable": "^5.0.2",
2929
"@typechain/ethers-v6": "^0.5.0",
@@ -40,6 +40,7 @@
4040
"hardhat-gas-reporter": "^1.0.8",
4141
"hardhat-secure-accounts": "^1.0.4",
4242
"hardhat-storage-layout": "^0.1.7",
43+
"json5": "^2.2.3",
4344
"lint-staged": "^15.2.2",
4445
"prettier": "^3.2.5",
4546
"prettier-plugin-solidity": "^1.3.1",

packages/subgraph-service/scripts/deploy.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/* eslint-disable @typescript-eslint/no-unsafe-return */
33
/* eslint-disable @typescript-eslint/no-unused-vars */
44
/* eslint-disable @typescript-eslint/no-explicit-any */
5+
require('json5/lib/register')
6+
57
import { ignition } from 'hardhat'
68

79
import DisputeManagerModule from '../ignition/modules/DisputeManager'
@@ -17,8 +19,8 @@ import SubgraphServiceProxiesModule from '../ignition/modules/Proxies'
1719
// - Deploy SubgraphService and DisputeManager implementations
1820
async function main() {
1921
// TODO: Dynamically load config file based on the hardhat --network value
20-
const HorizonConfig = removeNFromBigInts(require('@graphprotocol/horizon/ignition/configs/horizon.hardhat.json'))
21-
const SubgraphServiceConfig = removeNFromBigInts(require('../ignition/configs/subgraph-service.hardhat.json'))
22+
const HorizonConfig = removeNFromBigInts(require('@graphprotocol/horizon/ignition/configs/horizon.hardhat.json5'))
23+
const SubgraphServiceConfig = removeNFromBigInts(require('../ignition/configs/subgraph-service.hardhat.json5'))
2224

2325
// Deploy proxies
2426
const { DisputeManagerProxy, DisputeManagerProxyAdmin, SubgraphServiceProxy, SubgraphServiceProxyAdmin } = await ignition.deploy(SubgraphServiceProxiesModule)

yarn.lock

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,12 +2933,12 @@ __metadata:
29332933
"@nomicfoundation/hardhat-chai-matchers": "npm:^2.0.0"
29342934
"@nomicfoundation/hardhat-ethers": "npm:^3.0.8"
29352935
"@nomicfoundation/hardhat-foundry": "npm:^1.1.1"
2936-
"@nomicfoundation/hardhat-ignition": "npm:^0.15.5"
2937-
"@nomicfoundation/hardhat-ignition-ethers": "npm:^0.15.5"
2936+
"@nomicfoundation/hardhat-ignition": "npm:^0.15.8"
2937+
"@nomicfoundation/hardhat-ignition-ethers": "npm:^0.15.8"
29382938
"@nomicfoundation/hardhat-network-helpers": "npm:^1.0.0"
29392939
"@nomicfoundation/hardhat-toolbox": "npm:^4.0.0"
29402940
"@nomicfoundation/hardhat-verify": "npm:^2.0.10"
2941-
"@nomicfoundation/ignition-core": "npm:^0.15.5"
2941+
"@nomicfoundation/ignition-core": "npm:^0.15.8"
29422942
"@openzeppelin/contracts": "npm:^5.0.2"
29432943
"@openzeppelin/contracts-upgradeable": "npm:^5.0.2"
29442944
"@typechain/ethers-v6": "npm:^0.5.0"
@@ -3027,12 +3027,12 @@ __metadata:
30273027
"@nomicfoundation/hardhat-chai-matchers": "npm:^2.0.0"
30283028
"@nomicfoundation/hardhat-ethers": "npm:^3.0.8"
30293029
"@nomicfoundation/hardhat-foundry": "npm:^1.1.1"
3030-
"@nomicfoundation/hardhat-ignition": "npm:^0.15.5"
3031-
"@nomicfoundation/hardhat-ignition-ethers": "npm:^0.15.5"
3030+
"@nomicfoundation/hardhat-ignition": "npm:^0.15.8"
3031+
"@nomicfoundation/hardhat-ignition-ethers": "npm:^0.15.8"
30323032
"@nomicfoundation/hardhat-network-helpers": "npm:^1.0.0"
30333033
"@nomicfoundation/hardhat-toolbox": "npm:^4.0.0"
30343034
"@nomicfoundation/hardhat-verify": "npm:^2.0.10"
3035-
"@nomicfoundation/ignition-core": "npm:^0.15.5"
3035+
"@nomicfoundation/ignition-core": "npm:^0.15.8"
30363036
"@openzeppelin/contracts": "npm:^5.0.2"
30373037
"@openzeppelin/contracts-upgradeable": "npm:^5.0.2"
30383038
"@typechain/ethers-v6": "npm:^0.5.0"
@@ -3049,6 +3049,7 @@ __metadata:
30493049
hardhat-gas-reporter: "npm:^1.0.8"
30503050
hardhat-secure-accounts: "npm:^1.0.4"
30513051
hardhat-storage-layout: "npm:^0.1.7"
3052+
json5: "npm:^2.2.3"
30523053
lint-staged: "npm:^15.2.2"
30533054
prettier: "npm:^3.2.5"
30543055
prettier-plugin-solidity: "npm:^1.3.1"
@@ -4679,33 +4680,34 @@ __metadata:
46794680
languageName: node
46804681
linkType: hard
46814682

4682-
"@nomicfoundation/hardhat-ignition-ethers@npm:^0.15.5":
4683-
version: 0.15.5
4684-
resolution: "@nomicfoundation/hardhat-ignition-ethers@npm:0.15.5"
4683+
"@nomicfoundation/hardhat-ignition-ethers@npm:^0.15.8":
4684+
version: 0.15.8
4685+
resolution: "@nomicfoundation/hardhat-ignition-ethers@npm:0.15.8"
46854686
peerDependencies:
46864687
"@nomicfoundation/hardhat-ethers": ^3.0.4
4687-
"@nomicfoundation/hardhat-ignition": ^0.15.5
4688-
"@nomicfoundation/ignition-core": ^0.15.5
4688+
"@nomicfoundation/hardhat-ignition": ^0.15.8
4689+
"@nomicfoundation/ignition-core": ^0.15.8
46894690
ethers: ^6.7.0
46904691
hardhat: ^2.18.0
4691-
checksum: 19f0e029a580dd4d27048f1e87f8111532684cf7f0a2b5c8d6ae8d811ff489629305e3a616cb89702421142c7c628f1efa389781414de1279689018c463cce60
4692+
checksum: 480825fa20d24031b330f96ff667137b8fdb67db0efea8cb3ccd5919c3f93e2c567de6956278e36c399311fd61beef20fae6e7700f52beaa813002cbee482efa
46924693
languageName: node
46934694
linkType: hard
46944695

4695-
"@nomicfoundation/hardhat-ignition@npm:^0.15.5":
4696-
version: 0.15.5
4697-
resolution: "@nomicfoundation/hardhat-ignition@npm:0.15.5"
4696+
"@nomicfoundation/hardhat-ignition@npm:^0.15.8":
4697+
version: 0.15.8
4698+
resolution: "@nomicfoundation/hardhat-ignition@npm:0.15.8"
46984699
dependencies:
4699-
"@nomicfoundation/ignition-core": "npm:^0.15.5"
4700-
"@nomicfoundation/ignition-ui": "npm:^0.15.5"
4700+
"@nomicfoundation/ignition-core": "npm:^0.15.8"
4701+
"@nomicfoundation/ignition-ui": "npm:^0.15.8"
47014702
chalk: "npm:^4.0.0"
47024703
debug: "npm:^4.3.2"
47034704
fs-extra: "npm:^10.0.0"
4705+
json5: "npm:^2.2.3"
47044706
prompts: "npm:^2.4.2"
47054707
peerDependencies:
47064708
"@nomicfoundation/hardhat-verify": ^2.0.1
47074709
hardhat: ^2.18.0
4708-
checksum: b3d9755f2bf89157b6ae0cb6cebea264f76f556ae0b3fc5a62afb5e0f6ed70b3d82d8f692b1c49b2ef2d60cdb45ee28fb148cfca1aa5a53bfe37772c71e75a08
4710+
checksum: 59b82470ff5b38451c0bd7b19015eeee2f3db801addd8d67e0b28d6cb5ae3f578dfc998d184cb9c71895f6106bbb53c9cdf28df1cb14917df76cf3db82e87c32
47094711
languageName: node
47104712
linkType: hard
47114713

@@ -4764,9 +4766,9 @@ __metadata:
47644766
languageName: node
47654767
linkType: hard
47664768

4767-
"@nomicfoundation/ignition-core@npm:^0.15.5":
4768-
version: 0.15.5
4769-
resolution: "@nomicfoundation/ignition-core@npm:0.15.5"
4769+
"@nomicfoundation/ignition-core@npm:^0.15.8":
4770+
version: 0.15.8
4771+
resolution: "@nomicfoundation/ignition-core@npm:0.15.8"
47704772
dependencies:
47714773
"@ethersproject/address": "npm:5.6.1"
47724774
"@nomicfoundation/solidity-analyzer": "npm:^0.1.1"
@@ -4777,14 +4779,14 @@ __metadata:
47774779
immer: "npm:10.0.2"
47784780
lodash: "npm:4.17.21"
47794781
ndjson: "npm:2.0.0"
4780-
checksum: ff14724d8e992dc54291da6e6a864f6b3db268b6725d0af6ecbf3f81ed65f6824441421b23129d118cd772efc8ab0275d1decf203019cb3049a48b37f9c15432
4782+
checksum: ebb16e092bd9a39e48cc269d3627430656f558c814cea435eaf06f2e7d9a059a4470d1186c2a7d108efed755ef34d88d2aa74f9d6de5bb73e570996a53a7d2ef
47814783
languageName: node
47824784
linkType: hard
47834785

4784-
"@nomicfoundation/ignition-ui@npm:^0.15.5":
4785-
version: 0.15.5
4786-
resolution: "@nomicfoundation/ignition-ui@npm:0.15.5"
4787-
checksum: 7d10e30c3078731e4feb91bd7959dfb5a0eeac6f34f6261fada2bf330ff8057ecd576ce0fb3fe856867af2d7c67f31bd75a896110b58d93ff3f27f04f6771278
4786+
"@nomicfoundation/ignition-ui@npm:^0.15.8":
4787+
version: 0.15.8
4788+
resolution: "@nomicfoundation/ignition-ui@npm:0.15.8"
4789+
checksum: c5e7b41631824a048160b8d5400f5fb0cb05412a9d2f3896044f7cfedea4298d31a8d5b4b8be38296b5592db4fa9255355843dcb3d781bc7fa1200fb03ea8476
47884790
languageName: node
47894791
linkType: hard
47904792

0 commit comments

Comments
 (0)