Repository navigation
Contributing
Thank you for your interest in contributing to TKS. This guide covers the development workflow, code standards, and how to submit changes.
git clone https://github.com/TokenKickstarter/tokenkickstarter-node
cd tokenkickstarter-nodeThe workspace is a standard Cargo workspace. All members are in the root Cargo.toml.
Follow Getting Started to install Rust and system dependencies, then verify the build:
cargo check --workspaceFor faster iteration during development:
# Check without building
cargo check -p tks-chain-node
# Check the runtime only
cargo check -p tks-runtime
# Check a specific pallet
cargo check -p pallet-adaptive-gasAll Rust code must be formatted with rustfmt:
cargo fmt --allNo Clippy warnings allowed:
cargo clippy --workspace -- -D warningsFix all warnings before submitting a PR. Clippy warnings are treated as errors in CI.
Run the full test suite:
cargo test --workspaceRun tests for a specific crate:
cargo test -p pallet-adaptive-gas
cargo test -p pallet-name-registryWhen adding features, follow this pattern:
| Change Type | Where |
|---|---|
| New storage, logic, extrinsic | New or existing pallet in pallets/
|
| New pallet wire-up |
runtime/src/lib.rs — construct_runtime!
|
| New RPC method | node/src/rpc.rs |
| New CLI flag | node/src/cli.rs |
| Chain spec change | node/src/chain_spec.rs |
| New EVM precompile | runtime/src/precompiles.rs |
- Fork the repository
-
Create a branch with a descriptive name:
git checkout -b feat/my-feature
- Make your changes, following the code standards above
- Write tests for any new logic
-
Run the full check:
cargo fmt --all && cargo clippy --workspace -- -D warnings && cargo test --workspace
- Commit with a clear message (see below)
-
Push to your fork and open a PR against
main
<type>: <short description>
<longer explanation if needed>
Types:
| Type | Use Case |
|---|---|
feat |
New feature or pallet |
fix |
Bug fix |
ci |
CI/CD changes |
docs |
Documentation only |
refactor |
Code restructure without behavior change |
test |
New or updated tests |
chore |
Dependency updates, toolchain bumps |
Examples:
feat: add pallet-name-registry with free name registration
fix: resolve WASM linker undefined symbol on Rust >= 1.88
ci: switch Linux arm64 to native ubuntu-22.04-arm runner
-
Create the directory structure:
pallets/pallet-your-pallet/ ├── Cargo.toml └── src/ └── lib.rs -
Cargo.tomltemplate:[package] name = "pallet-your-pallet" version = "0.1.0" edition = "2021" [dependencies] frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } parity-scale-codec = { workspace = true } scale-info = { workspace = true } [features] default = ["std"] std = [ "frame-support/std", "frame-system/std", "sp-runtime/std", "parity-scale-codec/std", "scale-info/std", ]
-
Add to root
Cargo.tomlworkspace members -
Add to
runtime/Cargo.tomldependencies -
Implement
Configand add toconstruct_runtime!inruntime/src/lib.rs
- Do not add new dependencies without a clear reason
- Prefer dependencies already in the Substrate SDK workspace
- All new dependencies must be pinned to a specific version or compatible range
- Avoid
gitdependencies (use crates.io versions where possible)
Open a GitHub Issue with:
- A clear title describing the problem
- Steps to reproduce
- Expected vs actual behavior
- Rust version (
rustc --version) and OS - Node version (
./tks-chain-node --version) - Relevant logs or error output
For security vulnerabilities, do not open a public GitHub Issue. See Security for responsible disclosure.