Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions docs/CODE-DOC-TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# CODE-DOC-TEMPLATE.md — Xode Blockchain Documentation

## Project Overview
- **Bounty:** Xode-DAO/xode-blockchain #85 — Wiki to GitHub Docs Migration ($1,000)
- **Framework:** Docusaurus v3
- **Status:** Complete — ready for review

## What Was Done
1. Migrated all content from wiki.xode.net (now defunct), GitHub Wiki, repo READMEs, and xode.net website
2. Built a complete Docusaurus v3 documentation site with 17 pages across 6 categories
3. Structured navigation sidebar, cross-references, and search-ready configuration
4. Xode branding (Polkadot-pink theme, dark mode support)
5. Contribution guide with style guidelines

## Content Sources
| Source | Content Migrated |
|--------|-----------------|
| GitHub Wiki (XODE-Network.md) | Network architecture, Parachain, Collators, Validators |
| Repo README.md | Smart Contracts, Asset Hub, Staking, Governance, Block Scanner |
| runtime/README.md | Runtime configuration, Polkadot SDK version |
| pallets/README.md | Pallet development guide, weight generation |
| pallets/staking/README.md | Staking tests and commands |
| node/README.md | Node setup information |
| xode.net website | Tokenomics, coin distribution, foundation info, wallets |

## Directory Structure
```
xode-docs/
├── docusaurus.config.js # Site configuration
├── sidebars.js # Navigation sidebar
├── package.json # Dependencies
├── README.md # Contribution guide
├── CODE-DOC-TEMPLATE.md # This file
├── docs/ # 17 documentation pages
│ ├── intro.md
│ ├── getting-started/ # Overview, Wallets
│ ├── network/ # Architecture, Parachain, Collators, Validators
│ ├── development/ # Smart Contracts, Pallets, Runtime, Node Setup
│ ├── tokenomics/ # Overview, Distribution, Staking
│ ├── governance/ # Foundation, Treasury
│ └── ecosystem/ # Asset Hub, Block Scanner, Bridges
├── static/img/ # Logo, favicon, social card
└── src/css/custom.css # Xode branding
```

## How to Run Locally
```bash
npm install
npm start
```

## How to Deploy
```bash
npm run build
# Deploy static output from build/ to GitHub Pages or any static host
```

## Quality Checklist
- [x] All wiki content migrated
- [x] Markdown formatting clean and consistent
- [x] Frontmatter on every page (title, description, sidebar_position)
- [x] Cross-references between related pages
- [x] Navigation sidebar with proper hierarchy
- [x] README with contribution guide
- [x] Docusaurus builds without errors
- [x] Static assets (favicon, social card, logo)
82 changes: 82 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Xode Blockchain Documentation

