Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/kaspawallet/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"
)

const daemonTimeout = 2 * time.Minute
const daemonTimeout = 5 * time.Minute

func printErrorAndExit(err error) {
fmt.Fprintf(os.Stderr, "%s\n", err)
Expand Down
10 changes: 9 additions & 1 deletion cmd/kaspawallet/daemon/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/pkg/errors"

"github.com/kaspanet/kaspad/cmd/kaspawallet/daemon/pb"
"github.com/kaspanet/kaspad/cmd/kaspawallet/daemon/server"
"google.golang.org/grpc"
)

Expand All @@ -16,7 +17,14 @@ func Connect(address string) (pb.KaspawalletdClient, func(), error) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()

conn, err := grpc.DialContext(ctx, address, grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(
ctx, address,
grpc.WithInsecure(),
grpc.WithBlock(),
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(server.MaxDaemonMsgSize),
grpc.MaxCallSendMsgSize(server.MaxDaemonMsgSize)))

if err != nil {
if errors.Is(err, context.DeadlineExceeded) {
return nil, nil, errors.New("kaspawallet daemon is not running, start it with `kaspawallet start-daemon`")
Expand Down
8 changes: 7 additions & 1 deletion cmd/kaspawallet/daemon/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ import (
"google.golang.org/grpc"
)

// MaxDaemonMsgSize is the max send/receive message size used for the daemon client and server.
// Currently, set to 100MB
const MaxDaemonMsgSize = 100_000_000

type server struct {
pb.UnimplementedKaspawalletdServer

Expand Down Expand Up @@ -96,7 +100,9 @@ func Start(params *dagconfig.Params, listen, rpcServer string, keysFilePath stri
}
})

grpcServer := grpc.NewServer()
grpcServer := grpc.NewServer(
grpc.MaxRecvMsgSize(MaxDaemonMsgSize),
grpc.MaxSendMsgSize(MaxDaemonMsgSize))
pb.RegisterKaspawalletdServer(grpcServer, serverInstance)

spawn("grpcServer.Serve", func() {
Expand Down