Skip to content

whisky81/blockchain-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain CLI

Simple Blockchain Command Line Interface

demo

📝 Features

  • ⩩ SHA256
  • 📦 Block: Index, Previous Hash, Timestamp, Data, Nonce, Hash
  • ⛓️🧱 In memory array to store blockchain
  • ⛏️ Proof Of Work
  • 💻↔️💻 Local Peer to Peer Network
  • 📜 Allow viewing event and protocol log entries

    ⚠️ Note: Data in the block is of type string.

🚀 Installation

⚙️ Requirements

  • Node.js ≥ v22
  • NPM ≥ v11
  • Git

📥 Steps

# 1. Clone the repository
git clone https://github.com/whisky81/blockchain-cli.git

# 2. Navigate into the project folder
cd blockchain-cli

# 3. Install dependencies
npm install

# 4. Build and run the app
npm run build
npm run dev

🧪 CLI Testing (Unix-like systems)

# Link the CLI globally for local testing
npm run link-cli

# Now you can run the CLI directly
blockchain

🛠️ Built With

🙏 Acknowledgements

📖 Part of the code and ideas were referenced from
https://github.com/0xs34n/blockchain

🐘⚙️📄 Libp2p configuration object

const config = {
  addresses: {
    listen: ["/ip4/0.0.0.0/tcp/0", "/ip4/0.0.0.0/tcp/0/ws"],
  },
  transports: [tcp(), webSockets()],
  streamMuxers: [yamux()],
  connectionEncrypters: [noise()],
  peerDiscovery: [mdns({ interval: 2000 })],
};

About

Simple Blockchain Command Line Interface

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors