Skip to content

DiegoCastro-R/go-blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages