Address comments
This commit is contained in:
@@ -29,7 +29,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/wallet"
|
||||
ledgerwallet "github.com/filecoin-project/lotus/chain/wallet/ledger"
|
||||
"github.com/filecoin-project/lotus/chain/wallet/remotewallet"
|
||||
consensus2 "github.com/filecoin-project/lotus/lib/consensus/raft"
|
||||
raftcns "github.com/filecoin-project/lotus/lib/consensus/raft"
|
||||
"github.com/filecoin-project/lotus/lib/peermgr"
|
||||
"github.com/filecoin-project/lotus/markets/retrievaladapter"
|
||||
"github.com/filecoin-project/lotus/markets/storageadapter"
|
||||
@@ -244,8 +244,8 @@ func ConfigFullNode(c interface{}) Option {
|
||||
// Chain node cluster enabled
|
||||
If(cfg.Cluster.ClusterModeEnabled,
|
||||
Override(new(*gorpc.Client), modules.NewRPCClient),
|
||||
Override(new(*consensus2.ClusterRaftConfig), consensus2.NewClusterRaftConfig(&cfg.Cluster)),
|
||||
Override(new(*consensus2.Consensus), consensus2.NewConsensusWithRPCClient(false)),
|
||||
Override(new(*raftcns.ClusterRaftConfig), raftcns.NewClusterRaftConfig(&cfg.Cluster)),
|
||||
Override(new(*raftcns.Consensus), raftcns.NewConsensusWithRPCClient(false)),
|
||||
Override(new(*messagesigner.MessageSignerConsensus), messagesigner.NewMessageSignerConsensus),
|
||||
Override(new(messagesigner.MsgSigner), From(new(*messagesigner.MessageSignerConsensus))),
|
||||
Override(new(*modules.RPCHandler), modules.NewRPCHandler),
|
||||
|
||||
@@ -603,7 +603,7 @@ type FeeConfig struct {
|
||||
}
|
||||
|
||||
type UserRaftConfig struct {
|
||||
// config to enabled node cluster with raft consensus
|
||||
// EXPERIMENTAL. config to enabled node cluster with raft consensus
|
||||
ClusterModeEnabled bool
|
||||
// will shutdown libp2p host on shutdown. Useful for testing
|
||||
HostShutdown bool
|
||||
@@ -629,10 +629,6 @@ type UserRaftConfig struct {
|
||||
BackupsRotate int
|
||||
// Namespace to use when writing keys to the datastore
|
||||
DatastoreNamespace string
|
||||
|
||||
// A Hashicorp Raft's configuration object.
|
||||
//RaftConfig *hraft.Config
|
||||
|
||||
// Tracing enables propagation of contexts across binary boundaries.
|
||||
Tracing bool
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ type RaftAPI struct {
|
||||
|
||||
func (r *RaftAPI) GetRaftState(ctx context.Context) (*api.RaftStateData, error) {
|
||||
if r.MessageSigner == nil {
|
||||
return nil, xerrors.Errorf("Raft consensus not enabled. Please check your configuration")
|
||||
return nil, xerrors.Errorf("raft consensus not enabled. Please check your configuration")
|
||||
}
|
||||
raftState, err := r.MessageSigner.GetRaftState(ctx)
|
||||
if err != nil {
|
||||
@@ -30,7 +30,7 @@ func (r *RaftAPI) GetRaftState(ctx context.Context) (*api.RaftStateData, error)
|
||||
|
||||
func (r *RaftAPI) Leader(ctx context.Context) (peer.ID, error) {
|
||||
if r.MessageSigner == nil {
|
||||
return "", xerrors.Errorf("Raft consensus not enabled. Please check your configuration")
|
||||
return "", xerrors.Errorf("raft consensus not enabled. Please check your configuration")
|
||||
}
|
||||
return r.MessageSigner.Leader(ctx)
|
||||
}
|
||||
@@ -44,7 +44,7 @@ func (r *RaftAPI) IsLeader(ctx context.Context) bool {
|
||||
|
||||
func (r *RaftAPI) RedirectToLeader(ctx context.Context, method string, arg interface{}, ret interface{}) (bool, error) {
|
||||
if r.MessageSigner == nil {
|
||||
return false, xerrors.Errorf("Raft consensus not enabled. Please check your configuration")
|
||||
return false, xerrors.Errorf("raft consensus not enabled. Please check your configuration")
|
||||
}
|
||||
return r.MessageSigner.RedirectToLeader(ctx, method, arg, ret)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user