This project is a high-performance blockchain network developed using Golang. The network supports multiple nodes, uses a secure Proof-of-Work (PoW) consensus mechanism, ECC for key generation, and SHA-256 for block hashing.
- Supports multiple nodes for enhanced scalability and performance.
- Secure PoW consensus mechanism for block validation.
- Utilizes ECC for secure key generation and SHA-256 for block hashing.
- Users can create wallets, securely generate public/private key pairs and participate in mining activities.
- The network can facilitate Y transactions per second, optimized for real-time usability.
- Seamless interaction with the blockchain network through an integrated blockchain explorer for real-time visualization of the blockchain ledger.
- GRPC and Protobuf for efficient internal service communication and secure gateway for external communication.
-
Blockchain Service
- Handles core blockchain operations
- Implements Proof-of-Work (PoW) consensus
- Manages block creation and validation
- Handles peer-to-peer network synchronization
- Ports:
- gRPC Server: 7000 (default)
- Gateway/HTTP Server: 7070 (default)
-
Wallet Service
- Manages wallet operations
- Handles key pair generation using ECC
- Manages transaction creation and signing
- Ports:
- gRPC Server: 5000 (default)
- Gateway/HTTP Server: 5050 (default)
- Consensus: Proof-of-Work (PoW) mechanism
- Cryptography:
- ECC for key generation
- SHA-256 for block hashing
- Network Protocol:
- gRPC for internal service communication
- REST API gateway for external access
- Data Storage: Persistent blockchain storage
- User Interface: Web-based blockchain explorer and transaction viewer
- Gateway Server (default: 7070)
/explorer- Blockchain explorer UI/transactions- Transaction viewer UI/hello-world- Health check endpoint/- REST API endpoint
- Gateway Server (default: 5050)
/index- Wallet management UI/hello-world- Health check endpoint/- REST API endpoint
bch-grpcport must be between 7000 and 7003wal-grpcport must be between 5000 and 5003bch-gatewayport must be between 5050 and 5053- the terms "neighbors" and "peers" are used interchangeably in the context of the project.
- First, clone the repository:
git clone github.com/zde37/Zero-Chain- Navigate to the project directory:
cd Zero-Chain- install the dependencies:
go mod tidy- Spin up the first node with default settings:
go run main.go- Spin up other nodes:
go run main.go --bch-grpc=<USE_PORT_OF_CHOICE> --wal-grpc=<USE_PORT_OF_CHOICE> --wal-gateway=<USE_PORT_OF_CHOICE>- --bch-grpc: Blockchain gRPC server port (default: 7000)
- --bch-gateway: Blockchain HTTP/Gateway server port (default: 7070)
- --bch-host: Blockchain server host (default: 127.0.0.1)
- --wal-grpc: Wallet gRPC server port (default: 5000)
- --wal-gateway: Wallet HTTP/Gateway server port (default: 5050)
- Blockchain Explorer UI: http://localhost:7070/explorer
- Transactions UI: http://localhost:7070/transactions
- Wallet UI: http://localhost:5050/index
- Health check endpoints: http://localhost:7070/hello-world and http://- localhost:5050/hello-world
- Start the blockchain service
- Begin syncing with neighbor nodes
- Resolve any blockchain conflicts
- Start the mining process
- Make all services available via both gRPC and REST APIs