Skip to content

Commit

Permalink
Support payment requests and wait for payment
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Jun 8, 2024
1 parent 564555f commit 2356405
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions proto/Payment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ message Payment {
optional PaymentStatus status = 5;
optional string data = 6;
optional string proof = 7;
optional bool waitForPayment = 8;
}
18 changes: 15 additions & 3 deletions proto/rpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ message RpcRequestJob {
optional string outputFormat = 8;
optional string requestProvider = 9;
optional bool encrypted = 10;
optional string userId = 11;
optional string userId = 11; // deprecated: pass as header instead
optional uint32 minWorkers = 12;
optional Payment bid = 13;
}
Expand Down Expand Up @@ -75,13 +75,22 @@ message RpcJobComplete{
}

message RpcRequestPayment{
string jobId = 3;
optional Payment payment = 1;
optional bool waitForPayments = 2 ;

}

message RpcRequestPaymentResponse{
PaymentStatus status=1;
bool status=1;
}

message RpcWaitForPaymentsRequest{
string jobId = 1;
optional uint32 wait = 2; // max time to wait in ms , 0 or unset means no wait
}

message RpcWaitForPaymentsResponse{
bool status=1;
}

message RpcJobLog {
Expand Down Expand Up @@ -313,6 +322,8 @@ message RpcPayJobRequest {
string protocol = 4;
}



service PoolConnector {
// job management
rpc requestJob (RpcRequestJob) returns (Job);
Expand All @@ -327,6 +338,7 @@ service PoolConnector {
rpc logForJob(RpcJobLog) returns (Job);
rpc payJob(RpcPayJobRequest) returns (Job);
rpc requestPayment(RpcRequestPayment) returns (RpcRequestPaymentResponse);
rpc waitForPayments(RpcWaitForPaymentsRequest) returns (RpcWaitForPaymentsResponse);


// discovery
Expand Down

0 comments on commit 2356405

Please sign in to comment.