Categorygithub.com/cnnrznn/raft
modulepackage
1.0.0
Repository: https://github.com/cnnrznn/raft.git
Documentation: pkg.go.dev

# README

raft

Raft is a consensus protocol for a cluster of peers to maintain a replicated log. Raft is a crash fault tolerant (CFT) protocol; i.e. machines can fail by crashing or network partition, but are NOT malicious (byzantine). Peers follow the protocol.

Usage

httpraft

  1. Clone https://github.com/cnnrznn/raft-postman for a postman collection designed for use with /cmd/httpraft
  2. Build the httpraft binary
    cd cmd/httpraft
    go build
    
  3. Create a config file defining the network, such as
    {
        "peers": [
            "localhost:8000",
            "localhost:8001",
            "localhost:8002"
        ],
        "apis": [
            "localhost:9000",
            "localhost:9001",
            "localhost:9002"
        ]
    }
    
    Place this file in the working directory from which you'll run ./httpraft
  4. Run ./httpraft <id> where id is the index in peers and apis the node will listen.
  5. Point the leader environment variable in the postman collection to one of of the apis addresses.

Current Status

I am currently in the process of implementing the protocol. Here is the list of tasks:

  • Leader election protocol
  • Log append protocol
  • Module interface for Go clients
  • Http REST interface for Web clients

I am implementing the protocol as a go module. I will write instructions later for installing and using the module in your go program. I am also implementing a runnable binary that will accept requests (appends) and reads from the log via HTTP REST endpoints.

Out of scope

  • Membership changes
  • Persistence
  • Log compaction

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
Entry
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author