Skip to content

Commit

Permalink
feat(satp-hermes): satp development continuation and implementation s…
Browse files Browse the repository at this point in the history
…atp protocol (#3397)

Signed-off-by: Carlos Amaro <carlosrscamaro@tecnico.ulisboa.pt>
  • Loading branch information
LordKubaya authored and rafaelbelchiorbd committed Nov 13, 2024
1 parent e923e5f commit aadfbbc
Show file tree
Hide file tree
Showing 33 changed files with 3,080 additions and 1,962 deletions.
98 changes: 41 additions & 57 deletions packages/cacti-plugin-weaver-driver-fabric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,63 +14,47 @@
"bugs": {
"url": "https://github.com/hyperledger-cacti/cacti/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hyperledger/cacti.git"
{
"name": "Venkatraman Ramakrishna",
"email": "vramakr2@in.ibm.com",
"url": "https://researcher.watson.ibm.com/researcher/view.php?person=in-vramakr2"
},
"license": "Apache-2.0",
"author": {
"name": "Hyperledger cacti Contributors",
"email": "cacti@lists.hyperledger.org",
"url": "https://www.hyperledger.org/use/cacti"
{
"name": "Sandeep Nishad",
"email": "sandeep.nishad1@ibm.com",
"url": "https://github.com/sandeepnRES"
},
"contributors": [
{
"name": "Please add yourself to the list of contributors",
"email": "your.name@example.com",
"url": "https://example.com"
},
{
"name": "Venkatraman Ramakrishna",
"email": "vramakr2@in.ibm.com",
"url": "https://researcher.watson.ibm.com/researcher/view.php?person=in-vramakr2"
},
{
"name": "Sandeep Nishad",
"email": "sandeep.nishad1@ibm.com",
"url": "https://github.com/sandeepnRES"
},
{
"name": "Krishnasuri Narayanam",
"email": "knaraya3@in.ibm.com",
"url": "https://research.ibm.com/people/krishnasuri-narayanam"
}
],
"main": "dist/lib/main/typescript/index.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
"scripts": {
"build": "cd src/main/typescript && make build",
"build-image": "cd src/main/typescript && make build-image",
"build-image-local": "cd src/main/typescript && make build-image-local",
"build-local": "cd src/main/typescript && make build-local",
"clean": "cd src/main/typescript && make clean",
"clean-local": "cd src/main/typescript && make clean-local",
"publish": "cd src/main/typescript && make push-image && make push-image-latest",
"postpublish": "cd src/main/typescript && make push-image-latest",
"watch": "npm-watch"
},
"engines": {
"node": ">=18",
"npm": ">=8"
},
"publishConfig": {
"access": "public"
},
"browserMinified": "dist/cacti-weaver-driver-fabric.web.umd.min.js",
"mainMinified": "dist/cacti-weaver-driver-fabric.node.umd.min.js",
"watch": {}
{
"name": "Krishnasuri Narayanam",
"email": "knaraya3@in.ibm.com",
"url": "https://research.ibm.com/people/krishnasuri-narayanam"
}
],
"main": "dist/lib/main/typescript/index.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
"scripts": {
"build": "cd src/main/typescript && make build",
"build-image": "cd src/main/typescript && make build-image",
"build-image-local": "cd src/main/typescript && make build-image-local",
"build-local": "cd src/main/typescript && make build-local",
"clean": "cd src/main/typescript && make clean",
"clean-local": "cd src/main/typescript && make clean-local",
"publish": "cd src/main/typescript && make push-image && make push-image-latest",
"postpublish": "cd src/main/typescript && make push-image-latest",
"watch": "npm-watch"
},
"engines": {
"node": ">=18",
"npm": ">=8"
},
"publishConfig": {
"access": "public"
},
"browserMinified": "dist/cacti-weaver-driver-fabric.web.umd.min.js",
"mainMinified": "dist/cacti-weaver-driver-fabric.node.umd.min.js",
"watch": {}
}
2 changes: 2 additions & 0 deletions packages/cactus-plugin-satp-hermes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
"@connectrpc/connect-node": "1.3.0",
"@connectrpc/protoc-gen-connect-es": "1.3.0",
"@bufbuild/protobuf": "1.10.0",
"@hyperledger/cactus-plugin-bungee-hermes": "2.0.0",

"axios": "1.7.7",
"body-parser": "1.20.2",
"class-transformer": "0.5.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ message TransferClaims {
string receiver_gateway_owner_id = 12;
uint32 max_retries = 13;
uint64 max_timeout = 14;
string amount_from_originator = 15;
string amount_to_beneficiary = 16;
}

