This repository holds shell scripts that Intersect uses to engage in Cardano on-chain governance.
-
- Creates a governance-action JSON-LD file (CIP-108 body + CIP-169 extension + CIP-116 ProposalProcedure on-chain format, including Intersect CIP108 schemas)
- Requires a
.mdinput file with H2 sections (## Title,## Abstract,## Motivation,## Rationale,## References,## Authors) - Requires
--governance-action-type <info|treasury|ppu>and--deposit-return-addr <stake-address> - Optional
--language <BCP-47-tag>sets the JSON-LD@context.@language(default:en)
-
- Requires at least one schema source (
--cip100/--cip108/--cip119/--cip136/--cip169/--intersect-schema/--schema <URL>); errors early otherwise - Supports CIP100, CIP108, CIP119, CIP136, CIP169 and Intersect CIP108 schemas
- Enforces
body.titlelength ≤ 80 andbody.abstractlength ≤ 2500 characters when those fields are present - Applies an aspell spell check to CIP108 metadata fields; the personal dictionary is fetched at runtime from the
mainbranch of this repo — no local copy needed. Skip with--no-spell-check. - Checks that every URI in the document (structured
uri/urlfields plus markdown links / bare URLs intitle/abstract/motivation/rationale) is reachable;ipfs://<cid>is resolved via$IPFS_GATEWAY_URI(fallbackhttps://ipfs.io). Skip with--no-check-links.
- Requires at least one schema source (
-
- Uses cardano-singer to produce a blake2b-256 hash digest of a given metadata canonized body
- This is useful when trying to create author signatures
-
- Creates a info governance action from a Intersect metadata
- Uses a local cardano node socket file
-
- Creates a treasury withdrawal governance action from a Intersect metadata
- Uses a local cardano node socket file
- ipfs-check.sh
- Checks if a file is accessible via free IPFS gateways
- ipfs-pin.sh
- Pins file(s) across local IPFS node, Pinata, Blockfrost, and NMKR (enabled by default; disable individually with
--no-local,--no-pinata,--no-blockfrost,--no-nmkr) - Accepts a single file or a directory; use
--just-jsonldto limit a directory walk to.jsonldfiles --check-toofirst runsipfs-check.shand skips pinning if the file is already discoverable
- Pins file(s) across local IPFS node, Pinata, Blockfrost, and NMKR (enabled by default; disable individually with
- cip-108-markdown.sh
- Creates a markdown file from CIP108 metadata
- author-create.sh
- Adds an author witness to CIP100/CIP108 metadata
- author-validate.sh
- Checks the correctness of CIP100/CIP108 metadata with a author(s) witness(es)
- Also compares each author's public key against Intersect's well-known key; pass
--no-intersectto skip
- hash.sh
- Prints a BLAKE2b-256 hash of the given file using both
b2sumandcardano-cli, so the two outputs can be compared
- Prints a BLAKE2b-256 hash of the given file using both
- pdf-remove-metadata.sh
- Removes PDF metadata from PDF files
Note: These are really only useful for archival reasons.
- budget-metadata-validate.sh
- Runs correctness and validity checks for budget treasury withdrawal CIP108 metadata.
- Uses a combination of the other scripts
- budget-metadata-create.sh
- Creates Intersect budget metadata file from a
.docx - This expects certain structure within the
.docx
- Creates Intersect budget metadata file from a
- budget-action-create.sh
- Creates Intersect budget treasury withdrawal file from a .jsonld
- query-live-actions.sh
- Fetches active governance actions from Koios and prints their DRep vote summary
- 2025 Budget Treasury Withdrawals
- Documents the scripts and high level process to create the treasury withdrawal governance actions for the Intersect 2025 budget.
In order to run all of these scripts you will need the following binaries/packages installed:
-
ajv-cli (
ajv)- Used by:
metadata-validate.sh - JSON schema validation
- Used by:
-
aspell
- Used by:
metadata-validate.sh - Spell checking for metadata fields
- Used by:
-
b2sum
- Used by:
action-create-info.sh,action-create-tw.sh,hash.sh - BLAKE2b-256 hashing
- Used by:
-
cardano-cli
- Used by:
action-create-info.sh,action-create-tw.sh,author-create.sh,hash.sh,budget-action-create.sh,budget-metadata-validate.sh - Cardano CLI tools for governance actions and address operations
- Used by:
-
- Used by:
metadata-canonize.sh,metadata-validate.sh,author-create.sh,author-validate.sh - Canonization and signing of governance metadata
- Used by:
-
curl
- Used by:
metadata-create.sh,metadata-validate.sh,ipfs-check.sh,ipfs-pin.sh,author-validate.sh,archive/query-live-actions.sh - HTTP requests for downloading schemas and API calls
- Used by:
-
- Used by:
action-create-info.sh,action-create-tw.sh,ipfs-check.sh,ipfs-pin.sh,budget-action-create.sh - IPFS file operations (adding, pinning, checking)
- Used by:
-
jq
- Used by: Most scripts
- JSON processing and manipulation
-
- Used by:
metadata-create.sh,budget-metadata-create.sh - Document conversion (DOCX to Markdown, Markdown processing)
- Used by:
-
perl
- Used by:
budget-metadata-create.sh - Text processing and regex operations
- Used by:
-
qpdf
- Used by:
pdf-remove-metadata.sh - PDF manipulation and linearization
- Used by:
-
exiftool
- Used by:
pdf-remove-metadata.sh - PDF metadata removal
- Used by:
-
bc
- Used by:
action-create-tw.sh - Arithmetic calculations (ADA amount formatting)
- Used by:
-
base64
- Used by:
ipfs-pin.sh - Base64 encoding for NMKR API
- Used by:
-
awk, sed (standard Unix utilities)
- Used by: Multiple scripts
- Text processing
The following scripts require a local Cardano node connection:
action-create-info.shaction-create-tw.shbudget-action-create.sh
Required Variables:
-
CARDANO_NODE_SOCKET_PATH- Path to the Cardano node socket file
- Example:
/path/to/cardano-node.socketor./node.socket - Used for querying governance state and creating governance actions
-
CARDANO_NODE_NETWORK_ID- Network identifier for the Cardano network
- Values:
764824073ormainnetfor mainnet, or testnet identifier for testnet - Used to determine network type (mainnet vs testnet)
Note: The scripts check that these variables are set and will exit with an error if they are missing.
The ipfs-pin.sh script supports multiple IPFS pinning services. The following environment variables are required only if you want to use the corresponding service:
-
PINATA_API_KEY- Required if using Pinata pinning service
- Get your API key from Pinata
-
BLOCKFROST_API_KEY- Required if using Blockfrost pinning service
- Get your API key from Blockfrost
-
NMKR_API_KEY- Required if using NMKR pinning service
- Get your API key from NMKR
-
NMKR_USER_ID- Required if using NMKR pinning service
- Your NMKR user ID
IPFS_GATEWAY_URI- Mentioned in script comments but not currently used in the code
- May be used in future versions for custom IPFS gateway configuration
Create a .env file in the scripts/ directory, based on example and source it:
source ./scripts/.envSee License.