Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
ALCHEMY_KEY=
THEGRAPH_API_TOKEN=
SATSUMA_DEPLOY_KEY=
# You can find the IPFS hash by querying your Alchemy subgraph endpoint:
# query {
# _meta {
# deployment
# }
# }
#
IPFS_HASH=

#these are deterministic when deployed in that order on a fresh node with hardhat (anvil) seed
IPNFT_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
Expand Down
4 changes: 2 additions & 2 deletions subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build:sepolia": "graph codegen && graph build --network sepolia",
"build:mainnet": "graph codegen && graph build --network mainnet",
"deploy:local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 moleculeprotocol/ipnft-subgraph",
"deploy:sepolia": "env-cmd -x -f ../.env graph deploy ip-nft-sepolia --version-label 1.3.2 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --ipfs https://ipfs.satsuma.xyz --deploy-key \\$SATSUMA_DEPLOY_KEY",
"deploy:mainnet": "env-cmd -x -f ../.env graph deploy ip-nft-mainnet --version-label 1.3.2 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --ipfs https://ipfs.satsuma.xyz --deploy-key \\$SATSUMA_DEPLOY_KEY",
"deploy:sepolia": "env-cmd -x -f ../.env goldsky subgraph deploy ip-nft-sepolia/1.3.2 --from-ipfs-hash \\$IPFS_HASH --ipfs-gateway https://ipfs.satsuma.xyz --deploy-key \\$SATSUMA_DEPLOY_KEY",
"deploy:mainnet": "env-cmd -x -f ../.env goldsky subgraph deploy ip-nft-mainnet/1.3.2 --from-ipfs-hash \\$IPFS_HASH --ipfs-gateway https://ipfs.satsuma.xyz --deploy-key \\$SATSUMA_DEPLOY_KEY",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify environment variables are properly documented in .env.example.

The deploy scripts now require IPFS_HASH and SATSUMA_DEPLOY_KEY environment variables to be set in .env. While the AI summary indicates .env.example was updated, I need to confirm these variables are documented with clear descriptions for developers.

Run the following script to verify the environment variable documentation:


🏁 Script executed:

#!/bin/bash
# Description: Verify IPFS_HASH and SATSUMA_DEPLOY_KEY are defined in .env.example

# Check if .env.example exists and contains required variables
if [ -f ".env.example" ]; then
  echo "=== Checking .env.example for required variables ==="
  grep -E "IPFS_HASH|SATSUMA_DEPLOY_KEY" .env.example || echo "WARNING: Required variables not found in .env.example"
else
  echo "ERROR: .env.example file not found at repository root"
fi

# Also check if there's any README or setup documentation
if [ -f "README.md" ]; then
  echo -e "\n=== Checking README.md for deployment documentation ==="
  grep -A5 -B5 "deploy\|Goldsky\|IPFS_HASH" README.md || echo "No Goldsky/deployment documentation found in README.md"
fi

# Check if there's a subgraph-specific README or deployment guide
if [ -f "subgraph/README.md" ]; then
  echo -e "\n=== Checking subgraph/README.md for deployment instructions ==="
  grep -A10 -B5 "deploy\|Goldsky\|environment" subgraph/README.md || echo "No deployment instructions found in subgraph/README.md"
fi

Length of output: 8853


Update subgraph/README.md to document Goldsky deployment workflow.

Environment variables IPFS_HASH and SATSUMA_DEPLOY_KEY are properly documented in .env.example. However, the deployment documentation in subgraph/README.md still references the deprecated hosted-service method (yarn graph deploy --product hosted-service). Add a new section documenting the updated Goldsky deployment commands (yarn deploy:sepolia and yarn deploy:mainnet) to ensure developers understand the new deployment workflow.

🤖 Prompt for AI Agents
In subgraph/package.json around lines 11-12, the project scripts use Goldsky for
deployments but subgraph/README.md still documents the deprecated hosted-service
workflow; update README.md to add a new "Goldsky deployment" section that
replaces the old hosted-service instructions, show the exact new commands (yarn
deploy:sepolia and yarn deploy:mainnet), note the required environment variables
IPFS_HASH and SATSUMA_DEPLOY_KEY (pointing readers to ../.env.example), and
include usage notes about env-cmd, the --from-ipfs-hash and --ipfs-gateway flags
and how to export or load the vars before running the deploy commands.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Confirm goldsky CLI is available as a dependency or global tool.

The deploy scripts invoke goldsky command directly. Verify that:

  1. The goldsky CLI is installed (either globally or via npm/yarn)
  2. The command path is available in the deployment environment
  3. Developers have clear setup/installation instructions

Run the following script to verify goldsky CLI availability:


🏁 Script executed:

#!/bin/bash
# Description: Verify goldsky CLI is properly configured

# Check if goldsky is listed in package.json dependencies
echo "=== Checking for goldsky in package.json ==="
jq '.dependencies.goldsky // .devDependencies.goldsky // "NOT FOUND"' subgraph/package.json

# Check if there are any installation or setup scripts in package.json
echo -e "\n=== Checking for setup/install scripts ==="
jq '.scripts | keys[]' subgraph/package.json | head -20

# Check if goldsky is mentioned in any documentation
echo -e "\n=== Searching for goldsky setup instructions ==="
find . -name "*.md" -type f 2>/dev/null | xargs grep -l "goldsky\|Goldsky" 2>/dev/null | head -5 || echo "No setup docs found"

Length of output: 299


I need to verify a few more things to understand the deployment setup:

Now let me check for documentation and env-cmd dependency:

I need to check if env-cmd is listed as a dependency and look for any setup documentation:

Missing @goldskycom/cli dependency in deploy scripts.

