Skip to main content
The stellarium deploy command publishes contracts, event types and structs from .req files to a node. In this tutorial you keep those files in a GitHub repository, check them on every pull request, and deploy them when a change reaches main.

Prerequisites

  • A running Stellarium node. To deploy event types or structs, the node must be enrolled in an organization.
  • A GitHub repository for your .req files.
1

Add your declarations

Put your declarations in one directory, such as stellarium/, with one declaration per file:
stellarium/Address.req
stellarium/OrderPlaced.req
stellarium/ShippingLabel.req
2

Create an API client

Create an API client for your node on the Stellarium Platform. To deploy event types or structs, create it in the organization the node is enrolled in. Save its client ID and secret.
3

Add its details to GitHub

In your repository, open Settings > Secrets and variables > Actions and add:
4

Add the workflow

.github/workflows/stellarium.yml
The check job needs no secrets, so it also works on pull requests from forks. concurrency runs one deploy at a time. --output agent prints plain text to the job log instead of the JSON used when output is piped.
5

Ship a change

Versions are immutable, so edit a declaration and give it a new version:
stellarium/ShippingLabel.req
Open a pull request and merge it. The deploy job publishes the new version and reports the others as unchanged:

How deploys behave

  • Order. Structs deploy first, with a struct before any struct that names it, then event types, then contracts.
  • Deploying again is safe. Versions the node already has with the same content are left alone and cost nothing, so you can re-run a job.
  • A changed file needs a new version. If a file changed but its version didn’t, nothing is deployed and the command exits with code 4.
  • A failure stops the deploy. Files before it stay deployed. Fix the file and run the job again.
  • Requests are skipped. A request script found in a directory isn’t deployed.
  • Fees. A node can charge other organizations a deploy fee for contracts. It’s paid from your API client’s run.
--dry-run reads each file’s declaration and compares it with the node’s public routes. The node checks the rest of the script when you deploy, so a syntax error in a contract body fails the deploy job, not the check job.

Troubleshooting