@@ -13,6 +13,7 @@ import (
1313 "github.com/Jille/raft-grpc-leader-rpc/leaderhealth"
1414 transport "github.com/Jille/raft-grpc-transport"
1515 "github.com/Jille/raftadmin"
16+ internalutil "github.com/bootjp/elastickv/internal"
1617 "github.com/bootjp/elastickv/kv"
1718 pb "github.com/bootjp/elastickv/proto"
1819 "github.com/bootjp/elastickv/store"
@@ -23,7 +24,6 @@ import (
2324 "github.com/stretchr/testify/require"
2425 "golang.org/x/sys/unix"
2526 "google.golang.org/grpc"
26- "google.golang.org/grpc/credentials/insecure"
2727)
2828
2929func shutdown (nodes []Node ) {
@@ -350,7 +350,7 @@ func setupNodes(t *testing.T, ctx context.Context, n int, ports []portsAdress) (
350350 r , tm , err := newRaft (strconv .Itoa (i ), port .raftAddress , fsm , i == 0 , cfg , electionTimeout )
351351 assert .NoError (t , err )
352352
353- s := grpc .NewServer ()
353+ s := grpc .NewServer (internalutil . GRPCServerOptions () ... )
354354 trx := kv .NewTransaction (r )
355355 coordinator := kv .NewCoordinator (trx , r )
356356 relay := NewRedisPubSubRelay ()
@@ -416,9 +416,7 @@ func newRaft(myID string, myAddress string, fsm raft.FSM, bootstrap bool, cfg ra
416416 Level : hclog .LevelFromString ("WARN" ),
417417 })
418418
419- tm := transport .New (raft .ServerAddress (myAddress ), []grpc.DialOption {
420- grpc .WithTransportCredentials (insecure .NewCredentials ()),
421- })
419+ tm := transport .New (raft .ServerAddress (myAddress ), internalutil .GRPCDialOptions ())
422420
423421 r , err := raft .NewRaft (c , fsm , ldb , sdb , fss , tm .Transport ())
424422 if err != nil {
0 commit comments