The Goldsky CLI (@goldskycom/cli) must be installed as an npm dependency, but it is not listed in subgraph/package.json. This CLI is required to deploy subgraphs. Additionally, env-cmd (used to load environment variables from .env files) should also be verified as a dependency.

Add @goldskycom/cli and env-cmd to subgraph/package.json dependencies/devDependencies, or document clear setup instructions for developers on how to install these tools globally. Without these dependencies, the deploy scripts (deploy:sepolia and deploy:mainnet) will fail in CI/CD and local environments.


🏁 Script executed:

#!/bin/bash
# Final verification: check for env-cmd and README files

echo "=== Checking for env-cmd in subgraph/package.json ==="
jq '.dependencies.["env-cmd"] // .devDependencies.["env-cmd"] // "NOT FOUND"' subgraph/package.json

echo -e "\n=== Checking for env-cmd in root package.json ==="
if [ -f package.json ]; then
  jq '.dependencies.["env-cmd"] // .devDependencies.["env-cmd"] // "NOT FOUND"' package.json
else
  echo "Root package.json not found"
fi

echo -e "\n=== Looking for README files ==="
find . -maxdepth 2 -name "README*" -type f 2>/dev/null | head -10

echo -e "\n=== Checking subgraph root for documentation ==="
ls -la subgraph/ | grep -iE "readme|setup|install|contributing" || echo "No setup docs found in subgraph/"

Length of output: 558


Let me correct the script syntax and explore the directory structure:


🏁 Script executed:

#!/bin/bash
# Corrected verification script

echo "=== Current directory structure ==="
pwd
ls -la | head -20

echo -e "\n=== Checking for subgraph/package.json ==="
if [ -f subgraph/package.json ]; then
  echo "Found subgraph/package.json"
  echo "=== env-cmd in subgraph/package.json ==="
  jq '.dependencies."env-cmd" // .devDependencies."env-cmd" // "NOT FOUND"' subgraph/package.json
  echo "=== goldsky in subgraph/package.json ==="
  jq '.dependencies | keys[] | select(. | contains("goldsky"))' subgraph/package.json 2>/dev/null || echo "Not in dependencies"
  jq '.devDependencies | keys[] | select(. | contains("goldsky"))' subgraph/package.json 2>/dev/null || echo "Not in devDependencies"
else
  echo "subgraph/package.json not found in current directory"
fi

echo -e "\n=== Search for README files in repo ==="
find . -type f \( -name "README.md" -o -name "README.txt" -o -name "SETUP*" \) 2>/dev/null | grep -v node_modules | grep -v ".git" | head -10

echo -e "\n=== Search for goldsky/Goldsky mentions in root directory files ==="
grep -r "goldsky\|@goldskycom" . --include="*.md" --include="*.txt" 2>/dev/null | head -5 || echo "No mentions found"

Length of output: 845


I need to navigate to the cloned repository directory:


🏁 Script executed:

#!/bin/bash
# Navigate to repo and verify dependencies

cd git

echo "=== Working directory ==="
pwd

echo -e "\n=== Content of subgraph/package.json (dependencies section) ==="
jq '.dependencies' subgraph/package.json 2>/dev/null | head -20

echo -e "\n=== Content of subgraph/package.json (devDependencies section) ==="
jq '.devDependencies' subgraph/package.json 2>/dev/null | head -20

echo -e "\n=== Search for goldsky or env-cmd ==="
jq '.dependencies + .devDependencies | keys[] | select(. | test("goldsky|env-cmd"))' subgraph/package.json 2>/dev/null || echo "Neither found in dependencies"

echo -e "\n=== README files in repository ==="
find . -maxdepth 3 -name "README*" -type f 2>/dev/null | grep -v node_modules | head -10

echo -e "\n=== GitHub workflows or CI config mentioning goldsky ==="
find . -path "*/.github/workflows/*.yml" -o -path "*/.github/workflows/*.yaml" 2>/dev/null | xargs grep -l "goldsky" 2>/dev/null || echo "No CI workflow references to goldsky"

Length of output: 606


Now let me check the README files for deployment setup instructions:


🏁 Script executed:

#!/bin/bash
cd git

echo "=== Root README.md (deployment section) ==="
grep -A 20 -B 2 -i "deploy\|goldsky\|setup" README.md | head -50

echo -e "\n=== Subgraph README.md (full content) ==="
cat subgraph/README.md

Length of output: 8907


Add @goldskycom/cli dependency or document Satsuma deployment setup.

The deploy:sepolia and deploy:mainnet scripts invoke the goldsky CLI command, but @goldskycom/cli is not listed in subgraph/package.json dependencies. Additionally, the README does not document the setup required for Satsuma deployments.

Either:

  1. Add @goldskycom/cli to subgraph/package.json as a dev dependency, or
  2. Document clear setup instructions for developers to install the Goldsky CLI globally and configure Satsuma deployment credentials

Note: env-cmd is already properly included as a devDependency, so that is not a concern.

🤖 Prompt for AI Agents
In subgraph/package.json around lines 11-12 the npm scripts call the external
goldsky CLI but @goldskycom/cli is not declared; add @goldskycom/cli as a
devDependency (run npm install --save-dev @goldskycom/cli and update
package.json) so CI and local installs can run the scripts, and also update the
repository README with a short Satsuma deployment section that documents either
installing the Goldsky CLI globally (npm i -g @goldskycom/cli) or using the
local devDependency, and the required env vars/steps to obtain and set
SATSUMA_DEPLOY_KEY and IPFS_HASH for deploys.

"create:local": "graph create --node http://localhost:8020/ moleculeprotocol/ipnft-subgraph",
"remove:local": "graph remove --node http://localhost:8020/ moleculeprotocol/ipnft-subgraph",
"test": "graph test"
Expand Down