Skip to content

faruk-guler/SansaNet

Repository files navigation

SansaNet 🌿 Peer to Peer Open or Secret Chain Project

SansaNet Trilemma

Overview

SansaNet is a decentralized peer-to-peer blockchain project aiming to solve the blockchain trilemma while providing a suite of decentralized services. It features a custom-built blockchain core, P2P networking with reconnection logic, and a proof-of-concept decentralized storage system.

Project Structure

  • src/core/: Core blockchain logic (Chain, Block, Transaction).
  • src/network/: P2P networking and node management.
  • src/wallet/: Wallet creation and key management.
  • src/web/: Flask-based web interface for interacting with the node.
  • docs/: Documentation and architecture diagrams.

Getting Started

Prerequisites

  • Python 3.8+
  • pip install -r requirements.txt

Installation

  1. Clone the repository.

  2. Install dependencies:

    pip install -r requirements.txt

Running the Network

To simulate a small network, you can run multiple nodes on different ports.

Node 1 (Genesis Node):

python run_node.py 5000

Node 2 (Peer):

python run_node.py 5001 5000

This starts Node 2 on port 5001 and connects it to Node 1 on port 5000.

Running the Web Interface

The web interface allows you to view the chain, mine blocks, and upload files.

python src/web/server.py

By default, this runs on http://localhost:5000 and connects to a backend P2P node on port 6000.

API Endpoints

  • GET /api/chain: View the current blockchain.
  • POST /api/mine: Mine a new block (triggers pending transactions).
  • POST /api/transact: Create a new transaction (requires sender, receiver, amount).
  • GET /api/balance/<address>: Check the balance of an address.
  • POST /api/storage/upload: Upload a file to be chunked and distributed to peers.

Features

  • Decentralized Finance (DeFi): Basic coin transfers.
  • Decentralized Storage: Shreds files into chunks and distributes them across the network.
  • Consensus: Proof of Work (PoW).

Contributing

We welcome contributions! Please see our contribution guidelines (coming soon).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors