go-blockchain

command module
v0.0.0-...-9bf9bed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 3 Imported by: 0

README

Go Blockchain with Redis and LevelDB

This is a simple implementation of a blockchain in Go, with Redis for inter-client communication and LevelDB for local persistence.

Features

  • Blockchain: Implements a basic blockchain structure with blocks containing an index, previous hash, current hash, timestamp, and data.
  • Genesis Block: Automatically creates a genesis block when the blockchain is first initialized.
  • Persistence with LevelDB: Persists blockchain data locally using LevelDB.
  • Communication with Redis: Uses Redis to broadcast new blocks to connected clients.

Requirements

  • Go installed on your machine.
  • Redis server running (update connection details in blockchain.go).
  • LevelDB Go Package.

Getting Started

  1. Clone the repository:

    git clone <repository-url>
    cd go-blockchain
    
    
  2. Install dependencies:

    go get -u github.com/go-redis/redis/v8
    go get -u github.com/syndtr/goleveldb/leveldb
    
    
  3. Run the main program:

    go run main.go
    
    

Configuration

  • Update the Redis connection details in blockchain.go if your Redis server is running on a different address.
  • Adjust LevelDB settings based on your requirements.

Contributing

  • Contributions are welcome! Please create a new branch for your changes and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Overview

main.go

Directories

Path Synopsis
blockchain.go
blockchain.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL