|
| 1 | +# Publishing @graphprotocol/address-book |
| 2 | + |
| 3 | +Step-by-step guide for releasing a new version of the address-book package and deploying it to the network monitor. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- npm publish access for the `@graphprotocol` scope |
| 8 | +- Write access to the [network-monitor](https://github.com/edgeandnode/network-monitor) repo |
| 9 | +- Ability to trigger GitHub Actions workflows in both repos |
| 10 | + |
| 11 | +## Step 1: Update Address Files |
| 12 | + |
| 13 | +Update the source address files in the contracts monorepo. These live in: |
| 14 | + |
| 15 | +- `packages/horizon/addresses.json` |
| 16 | +- `packages/subgraph-service/addresses.json` |
| 17 | +- `packages/issuance/addresses.json` |
| 18 | + |
| 19 | +The address-book package symlinks to these files during development, so changes here are automatically reflected locally. |
| 20 | + |
| 21 | +## Step 2: Create a Changeset |
| 22 | + |
| 23 | +From the monorepo root: |
| 24 | + |
| 25 | +```bash |
| 26 | +pnpm changeset |
| 27 | +``` |
| 28 | + |
| 29 | +- Select `@graphprotocol/address-book` |
| 30 | +- Choose the bump type (patch/minor/major) |
| 31 | +- Describe what changed (e.g., "update arbitrumSepolia addresses after deployment") |
| 32 | + |
| 33 | +## Step 3: Version the Package |
| 34 | + |
| 35 | +```bash |
| 36 | +pnpm changeset version |
| 37 | +``` |
| 38 | + |
| 39 | +This consumes the changeset, bumps the version in `packages/address-book/package.json`, and updates `CHANGELOG.md`. |
| 40 | + |
| 41 | +## Step 4: Commit and Push |
| 42 | + |
| 43 | +```bash |
| 44 | +git add . |
| 45 | +git commit -m "chore: release @graphprotocol/address-book vX.Y.Z" |
| 46 | +git push |
| 47 | +``` |
| 48 | + |
| 49 | +## Step 5: Publish to npm |
| 50 | + |
| 51 | +1. Go to the contracts monorepo → Actions → "Publish package to NPM" |
| 52 | +2. Select `address-book` as the package |
| 53 | +3. Set tag to `latest` (or a pre-release tag) |
| 54 | +4. Run workflow |
| 55 | + |
| 56 | +The workflow automatically: |
| 57 | + |
| 58 | +- Publishes to npm (symlinks are converted to real files via `prepublishOnly`) |
| 59 | +- Creates and pushes a git tag (`@graphprotocol/address-book@X.Y.Z`) |
| 60 | + |
| 61 | +## Step 6: Verify on npm |
| 62 | + |
| 63 | +```bash |
| 64 | +npm view @graphprotocol/address-book version |
| 65 | +``` |
| 66 | + |
| 67 | +Confirm the new version is live. |
| 68 | + |
| 69 | +## Step 7: Update the Network Monitor |
| 70 | + |
| 71 | +In the [network-monitor](https://github.com/edgeandnode/network-monitor) repo: |
| 72 | + |
| 73 | +1. Update `package.json` to reference the new version: |
| 74 | + |
| 75 | + ```json |
| 76 | + "@graphprotocol/address-book": "X.Y.Z", |
| 77 | + ``` |
| 78 | + |
| 79 | +2. Run `yarn` to update the lockfile |
| 80 | +3. Commit and push |
| 81 | + |
| 82 | +The network monitor imports addresses from: |
| 83 | + |
| 84 | +- `@graphprotocol/address-book/horizon/addresses.json` (in `src/env.ts`) |
| 85 | +- `@graphprotocol/address-book/subgraph-service/addresses.json` (in `src/env.ts`, `src/tests/contracts.ts`) |
| 86 | + |
| 87 | +## Step 8: Deploy the Network Monitor |
| 88 | + |
| 89 | +1. Go to the network-monitor repo → Actions → "Deployment" |
| 90 | +2. Choose the target cluster: |
| 91 | + - **`network`** → production (mainnet) |
| 92 | + - **`testnet`** → testnet |
| 93 | +3. Run workflow |
| 94 | + |
| 95 | +This builds a Docker image, pushes it to `ghcr.io/edgeandnode/network-monitor`, and restarts the StatefulSet on GKE. |
| 96 | + |
| 97 | +## Quick Reference |
| 98 | + |
| 99 | +| Step | Action | Where | |
| 100 | +| ---- | ------------------------------- | ----------------------------- | |
| 101 | +| 1 | Update address files | contracts monorepo | |
| 102 | +| 2 | `pnpm changeset` | contracts monorepo | |
| 103 | +| 3 | `pnpm changeset version` | contracts monorepo | |
| 104 | +| 4 | Commit + push | contracts monorepo | |
| 105 | +| 5 | Publish to npm (auto-tags) | contracts monorepo GH Actions | |
| 106 | +| 6 | Verify on npm | npmjs.com | |
| 107 | +| 7 | Bump version in network-monitor | network-monitor repo | |
| 108 | +| 8 | Deploy network monitor | network-monitor GH Actions | |
0 commit comments