0.3.3 • Published 4 months ago

@graphprotocol/horizon v0.3.3

Weekly downloads
-
License
GPL-2.0-or-later
Repository
-
Last release
4 months ago

🌅 Graph Horizon 🌅

Graph Horizon is the next evolution of the Graph Protocol.

Configuration

The following environment variables might be required:

VariableDescription
ARBISCAN_API_KEYArbiscan API key - for contract verification
ARBITRUM_ONE_RPCArbitrum One RPC URL - defaults to https://arb1.arbitrum.io/rpc
ARBITRUM_SEPOLIA_RPCArbitrum Sepolia RPC URL - defaults to https://sepolia-rollup.arbitrum.io/rpc
LOCALHOST_RPCLocalhost RPC URL - defaults to http://localhost:8545

You can set them using Hardhat:

npx hardhat vars set <variable>

Build

pnpm install
pnpm build

Deployment

Note that this instructions will help you deploy Graph Horizon contracts, but no data service will be deployed. If you want to deploy the Subgraph Service please refer to the Subgraph Service README for deploy instructions.

New deployment

To deploy Graph Horizon from scratch run the following command:

npx hardhat deploy:protocol --network hardhat

Upgrade deployment

Usually you would run this against a network (or a fork) where the original Graph Protocol was previously deployed. To upgrade an existing deployment of the original Graph Protocol to Graph Horizon, run the following commands. Note that some steps might need to be run by different accounts (deployer vs governor):

npx hardhat deploy:migrate --network hardhat --step 1
npx hardhat deploy:migrate --network hardhat --step 2 # Run with governor. Optionally add --patch-config
npx hardhat deploy:migrate --network hardhat --step 3 # Optionally add --patch-config
npx hardhat deploy:migrate --network hardhat --step 4 # Run with governor. Optionally add --patch-config

Steps 2, 3 and 4 require patching the configuration file with addresses from previous steps. The files are located in the ignition/configs directory and need to be manually edited. You can also pass --patch-config flag to the deploy command to automatically patch the configuration reading values from the address book. Note that this will NOT update the configuration file.

Testing

  • unit: Unit tests can be run with pnpm test
  • integration: Integration tests can be run with pnpm test:integration - Need to set BLOCKCHAIN_RPC for a chain where The Graph is already deployed - If no BLOCKCHAIN_RPC is detected it will try using ARBITRUM_SEPOLIA_RPC
  • deployment: Deployment tests can be run with pnpm test:deployment --network <network>, the following environment variables allow customizing the test suite for different scenarios:
    • TEST_DEPLOYMENT_STEP (default: 1) - Specify the latest deployment step that has been executed. Tests for later steps will be skipped.
    • TEST_DEPLOYMENT_TYPE (default: migrate) - The deployment type protocol/migrate that is being tested. Test suite has been developed for migrate use case but can be run against a protocol deployment, likely with some failed tests.
    • TEST_DEPLOYMENT_CONFIG (default: hre.network.name) - The Ignition config file name to use for the test suite.

Verification

To verify contracts on a network, run the following commands:

./scripts/pre-verify <ignition-deployment-id>
npx hardhat ignition verify --network <network> --include-unrelated-contracts <ignition-deployment-id>
./scripts/post-verify
0.3.3

4 months ago

0.3.2

5 months ago

0.3.1

5 months ago

0.3.0

5 months ago

0.2.1

5 months ago

0.2.0

5 months ago

0.1.1

5 months ago

0.1.0

5 months ago