This repository holds shell scripts that Intersect uses to engage in Cardano on-chain governance.
-
- Creates governance action CIP-108+ (including Intersect CIP108 schemas) JSONLD file
- Takes an inputted markdown file in expected shape
-
- Compares governance metadata against the established schema(s)
- Supports CIP100, CIP108, CIP119, CIP136 and Intersect CIP108 schemas
- Applies a spell check to CIP108 metadata fields
-
- 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
- Allows user to pin JSONLD file(s) on a number of pinning services
- Optionally allows the user to check file's discoverability first
- cip-108-create-human-readable.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)
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
- hash.sh
- Performs a blake2b-256 hash on provided file
- pdf-remove-metadata.sh
- Removes PDF metadata from PDF files
- 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,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.