Official documentation for [Xode Blockchain](https://xode.net) — the Philippines' first L1 blockchain on Polkadot.

Built with [Docusaurus 3](https://docusaurus.io/).

## Quick Start

```bash
# Install dependencies
npm install

# Start development server
npm start
```

The site will be available at `http://localhost:3000`.

## Build

```bash
# Production build
npm run build

# Serve locally
npm run serve
```

## Project Structure

```
xode-docs/
├── docs/ # Documentation pages (Markdown)
│ ├── intro.md # Welcome page
│ ├── getting-started/ # Overview & wallets
│ ├── network/ # Architecture, parachains, collators, validators
│ ├── development/ # Smart contracts, pallets, runtime, node setup
│ ├── tokenomics/ # XON token, distribution, staking
│ ├── governance/ # Foundation DAO, treasury, committees
│ └── ecosystem/ # Asset hub, block scanner, bridges
├── src/css/ # Custom theme styles
├── static/img/ # Images and logos
├── docusaurus.config.js # Site configuration
├── sidebars.js # Sidebar navigation
└── package.json
```

## Contributing

1. **Fork** this repository
2. **Create a branch** for your changes: `git checkout -b docs/my-improvement`
3. **Edit** the relevant Markdown files in `docs/`
4. **Preview** your changes locally with `npm start`
5. **Submit** a pull request

### Style Guide

- Use **sentence case** for headings (e.g., "Network architecture" not "Network Architecture") — except for proper nouns
- Include **frontmatter** (title, description, sidebar_position) on every page
- Use **internal links** between docs pages (e.g., `[staking](/tokenomics/staking)`)
- Add **code blocks** with language identifiers (e.g., ` ```rust `)
- Keep paragraphs concise and scannable
- Use tables for structured data comparisons

### Adding a New Page

1. Create a `.md` file in the appropriate `docs/` subdirectory
2. Add frontmatter with `title`, `description`, and `sidebar_position`
3. Add the page to `sidebars.js`
4. Link to it from related pages

## License

This documentation is maintained by the [Xode Foundation](https://xode.net) under the Xode-DAO organization.

## Links

- [Xode Website](https://xode.net)
- [GitHub Repository](https://github.com/Xode-DAO/xode-blockchain)
- [Block Scanner](https://node.xode.net/)
- [Discord](https://discord.gg/V6DETUY7Cy)
- [Twitter/X](https://x.com/XodeNet)
117 changes: 117 additions & 0 deletions docs/docs/development/node-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: Running a Node
description: How to set up and run a Xode Blockchain node — full node, collator, or development node.
sidebar_position: 4
---

# Running a Node

This guide covers setting up a Xode Blockchain node. Whether you want to run a full node for querying data, a collator for block production, or a local development node for testing.

## Release Version

Xode nodes are built on **Polkadot SDK stable2409**.

## Prerequisites

### System Requirements

| Component | Minimum | Recommended |
|-----------|---------|-------------|
| CPU | 4 cores | 8+ cores |
| RAM | 8 GB | 16+ GB |
| Storage | 100 GB SSD | 500+ GB NVMe SSD |
| Network | 100 Mbps | 1 Gbps |

### Software Dependencies

```bash
# Ubuntu/Debian
sudo apt update && sudo apt install -y \
build-essential \
clang \
curl \
git \
libssl-dev \
llvm \
pkg-config \
protobuf-compiler

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env

# Add Wasm target
rustup target add wasm32-unknown-unknown
```

## Building from Source

```bash
# Clone the repository
git clone https://github.com/Xode-DAO/xode-blockchain.git
cd xode-blockchain

# Build in release mode
cargo build --release
```

The compiled binary will be available at `./target/release/xode-blockchain`.

## Running a Full Node

Connect to the Xode network as a full (non-producing) node:

```bash
./target/release/xode-blockchain \
--chain xode \
--name "my-xode-node" \
--pruning archive \
--rpc-cors all
```

## Running a Development Node

For local testing and development:

```bash
./target/release/xode-blockchain \
--dev \
--tmp \
--rpc-cors all
```

This starts a single-node development chain with pre-funded accounts.

## Running a Collator

To run a collator node that produces blocks:

```bash
./target/release/xode-blockchain \
--chain xode \
--name "my-collator" \
--collator \
--rpc-cors all \
-- \
--chain polkadot
```

:::note
Running a collator requires staking XON tokens and being registered in the collator set. See [Staking](/tokenomics/staking) and [Collators](/network/collators) for details.
:::

## RPC Endpoints

If you don't want to run your own node, use the public RPC endpoints:

| Network | Endpoint |
|---------|----------|
| Kusama | `wss://rpcnodea01.xode.net/n7yoxCmcIrCF6VziCcDmYTwL8R03a/rpc` |
| Polkadot | `wss://polkadot-rpcnode.xode.net` |

## Further Reading

- [Collators](/network/collators) — Block production role
- [Runtime](/development/runtime) — Understanding the runtime
- [Custom Pallets](/development/pallets) — Developing for Xode
90 changes: 90 additions & 0 deletions docs/docs/development/pallets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
title: Custom Pallets
description: Guide to developing and benchmarking custom pallets for the Xode Blockchain runtime.
sidebar_position: 2
---

# Custom Pallets

Pallets are the modular building blocks of the Xode runtime. Each pallet encapsulates a specific piece of blockchain logic — from staking and governance to asset management and smart contracts.

## Pallet Development

Xode's pallets are built on **Polkadot SDK stable2409**. For a comprehensive introduction to pallet development, refer to these resources:

- [Your First Pallet](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html) — Official Polkadot SDK guide
- [Substrate in Bits](https://polkadot.study/tutorials/substrate-in-bits/) — Community tutorials
- [Polkadot SDK stable2409](https://github.com/paritytech/polkadot-sdk/tree/stable2409) — Source code

## Xode Custom Pallets

Xode includes several custom pallets beyond the standard Substrate framework:

| Pallet | Purpose |
|--------|---------|
| `pallet-xode-staking` | Custom delegated proof-of-stake with collator and delegator rewards |
| `pallet-assets` | Fungible token creation and management |
| `pallet-contracts` | ink!/Wasm smart contract execution |
| Governance pallets | Treasury Council and Technical Committee |

## Generating Weights

Runtime weights ensure that extrinsics are properly benchmarked for execution time and resource usage. To generate weights for a pallet:

```bash
cargo run --release --features runtime-benchmarks -- \
--benchmark pallet \
--execution=wasm \
--wasm-execution=compiled \
--heap-pages=4096 \
--pallet pallet-xode-staking \
--extrinsic "*" \
--steps 50 \
--repeat 20 \
--output ./pallets/staking/src/weights.rs \
--template ./pallets/staking/src/weight-template.hbs
```

### Key Parameters

| Parameter | Description |
|-----------|-------------|
| `--pallet` | Target pallet to benchmark |
| `--extrinsic "*"` | Benchmark all extrinsics |
| `--steps` | Number of steps in the benchmark range |
| `--repeat` | Number of repetitions per step |
| `--output` | Where to write the generated weights file |
| `--template` | Handlebars template for weight formatting |

## Testing Pallets

### Running Unit Tests

```bash
# Test a specific pallet
cargo test --package pallet-xode-staking

# Run from the pallet source directory
cd pallets/staking/src
cargo test tests
cargo test tests_calls
```

### Pallet Unit Testing Guide

For comprehensive testing guidance, refer to the [Polkadot SDK Testing Tutorial](https://docs.polkadot.com/tutorials/polkadot-sdk/parachains/zero-to-hero/pallet-unit-testing/).

## Contributing a New Pallet

1. Create your pallet in `pallets/your-pallet/`
2. Follow the [Open Source Guidelines](https://opensource.guide/)
3. Add benchmarks and generate weights
4. Write comprehensive unit tests
5. Integrate into the [runtime](/development/runtime)
6. Submit a pull request to [Xode-DAO/xode-blockchain](https://github.com/Xode-DAO/xode-blockchain)

## Further Reading

- [Runtime](/development/runtime) — How pallets compose the runtime
- [Smart Contracts](/development/smart-contracts) — Building dApps on Xode
- [Staking](/tokenomics/staking) — The staking pallet in detail
Loading