message TransferClaimsFormat {
Expand Down Expand Up @@ -192,35 +194,40 @@ enum Error {
ERROR_MESSAGE_OUT_OF_SEQUENCE = 11;
}

message LockAssertionClaim {

}

message LockAssertionFormat {
message LockAssertionClaimFormat {

}

message MintAssertionClaims {
message MintAssertionClaimFormat {

}

message MintAssertionClaimsFormat {
message BurnAssertionClaimFormat {

}

message BurnAssertionClaim {
message AssignmentAssertionClaimFormat {

}

message BurnAssertionClaimFormat {

message LockAssertionClaim {
string receipt = 1;
string signature = 2;
}

message AssignmentAssertionClaim {

message MintAssertionClaim {
string receipt = 1;
string signature = 2;
}

message AssignmentAssertionClaimFormat {
message BurnAssertionClaim {
string receipt = 1;
string signature = 2;
}

message AssignmentAssertionClaim {
string receipt = 1;
string signature = 2;
}

Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,40 @@ message SessionData {
string sender_gateway_owner_id = 27;
string receiver_gateway_owner_id = 28;
string hash_transfer_init_claims = 29;
string proposed_transfer_init_claims = 30;
cacti.satp.v02.common.SignatureAlgorithm signature_algorithm = 31;
cacti.satp.v02.common.LockType lock_type = 32;
uint64 lock_expiration_time = 33;
cacti.satp.v02.common.Permissions permissions = 34;
string developer_urn = 35;
cacti.satp.v02.common.CredentialProfile credential_profile = 36;
cacti.satp.v02.common.SubsequentCalls subsequent_calls = 37;
repeated cacti.satp.v02.common.History history = 38;
bool multiple_claims_allowed = 39;
bool multiple_cancels_allowed = 40;
string last_message_received_timestamp = 41;
MessageStagesTimestamps processed_timestamps = 42;
MessageStagesTimestamps received_timestamps = 43;
cacti.satp.v02.common.LockAssertionClaim lock_assertion_claim = 44;
cacti.satp.v02.common.LockAssertionFormat lock_assertion_format = 45;
cacti.satp.v02.common.MintAssertionClaims mint_assertion_claims = 46;
cacti.satp.v02.common.MintAssertionClaimsFormat mint_assertion_claims_format = 47;
cacti.satp.v02.common.BurnAssertionClaim burn_assertion_claim = 48;
cacti.satp.v02.common.BurnAssertionClaimFormat burn_assertion_claim_format = 49;
cacti.satp.v02.common.AssignmentAssertionClaim assignment_assertion_claim = 50;
cacti.satp.v02.common.AssignmentAssertionClaimFormat assignment_assertion_claim_format = 51;
bool completed = 52;
ACCEPTANCE acceptance = 53;
string last_message_hash = 54;
cacti.satp.v02.common.TransferClaimsFormat transfer_claims_format = 55;
cacti.satp.v02.common.TransferClaims transfer_init_claims = 30;
string proposed_transfer_init_claims = 31;
cacti.satp.v02.common.SignatureAlgorithm signature_algorithm = 32;
cacti.satp.v02.common.LockType lock_type = 33;
uint64 lock_expiration_time = 34;
cacti.satp.v02.common.Permissions permissions = 35;
string developer_urn = 36;
cacti.satp.v02.common.CredentialProfile credential_profile = 37;
cacti.satp.v02.common.SubsequentCalls subsequent_calls = 38;
repeated cacti.satp.v02.common.History history = 39;
bool multiple_claims_allowed = 40;
bool multiple_cancels_allowed = 41;
string last_message_received_timestamp = 42;
MessageStagesTimestamps processed_timestamps = 43;
MessageStagesTimestamps received_timestamps = 44;
cacti.satp.v02.common.LockAssertionClaim lock_assertion_claim = 45;
cacti.satp.v02.common.LockAssertionClaimFormat lock_assertion_claim_format = 46;
cacti.satp.v02.common.MintAssertionClaim mint_assertion_claim = 47;
cacti.satp.v02.common.MintAssertionClaimFormat mint_assertion_claim_format = 48;
cacti.satp.v02.common.BurnAssertionClaim burn_assertion_claim = 49;
cacti.satp.v02.common.BurnAssertionClaimFormat burn_assertion_claim_format = 50;
cacti.satp.v02.common.AssignmentAssertionClaim assignment_assertion_claim = 51;
cacti.satp.v02.common.AssignmentAssertionClaimFormat assignment_assertion_claim_format = 52;
bool completed = 53;
ACCEPTANCE acceptance = 54;
string last_message_hash = 55;
cacti.satp.v02.common.TransferClaimsFormat transfer_claims_format = 56;
string client_transfer_number = 57;
string server_transfer_number = 58;
string lock_assertion_expiration = 59;
cacti.satp.v02.common.AssetProfile asset_profile = 60;
}



message MessageStagesHashes {
Stage1Hashes stage1 = 1;
Stage2Hashes stage2 = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ message TransferCommenceRequestMessage {

message TransferCommenceResponseMessage {
cacti.satp.v02.common.CommonSatp common = 1;
string server_transfer_number = 2;
}

service SatpStage1Service {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "cacti/satp/v02/common/message.proto";
message LockAssertionRequestMessage {
cacti.satp.v02.common.CommonSatp common = 1;
cacti.satp.v02.common.LockAssertionClaim lock_assertion_claim = 2;
cacti.satp.v02.common.LockAssertionFormat lock_assertion_format = 3;
cacti.satp.v02.common.LockAssertionClaimFormat lock_assertion_claim_format = 3;
string lock_assertion_expiration = 4;
string client_transfer_number = 5;
string client_signature = 6;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ message CommitPreparationRequestMessage {

message CommitReadyResponseMessage {
cacti.satp.v02.common.CommonSatp common = 1;
cacti.satp.v02.common.MintAssertionClaims mint_assertion_claims = 2;
cacti.satp.v02.common.MintAssertionClaimsFormat mint_assertion_claims_format = 3;
cacti.satp.v02.common.MintAssertionClaim mint_assertion_claim = 2;
cacti.satp.v02.common.MintAssertionClaimFormat mint_assertion_claim_format = 3;
string server_transfer_number = 4;
string server_signature = 5;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ import {
import { ExecuteGetStatus } from "./admin/get-status-handler-service";
import { ISATPManagerOptions, SATPManager } from "../gol/satp-manager";
import { GatewayOrchestrator } from "../gol/gateway-orchestrator";
import { SATPBridgesManager } from "../gol/satp-bridges-manager";

export interface BLODispatcherOptions {
logger: Logger;
logLevel?: LogLevelDesc;
instanceId: string;
orchestrator: GatewayOrchestrator;
signer: JsObjectSigner;
bridgesManager: SATPBridgesManager;
}

export class BLODispatcher {
Expand All @@ -36,6 +38,7 @@ export class BLODispatcher {
private readonly instanceId: string;
private manager: SATPManager;
private orchestrator: GatewayOrchestrator;
private bridgeManager: SATPBridgesManager;

constructor(public readonly options: BLODispatcherOptions) {
const fnTag = `${BLODispatcher.CLASS_NAME}#constructor()`;
Expand All @@ -50,11 +53,14 @@ export class BLODispatcher {
const signer = options.signer;
const ourGateway = this.orchestrator.ourGateway;

this.bridgeManager = options.bridgesManager;

const SATPManagerOpts: ISATPManagerOptions = {
logLevel: "DEBUG",
instanceId: ourGateway!.id,
signer: signer,
supportedDLTs: this.orchestrator.supportedDLTs,
bridgeManager: this.bridgeManager,
};

this.manager = new SATPManager(SATPManagerOpts);
Expand Down
Loading

0 comments on commit aadfbbc

Please sign in to comment.