Skip to content

Commit

Permalink
Update proto to support announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Apr 12, 2024
1 parent 4d0ea60 commit 62c6930
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build-javascript.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

set -e
mkdir -p build/javascript/src
mkdir -p build/javascript/dist

Expand Down
2 changes: 1 addition & 1 deletion build-php.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

set -e
mkdir -p tmp
mkdir -p build/php
pecl install grpc
Expand Down
2 changes: 1 addition & 1 deletion build-python.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

set -e
mkdir -p tmp
python3 -m venv tmp/protobuild-venv
. tmp/protobuild-venv/bin/activate
Expand Down
1 change: 1 addition & 0 deletions proto/Job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ message Job {
JobState state = 11;

uint64 maxExecutionTime = 13; // enforced by the provider
string nodeId = 15;
// map<string,JobResult> results = 12;

// map<string,JobState> states = 11;
Expand Down
1 change: 1 addition & 0 deletions proto/Log.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ message Log {
string level = 3;
uint64 timestamp = 4;
string source = 5;
string nodeId = 6;
}
11 changes: 11 additions & 0 deletions proto/Node.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";


message Node {
string id = 1;
string iconUrl = 3;
string name = 4;
string description = 5;
repeated string eventTemplates = 6;
}

30 changes: 29 additions & 1 deletion proto/rpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "JobParam.proto";
import "JobInput.proto";
import "JobResult.proto";
import "Job.proto";
import "Node.proto";

message RpcRequestJob {
string runOn = 1;
Expand Down Expand Up @@ -35,7 +36,6 @@ message PendingJobs {
}



message RpcIsJobDone {
bool isDone = 1;
}
Expand Down Expand Up @@ -109,6 +109,30 @@ message RpcUnsubscribeFromEventsResponse{
bool success = 1;
}


message RpcAnnounceNodeRequest {
string iconUrl = 3;
string name = 4;
string description = 5;
}

message RpcAnnounceNodeResponse {
bool success = 1;
Node node = 2;
uint64 refreshInterval = 4;

}

message RpcAnnounceTemplateRequest {
string eventTemplate = 2;
}

message RpcAnnounceTemplateResponse {
bool success = 1;
Node node = 2;
uint64 refreshInterval = 4;
}

service NostrConnector {
// job management
rpc requestJob (RpcRequestJob) returns (Job);
Expand All @@ -122,6 +146,10 @@ service NostrConnector {
rpc logForJob(RpcJobLog) returns (Job);


// discovery
rpc announceNode (RpcAnnounceNodeRequest) returns (RpcAnnounceNodeResponse);
rpc announceEventTemplate (RpcAnnounceTemplateRequest) returns (RpcAnnounceTemplateResponse);


// generic nostr events
rpc sendSignedEvent (RpcSendSignedEventRequest) returns (RpcSendSignedEventResponse);
Expand Down

0 comments on commit 62c6930

Please sign in to comment.