-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fabric): add sequence diagram of run transaction endpoint
Primary Change -------------- 1. Added plantuml diagrams and corresponding pngs to describe the run transaction endpoint and are located under cactus-plugin-ledger-connector-fabric/docs/architecture 2. Modified the Readme to incorporate the pngs created above. Resolve #756 Signed-off-by: Jagpreet Singh Sasan <[email protected]>
- Loading branch information
1 parent
890007f
commit 155cbab
Showing
5 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+95.6 KB
...connector-fabric/docs/architecture/images/run-transaction-endpoint-transact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.5 KB
...n-ledger-connector-fabric/docs/architecture/images/run-transaction-endpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions
59
...s-plugin-ledger-connector-fabric/docs/architecture/run-transaction-endpoint-transact.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@startuml | ||
title Hyperledger Cactus\nSequence Diagram\nRun Transaction Endpoint\ntransact() method | ||
|
||
skinparam sequenceArrowThickness 2 | ||
skinparam roundcorner 20 | ||
skinparam maxmessagesize 300 | ||
skinparam sequenceParticipant underline | ||
|
||
actor "Caller" as caller | ||
participant "PluginLedgerConnectorFabric" as t << (C,#ADD1B2) class >> | ||
|
||
autoactivate on | ||
|
||
activate caller | ||
caller -> t: transact(req: RunTransactionRequest) | ||
|
||
t -> t: req | ||
t --> t: {signingCredential, channelName, contractName, invocationType, fnName as methodName, params} | ||
|
||
t -> t: InMemoryWallet(new X509WalletMixin()) | ||
t --> t: wallet | ||
|
||
t -> t: opts.pluginRegistry.findOneByKeychainID(signingCredential.keychainId) | ||
t --> t: keychain | ||
|
||
t -> t: keychain.get<string>(signingCredential.keychainRef) | ||
t --> t: fabricX509IdentityJson | ||
|
||
t -> t: JSON.parse(fabricX509IdentityJson) | ||
t --> t: identity | ||
|
||
t -> t: wait for wallter.import(signingCredential.keychainRef, identity) | ||
deactivate t | ||
|
||
t -> t: wait for gateway.connect(connectionProfile, gatewayOptions) | ||
deactivate t | ||
|
||
t -> t: wait gateway.getNetwork(channelName) | ||
t --> t: network | ||
|
||
t -> t: network.getContract(contractName) | ||
t --> t: contract | ||
|
||
group #LightBlue if invocationType == FabricContractInvocationType.CALL | ||
t -> t: wait for contract.evaluateTransaction(fnName, ...params) | ||
t --> t: out, success: true | ||
else #LightYellow if invocationType == FabricContractInvocationType.SEND | ||
t -> t: wait for contract.submitTransaction(fnName, ...params) | ||
t --> t: out, success: true | ||
else #LightCoral default | ||
t --> caller: throw Error('unknown FabricContractInvocationType') | ||
end | ||
|
||
t -> t: out.toString("utf-8") | ||
t --> t: outUtf8 | ||
|
||
t --> caller: return { functionOutput, success } as res | ||
|
||
@enduml |
29 changes: 29 additions & 0 deletions
29
...ges/cactus-plugin-ledger-connector-fabric/docs/architecture/run-transaction-endpoint.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@startuml Sequence Diagram - Transaction | ||
|
||
title Hyperledger Cactus\nSequence Diagram\nRun Transaction Endpoint | ||
|
||
skinparam sequenceArrowThickness 2 | ||
skinparam roundcorner 20 | ||
skinparam maxmessagesize 120 | ||
skinparam sequenceParticipant underline | ||
|
||
box "Users" #LightBlue | ||
actor "User A" as a | ||
end box | ||
|
||
box "Hyperledger Cactus" #LightGray | ||
entity "API Client" as apic | ||
entity "API Server" as apis | ||
end box | ||
|
||
box "Ledger Connector" #LightGreen | ||
database "Besu" as besucon | ||
end box | ||
|
||
a --> apic : Tx Besu Ledger | ||
apic --> apis: Request | ||
apis --> besucon: transact() | ||
besucon --> apis: Response | ||
apis --> apic: Formatted Response | ||
|
||
@enduml |