π Introduction
Ever wanted to create your own lightweight blockchain in minutes? Thanks to Pocket Network's open-source Shannon SDK, it's now possible to build a fully working blockchain for education, prototyping, or specialized apps β all in JavaScript/TypeScript.
In this guide, weβll show you how to:
- Initialize a new blockchain locally
- Customize its logic using JS
- Broadcast transactions and view block behavior
π§° Prerequisites
Before starting, make sure you have:
- Node.js (v18+)
- Git installed
- Basic familiarity with JavaScript or TypeScript
βοΈ Step 1: Install the Shannon CLI
Install the global CLI tool:
bash
npm install -g @pokt-foundation/shannon-cli
Check installation:
bash
Copy
Edit
shannon --version
π Step 2: Initialize Your Blockchain
bash
Copy
Edit
shannon init my-chain
cd my-chain
This creates a scaffold project with the following structure:
arduino
Copy
Edit
my-chain/
βββ app/ β Your custom logic
βββ config/ β Chain configuration
βββ scripts/ β Dev tools
βββ .shannonrc β CLI settings
βΆοΈ Step 3: Start the Dev Node
bash
Copy
Edit
shannon dev
This launches a local node that watches your code and reloads on save. You'll see logs of block processing and transaction handling.
π Hot reloading included out-of-the-box!
βοΈ Step 4: Write Custom Logic
Letβs update app/index.ts to handle custom transactions:
ts
Copy
Edit
export const app = {
async deliverTx(tx: Uint8Array) {
const decoded = new TextDecoder().decode(tx);
console.log("π§Ύ Received tx:", decoded);
return { code: 0 };
}
}
Every time a transaction is received, it will decode and log it.
π‘ Step 5: Broadcast a Transaction
Send a transaction using curl or Postman:
bash
Copy
Edit
curl -X POST http://localhost:26658 \
-d '{"jsonrpc":"2.0","method":"broadcast_tx_sync","params":["0x48656c6c6f205368616e6e6f6e21"],"id":1}' \
-H "Content-Type: application/json"
In your terminal, you'll see:
yaml
Copy
Edit
π§Ύ Received tx: Hello Shannon!
π§ How It Works β Visual Guide
Hereβs a simple architecture diagram:
Your app logic acts as a handler for each stage:
checkTx(): validate before block inclusion
deliverTx(): execute on block commit
initChain(), endBlock(), etc.: manage state transitions
β
Why Shannon?
Shannon SDK is great for:
Learning how blockchains handle transactions
Rapid prototyping for Web3 apps
Creating blockchain-based games, voting apps, etc.
Instead of deploying a heavy Ethereum or Cosmos chain, you can simulate behavior in a fast and lightweight setup.
π Resources
π Shannon SDK GitHub
π Official Docs
π§ Pocket Network
π οΈ Tendermint Core
π¬ Share Your Ideas!
Have you tried Shannon? Got a cool use case or ran into issues? Leave a comment below β let's explore lightweight blockchain apps together!

Top comments (0)