Publishing
ChainLink allows you to publish your project as a package to a package registry.
Prerequisites
- Metadata: Ensure your
chain.tomlhas the[Package]section filled out withNameandVersion. - Authentication: You must be logged in to the registry.
bash chainlink loginThis will typically trigger a GitHub device flow or prompt for an API key.
The Publishing Process
When you run chainlink publish, the following happens:
- Packaging: ChainLink creates a temporary directory and copies the
srcandpackagesfolders into it. - Manifest Generation: It automatically generates a
wally.tomlfile based on the metadata in yourchain.toml. - Compression: The package is zipped.
- Upload: The zip file is uploaded to the registry's
/v1/publishendpoint with the appropriateAuthorizationheader.
Registry Configuration
By default, ChainLink uses the standard package index. However, you can specify a custom registry in your chain.toml (though the current CLI implementation primarily derives the API from the registry index config).
Constraints
- Size Limit: Packages must be under 2MB.
- Version Conflict: You cannot publish a version that already exists in the registry.