forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdriver.proto
73 lines (56 loc) · 2.53 KB
/
driver.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright IBM Corp. All Rights Reserved.
//
// SPDX-License-Identifier: Apache-2.0
syntax = "proto3";
package driver.driver;
import "common/ack.proto";
import "common/query.proto";
import "common/events.proto";
import "common/state.proto";
option java_package = "org.hyperledger.cacti.weaver.protos.driver.driver";
option go_package = "github.com/hyperledger-cacti/cacti/weaver/common/protos-go/v2/driver";
// Data for a View processing by dest-driver
message WriteExternalStateMessage {
common.state.ViewPayload view_payload = 1;
common.events.ContractTransaction ctx = 2;
}
message PerformLockRequest {
string session_id = 1;
}
message CreateAssetRequest {
string session_id = 1;
}
message ExtinguishRequest {
string session_id = 1;
}
message AssignAssetRequest {
string session_id = 1;
}
service DriverCommunication {
// Data Sharing
// the remote relay sends a RequestDriverState request to its driver with a
// query defining the data it wants to receive
rpc RequestDriverState(common.query.Query) returns (common.ack.Ack) {}
// Events Subscription
// the src-relay uses this endpoint to forward the event subscription request from dest-relay to driver
rpc SubscribeEvent(common.events.EventSubscription) returns (common.ack.Ack) {}
// Recommended to have TLS mode on for this unsafe endpoint
// Relay uses this to get Query.requestor_signature and
// Query.certificate required for event subscription
rpc RequestSignedEventSubscriptionQuery(common.events.EventSubscription) returns (common.query.Query) {}
// Events Publication
// the dest-relay calls the dest-driver on this end point to write the remote network state to the local ledger
rpc WriteExternalState(WriteExternalStateMessage) returns (common.ack.Ack) {}
// As part of SATP, the source reply (sender gateway) sends a PerformLock request to its driver
// to lock a specific asset
rpc PerformLock(PerformLockRequest) returns (common.ack.Ack) {}
// As part of SATP, the destination reply (receiver gateway) sends a CreateAsset request to its driver
// to create a specific asset
rpc CreateAsset(CreateAssetRequest) returns (common.ack.Ack) {}
// As part of SATP, the source reply (sender gateway) sends a Extinguish request to its driver
// to extinguish a specific asset
rpc Extinguish(ExtinguishRequest) returns (common.ack.Ack) {}
// As part of SATP, the destination reply (receiver gateway) sends a AssignAsset request to its driver
// to assign a specific asset
rpc AssignAsset(AssignAssetRequest) returns (common.ack.Ack) {}
}