Cannon is a DevOps tool for EVM chains. It's a tool for testing, deploying, and publishing of smart contracts.
This is the monorepo for Cannon. If you're just interested in using the project, visit the website.
For more information, please see documentation in the modules listed below:
api
: Backend for the website.cli
: The command-line interface. Runnpx @usecannon/cli --help
for usage information.builder
: Builds chain data from cannonfiles. (This is used by the CLI.)hardhat-cannon
: Code for the Hardhat plug-in, which wraps the CLI functionality with defaults pulled from a Hardhat project configuration.indexer
: Processes all data for cannon into a Redis database. Used on the website.registry
: The smart contract for the package registry.repo
: Backend for our homegrown IPFS hosting service.website
: The website, hosted at https://usecannon.com.
Usage Examples:
router-architecture
: Project demonstrating how to setup an upgradable Router Architecture.sample-hardhat-project
: Hardhat project that demonstrates the core functionality of thehardhat-cannon
modulesample-foundry-project
: Foundry project that demonstrates the core functionality of thecli
module
Cannon is 100% open-source, from the dev tooling to our hosted infrastructure.
Community contributions to Cannon are greatly appreciated. Please open pull requests, issues, and discussions in the GitHub repository.
To load a development version of Cannon, first start by making sure you have the correct node and pnpm versions installed.
Then, install the dependencies from the root directory:
pnpm i
After making changes, rebuild the project:
pnpm build
Use the development version of the CLI:
cd ./packages/cli && pnpm start -- <package:version>
Test changes to the Hardhat plug-in in the sample project:
cd ./examples/sample-hardhat-project && pnpm hardhat cannon:build
Preview updates to the website
cd ./packages/website && pnpm dev
See CONTRIBUTING.md
We bump and publish manually using lerna's version and publish workflow.
- To create a
stable
release, first checkout to a new branch (it should be calledrelease/*
)
- Note, DO NOT use the version name as the branch name as this can cause conflicts with tags. (eg
v2.12.1
as a branch name is incorrect)
- Run
pnpm run version-*
where*
can be patch, minor or major. - Create PR for the release branch
- From the branch, run
pnpm run publish
and follow the prompts. - Merge release PR
- To create an
alpha
release, first checkout to a new branch (it can be calledrelease-alpha
or something similar)
- Note, DO NOT use the version name as the branch name as this can cause conflicts with tags. (eg
v2.12.1-alpha.0
as a branch name is incorrect)
- Run
pnpm version-alpha
to bump package versions to an alpha version. - Create PR for the branch and merge when required tests are passing
- From the
main
branch, runpnpm publish-alpha
and follow the prompts.
To keep Cannon updated, we recommend using dependabot to regularly check for updates.
Below is an example of a dependabot configuration that checks daily for cannon updates and applies them:
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
groups:
cannon:
patterns:
- "@usecannon*"
- "*cannon*"
We can also use changesets to manage versions on our monorepo.
Currently our release workflow on our CI handles bumping package versions and publishing releases to npm through lerna. It only publishes releases if any changeset PR's have been added to the commit history merged into main.
To trigger a new version bump run the following command (from the root of the repo):
pnpm changeset
This project is licensed under the terms of the GNU General Public License v3.0.
Copyright (C) 2024 Taihou Technologies