Note: This guide is for developers who want to contribute to Splice Wallet Kernel. It is worth reading the entire doc first before starting setup.
- Node.js 24+ (see
.nvmrcfor exact version) - Yarn 4 (via Corepack)
- Java (for Canton) - sdkman is recommended for version management
- Install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash - Restart your terminal
- Run
nvm installto install the Node.js version from.nvmrc - Run
corepack enableto enable Yarn - Run
yarn installto install dependencies - Run
yarn postinstallto set up auto sign-off hooks
In order for Husky to have access to Yarn (as part of our pre-commit), you might need to add an init file for certain IDEs.
Create the file ~/.config/husky/init.sh with the following content:
# ~/.config/husky/init.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvmAs a requirement under the Hyperledger Foundation, all commits must be signed off. This can be done by adding the -s flag every time you commit.
In this repo, we use Husky to automatically configure a git hook to do this for you.
It is also recommended (but not required) to add a GPG key: https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account
We use conventional commits to track version changes for packages and create informative changelogs. Our linter automatically checks that the commit scope matches an nx project name. Some common commit types are:
feat-- results in a minor version bump for the scoped package (feat(pkg): ...)fix-- results in a patch version bump for the scoped package (fix(pkg): ...)build,chore,ci,docs,perf,refactor,revert,style,test
Major version bumps are triggered by adding an exclamation after the scope (feat(pkg)!: breaking change) or by including a BREAKING CHANGE: ... trailer at the end of the commit message.
Build all packages:
yarn build:allThis uses nx to build all workspaces in parallel. After the initial build, you can selectively build each package by navigating into the corresponding directory and running yarn build.
Other useful commands:
yarn clean:all # Clean all build artifacts and reset nx cache
yarn test:all # Run tests across all packages
yarn full:rebuild # Clean, regenerate, and rebuild everything
yarn full:up # Start localnet and all dev servers
yarn full:down # Stop everything and rebuildRun yarn generate:<api> from the root to regenerate RPC clients/servers. For example:
yarn generate:dapp # Regenerate dApp API client
yarn generate:all # Regenerate all API specsTo support fast iteration loops, most workspaces have dev scripts that watch their source directories for changes and rebuild. Start all dev servers with:
yarn start:allThis uses pm2 to run each dev server in parallel. See the pm2 cheatsheet for more commands (preface them with yarn pm2 when invoking).
yarn pm2 list # Show running processes
yarn pm2 logs # View logs
yarn stop:all # Stop all servicesNote: Codegenned artifacts are not automatically watched. Use
yarn generate:allif updating the API specs.
After running yarn start:all, you'll have services exposed on the following ports:
| Service | URL |
|---|---|
| Example Ping dApp | localhost:8080 |
| Example Portfolio | localhost:8081 |
| HTTP Wallet Gateway | localhost:3030 |
To run a local Splice network (includes Canton + Splice services):
yarn script:fetch:localnet # Download localnet artifacts
yarn start:localnet # Start the local network
yarn stop:localnet # Stop the local networkIf you need to run Canton without the full Splice network (localnet already includes Canton):
- Ensure you have Java installed - sdkman is recommended for version management
- Run
yarn script:fetch:cantonto download Canton to.canton/ - Run
yarn start:cantonto start a participant & synchronizer
yarn start:canton # Start Canton (mainnet config)
yarn start:canton:tls # Start Canton with TLS enabled
yarn start:canton:console # Start Canton with interactive consoleMany scripts support a --network flag to target different environments:
yarn script:fetch:canton --network=devnet # Fetch devnet Canton version
yarn script:fetch:canton --network=mainnet # Fetch mainnet Canton version (default)