Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/Miningcore/Blockchain/Kaspa/KaspaClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Miningcore.Blockchain.Kaspa;

public static class KaspaClientFactory
{
public static kaspad.KaspadRPC.KaspadRPCClient CreateKaspadRPCClient(DaemonEndpointConfig[] daemonEndpoints, string protobufDaemonRpcServiceName)
public static kaspad.RPC.RPCClient CreateKaspadRPCClient(DaemonEndpointConfig[] daemonEndpoints, string protobufDaemonRpcServiceName)
{
var daemonEndpoint = daemonEndpoints.First();

Expand Down Expand Up @@ -44,7 +44,7 @@ public static kaspad.KaspadRPC.KaspadRPCClient CreateKaspadRPCClient(DaemonEndpo
MaxSendMessageSize = 2097152 // 2MB
});

return new kaspad.KaspadRPC.KaspadRPCClient(new kaspad.KaspadRPC(protobufDaemonRpcServiceName), channel);
return new kaspad.RPC.RPCClient(channel);
}

public static kaspaWalletd.KaspaWalletdRPC.KaspaWalletdRPCClient CreateKaspaWalletdRPCClient(DaemonEndpointConfig[] daemonEndpoints, string protobufWalletRpcServiceName)
Expand Down
24 changes: 12 additions & 12 deletions src/Miningcore/Blockchain/Kaspa/KaspaJobManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public KaspaJobManager(
private DaemonEndpointConfig[] daemonEndpoints;
private DaemonEndpointConfig[] walletDaemonEndpoints;
private KaspaCoinTemplate coin;
private kaspad.KaspadRPC.KaspadRPCClient rpc;
private kaspad.RPC.RPCClient rpc;
private kaspaWalletd.KaspaWalletdRPC.KaspaWalletdRPCClient walletRpc;
private string network;
private readonly List<KaspaJob> validJobs = new();
Expand Down Expand Up @@ -82,11 +82,11 @@ public KaspaJobManager(
var streamNotifyNewBlockTemplate = rpc.MessageStream(null, null, cts.Token);

// we need a request for subscribing to NotifyNewBlockTemplate
var requestNotifyNewBlockTemplate = new kaspad.KaspadMessage();
var requestNotifyNewBlockTemplate = new kaspad.KaspadRequest();
requestNotifyNewBlockTemplate.NotifyNewBlockTemplateRequest = new kaspad.NotifyNewBlockTemplateRequestMessage();

// we need a request for retrieving BlockTemplate
var requestBlockTemplate = new kaspad.KaspadMessage();
var requestBlockTemplate = new kaspad.KaspadRequest();
requestBlockTemplate.GetBlockTemplateRequest = new kaspad.GetBlockTemplateRequestMessage
{
PayAddress = poolConfig.Address,
Expand Down Expand Up @@ -435,7 +435,7 @@ private async Task UpdateNetworkStatsAsync(CancellationToken ct)
// we need a stream to communicate with Kaspad
var stream = rpc.MessageStream(null, null, ct);

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.EstimateNetworkHashesPerSecondRequest = new kaspad.EstimateNetworkHashesPerSecondRequestMessage
{
WindowSize = 1000,
Expand All @@ -449,7 +449,7 @@ private async Task UpdateNetworkStatsAsync(CancellationToken ct)
break;
}

request = new kaspad.KaspadMessage();
request = new kaspad.KaspadRequest();
request.GetConnectedPeerInfoRequest = new kaspad.GetConnectedPeerInfoRequestMessage();
await stream.RequestStream.WriteAsync(request);
await foreach (var info in stream.ResponseStream.ReadAllAsync(ct))
Expand All @@ -473,7 +473,7 @@ private async Task ShowDaemonSyncProgressAsync(CancellationToken ct)
// we need a stream to communicate with Kaspad
var stream = rpc.MessageStream(null, null, ct);

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.GetInfoRequest = new kaspad.GetInfoRequestMessage();
await Guard(() => stream.RequestStream.WriteAsync(request),
ex=> logger.Debug(ex));
Expand Down Expand Up @@ -502,7 +502,7 @@ private async Task<bool> SubmitBlockAsync(CancellationToken ct, kaspad.RpcBlock
// we need a stream to communicate with Kaspad
var stream = rpc.MessageStream(null, null, ct);

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.SubmitBlockRequest = new kaspad.SubmitBlockRequestMessage
{
Block = block,
Expand Down Expand Up @@ -690,7 +690,7 @@ protected override async Task PostStartInitAsync(CancellationToken ct)
// we need a stream to communicate with Kaspad
var stream = rpc.MessageStream(null, null, ct);

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.GetCurrentNetworkRequest = new kaspad.GetCurrentNetworkRequestMessage();
await Guard(() => stream.RequestStream.WriteAsync(request),
ex=> throw new PoolStartupException($"Error writing a request in the communication stream '{ex.GetType().Name}' : {ex}", poolConfig.Id));
Expand All @@ -713,7 +713,7 @@ await Guard(() => stream.RequestStream.WriteAsync(request),
BlockchainStats.NetworkType = network;
BlockchainStats.RewardType = "POW";

request = new kaspad.KaspadMessage();
request = new kaspad.KaspadRequest();
request.GetInfoRequest = new kaspad.GetInfoRequestMessage();
await Guard(() => stream.RequestStream.WriteAsync(request),
ex=> throw new PoolStartupException($"Error writing a request in the communication stream '{ex.GetType().Name}' : {ex}", poolConfig.Id));
Expand Down Expand Up @@ -822,7 +822,7 @@ protected override async Task<bool> AreDaemonsHealthyAsync(CancellationToken ct)
// we need a stream to communicate with Kaspad
var stream = rpc.MessageStream(null, null, ct);

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.GetInfoRequest = new kaspad.GetInfoRequestMessage();
await Guard(() => stream.RequestStream.WriteAsync(request),
ex=> logger.Debug(ex));
Expand Down Expand Up @@ -870,7 +870,7 @@ protected override async Task<bool> AreDaemonsConnectedAsync(CancellationToken c
// we need a stream to communicate with Kaspad
var stream = rpc.MessageStream(null, null, ct);

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.GetConnectedPeerInfoRequest = new kaspad.GetConnectedPeerInfoRequestMessage();
await Guard(() => stream.RequestStream.WriteAsync(request),
ex=> logger.Debug(ex));
Expand Down Expand Up @@ -905,7 +905,7 @@ protected override async Task EnsureDaemonsSynchedAsync(CancellationToken ct)
// we need a stream to communicate with Kaspad
var stream = rpc.MessageStream(null, null, ct);

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.GetInfoRequest = new kaspad.GetInfoRequestMessage();
await Guard(() => stream.RequestStream.WriteAsync(request),
ex=> logger.Debug(ex));
Expand Down
10 changes: 5 additions & 5 deletions src/Miningcore/Blockchain/Kaspa/KaspaPayoutHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public KaspaPayoutHandler(
}

protected readonly IComponentContext ctx;
protected kaspad.KaspadRPC.KaspadRPCClient rpc;
protected kaspaWalletd.KaspaWalletdRPC.KaspaWalletdRPCClient walletRpc;
protected kaspad.RPC.RPCClient rpc;
private string network;
private KaspaPoolConfigExtra extraPoolConfig;
private KaspaPaymentProcessingConfigExtra extraPoolPaymentProcessingConfig;
Expand Down Expand Up @@ -87,7 +87,7 @@ public virtual async Task ConfigureAsync(ClusterConfig cc, PoolConfig pc, Cancel
// we need a stream to communicate with Kaspad
var stream = rpc.MessageStream(null, null, ct);

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.GetCurrentNetworkRequest = new kaspad.GetCurrentNetworkRequestMessage();
await Guard(() => stream.RequestStream.WriteAsync(request),
ex=> throw new PaymentException($"Error writing a request in the communication stream '{ex.GetType().Name}' : {ex}"));
Expand Down Expand Up @@ -131,7 +131,7 @@ public virtual async Task<Block[]> ClassifyBlocksAsync(IMiningPool pool, Block[]
{
var block = page[j];

var request = new kaspad.KaspadMessage();
var request = new kaspad.KaspadRequest();
request.GetBlockRequest = new kaspad.GetBlockRequestMessage
{
Hash = (string) block.Hash,
Expand All @@ -157,7 +157,7 @@ await Guard(() => stream.RequestStream.WriteAsync(request),
{
logger.Info(() => $"[{LogCategory}] Block {block.BlockHeight} uses a custom minimum confirmations calculation [{minConfirmations}]");

var requestConfirmations = new kaspad.KaspadMessage();
var requestConfirmations = new kaspad.KaspadRequest();
requestConfirmations.GetBlocksRequest = new kaspad.GetBlocksRequestMessage
{
LowHash = (string) block.Hash,
Expand Down Expand Up @@ -190,7 +190,7 @@ await Guard(() => stream.RequestStream.WriteAsync(requestConfirmations),
{
logger.Debug(() => $"[{LogCategory}] Block {block.BlockHeight} contains child: {childrenHash}");

var requestChildren = new kaspad.KaspadMessage();
var requestChildren = new kaspad.KaspadRequest();
requestChildren.GetBlockRequest = new kaspad.GetBlockRequestMessage
{
Hash = childrenHash,
Expand Down
Loading