Skip to content

Commit

Permalink
Update 080 podr2 (#102)
Browse files Browse the repository at this point in the history
* update podr2.proto

* update pubkey-api.proto
  • Loading branch information
AstaFrode authored Feb 18, 2024
1 parent fcf067f commit 61ffa8a
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 185 deletions.
8 changes: 1 addition & 7 deletions core/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,7 @@ type P2P interface {
callOpts []grpc.CallOption,
) (*pb.ResponseSpaceProofVerifyTotal, error)

RequestGenTag(
addr string,
requestGenTag *pb.RequestGenTag,
timeout time.Duration,
dialOpts []grpc.DialOption,
callOpts []grpc.CallOption,
) (*pb.ResponseGenTag, error)
RequestGenTag(c pb.Podr2ApiClient) (pb.Podr2Api_RequestGenTagClient, error)

RequestEcho(
addr string,
Expand Down
20 changes: 2 additions & 18 deletions core/podr2.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,8 @@ func (n *Node) NewPodr2VerifierApiClient(addr string, opts ...grpc.DialOption) (
return pb.NewPodr2VerifierApiClient(conn), nil
}

func (n *Node) RequestGenTag(
addr string,
requestGenTag *pb.RequestGenTag,
timeout time.Duration,
dialOpts []grpc.DialOption,
callOpts []grpc.CallOption,
) (*pb.ResponseGenTag, error) {
conn, err := grpc.Dial(addr, dialOpts...)
if err != nil {
return nil, err
}
defer conn.Close()
c := pb.NewPodr2ApiClient(conn)

ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

result, err := c.RequestGenTag(ctx, requestGenTag, callOpts...)
func (n *Node) RequestGenTag(c pb.Podr2ApiClient) (pb.Podr2Api_RequestGenTagClient, error) {
result, err := c.RequestGenTag(context.Background())
return result, err
}

Expand Down
305 changes: 190 additions & 115 deletions pb/podr2-api.pb.go

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions pb/podr2-api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ package podr2;
option go_package = "./;pb";

service Podr2Api {
rpc request_gen_tag(RequestGenTag) returns (ResponseGenTag) {}
rpc request_gen_tag(stream RequestGenTag)
returns (stream ResponseGenTag) {}

// A echo rpc to measure network RTT.
rpc Echo (EchoMessage) returns (EchoMessage) {}
Expand Down Expand Up @@ -45,6 +46,11 @@ message DigestInfo {
}

message ResponseGenTag {
bool processing = 1;
GenTagMsg msg = 2;
}

message GenTagMsg {
Tag tag = 1;
bytes u_sig = 2;
bytes signature = 3;
Expand Down Expand Up @@ -83,4 +89,4 @@ enum StatusCode {
OutOfMemory = 10004;
AlgorithmError = 10005;
UnknownError = 10006;
}
}
87 changes: 60 additions & 27 deletions pb/podr2-api_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions pb/pubkey-api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions pb/pubkey-api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ message IdentityPubkeyResponse {
// the identity public key
bytes pubkey = 1;
// The timestamp for the processing of the request
uint64 timestamp = 2;
// Use the sr25519 algorithm to sign the timestamp fields above
int64 timestamp = 2;
// Use the sr25519 algorithm to sign the timestamp fields above (use it's Big-Endian bytes)
bytes signature = 3;
}

message MasterPubkeyResponse {
// the master public key
bytes pubkey = 1;
// The timestamp for the processing of the request
uint64 timestamp = 2;
int64 timestamp = 2;
// Use the sr25519 algorithm to sign the timestamp fields above (use it's Big-Endian bytes)
bytes signature = 3;
}

message Podr2PubkeyResponse {
// the PODR2 public key
bytes pubkey = 1;
// The timestamp for the processing of the request
uint64 timestamp = 2;
// Use the RSA algorithm to sign the timestamp fields above
int64 timestamp = 2;
// Use the RSA algorithm to sign the timestamp fields above (use it's Big-Endian bytes)
bytes signature = 3;
}

0 comments on commit 61ffa8a

Please sign in to comment.