func (n *RavelNode) Get(key []byte) ([]byte, error) {
	if n.Raft.State() != raft.Leader {
		log.Println("RavelNode: Request sent to non leading replica")
		return []byte{}, raft.ErrNotLeader
	}
	return n.Fsm.Get(key)
}
Get returns the value for the given key
package node
import (
	"encoding/json"
	"log"
	"net"
	"os"
	"time"
	"github.com/adityameharia/ravel/fsm"
	"github.com/adityameharia/ravel/store"
	"github.com/hashicorp/raft"
)
type RavelNode struct {
	Fsm  *fsm.RavelFSM
	Raft *raft.Raft
}
func (n *RavelNode) Open(enableSingle bool, localID string, badgerPath string, BindAddr string) (*raft.Raft, *fsm.RavelFSM, error) {
	log.Println(enableSingle)
	log.Println("RavelNode: Opening node")
	var raftNode RavelNode
	config := raft.DefaultConfig()
	config.LocalID = raft.ServerID(localID)
	log.Println(config)
	addr, err := net.ResolveTCPAddr("tcp", BindAddr)
	if err != nil {
		log.Fatal("RavelNode: Unable to resolve TCP Bind Address")
		return nil, nil, err
	}
	log.Println(addr)
	transport, err := raft.NewTCPTransport(BindAddr, addr, 5, 2*time.Second, os.Stderr)
	if err != nil {
		log.Println(err)
		log.Fatal("RavelNode: Unable to create NewTCPTransport")
		return nil, nil, err
	}
	snapshot, err := raft.NewFileSnapshotStore(badgerPath+"/snapshot", 1, os.Stderr)
	if err != nil {
		log.Fatal("RavelNode: Unable to create SnapShot store")
		return nil, nil, err
	}
	var logStore raft.LogStore
	var stableStore raft.StableStore
	logStore, err = store.NewRavelLogStore(badgerPath + "/logs")
	if err != nil {
		log.Fatal("RavelNode: Unable to create Log store")
		return nil, nil, err
	}
	f, err := fsm.NewFSM(badgerPath + "/fsm")
	if err != nil {
		log.Fatal("RavelNode: Unable to create FSM")
		return nil, nil, err
	}
	stableStore, err = store.NewRavelStableStore(badgerPath + "/stable")
	if err != nil {
		log.Fatal("RavelNode: Unable to create Stable store")
		return nil, nil, err
	}
	raftNode.Fsm = f
	r, err := raft.NewRaft(config, f, logStore, stableStore, snapshot, transport)
	if err != nil {
		log.Println(err)
		log.Fatal("RavelNode: Unable initialise raft node")
		return nil, nil, err
	}
	raftNode.Raft = r
	if enableSingle {
		configuration := raft.Configuration{
			Servers: []raft.Server{
				{
					ID:      config.LocalID,
					Address: transport.LocalAddr(),
				},
			},
		}
		r.BootstrapCluster(configuration)
	}
	return r, f, nil
}