Production deployments are managed through GitHub Actions for consistency and security.
main branch. Staging deployments can be triggered from any branch.
- Go to the Actions tab in the GitHub repository
- Click "Run workflow"
- Fill in the required parameters:
- Environment: Choose
productionorstaging - Subgraph: Name of the subgraph to deploy (e.g.,
autonolas,mech) - Version: Semantic version to deploy (e.g.,
v0.1.2) - Manifest: Manifest file name (e.g.,
subgraph.yamlorsubgraph.base.yaml)
- Environment: Choose
- Click "Run workflow"
Run the interactive deployment script to generate the GitHub CLI command:
node scripts/deploy.tsThe script will:
- Prompt you to select the subgraph
- Prompt you to select the manifest file
- Ask for the version to deploy
- Generate the
gh workflow runcommand for you to execute
Once triggered (via UI or CLI), the workflow will:
- Display a deployment plan with your inputs
- Validate version format, subgraph folder, and manifest file
- Build and deploy the subgraph to production
- Display a summary with the deployment URL
Subgraph naming convention:
- Format:
{subgraph}-{network}-{version}or{subgraph}-{version}(if no network) - Version format: Dots (
.) are replaced with underscores (_) - Examples:
autonolas-v0_1_2(fromsubgraph.yaml)tokenomics-mode-mainnet-v0_1_2(fromsubgraph.mode-mainnet.yaml)
The deployed subgraph will be available at:
https://subgraph.autonolas.tech/subgraphs/name/{SUBGRAPH_NAME}
- Query all available records
{
units{
id,
tokenId,
packageType,
metadataHash,
packageHash,
publicId
}
}- Query by package hash
{
units(where:{packageHash:<package_hash>}){
id,
tokenId,
packageType,
metadataHash,
packageHash,
publicId
}
}- Query by public id and package type
{
units(where:{publicId:<public_id>,packageType:<package_type>}){
id,
tokenId,
packageType,
metadataHash,
packageHash,
publicId
}
}