tailscale/tsconsensus/bolt_store.go
Fran Bull c9a5d638e9 tsconsensus: enable writing state to disk
The comments in the raft code say to only use the InMemStore for tests.

Updates #16027

Signed-off-by: Fran Bull <fran@tailscale.com>
2025-05-30 13:59:25 -07:00

20 lines
403 B
Go

// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
//go:build !loong64
package tsconsensus
import (
"github.com/hashicorp/raft"
raftboltdb "github.com/hashicorp/raft-boltdb/v2"
)
func boltStore(path string) (raft.StableStore, raft.LogStore, error) {
store, err := raftboltdb.NewBoltStore(path)
if err != nil {
return nil, nil, err
}
return store, store, nil
}