forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(besu): 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-besu/docs/architecture 2. Modified the Readme to incorporate the pngs created above. Fixes hyperledger-cacti#755 Signed-off-by: Jagpreet Singh Sasan <jagpreet.singh.sasan@accenture.com>
- Loading branch information
1 parent
77ac399
commit 94ec843
Showing
13 changed files
with
223 additions
and
1 deletion.
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
+60.5 KB
...ocs/architecture/images/run-transaction-endpoint-transact-cactuskeychainref.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
+37.9 KB
...docs/architecture/images/run-transaction-endpoint-transact-pollfortxreceipt.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
+44.9 KB
...-besu/docs/architecture/images/run-transaction-endpoint-transact-privatekey.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
+47.4 KB
...ctor-besu/docs/architecture/images/run-transaction-endpoint-transact-signed.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
+73 KB
...r-connector-besu/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
...gin-ledger-connector-besu/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.
33 changes: 33 additions & 0 deletions
33
...connector-besu/docs/architecture/run-transaction-endpoint-transact-cactuskeychainref.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,33 @@ | ||
@startuml | ||
title Hyperledger Cactus\nSequence Diagram\nRun Transaction Endpoint\ntransactCactusKeychainReference() method | ||
|
||
skinparam sequenceArrowThickness 2 | ||
skinparam roundcorner 20 | ||
skinparam maxmessagesize 120 | ||
skinparam sequenceParticipant underline | ||
|
||
actor "Caller" as caller | ||
participant "transactCactusKeychainReference()" as tckr | ||
participant "transactPrivateKey()" as tpk | ||
participant "web3.eth.accounts.signTransaction()" as weas | ||
|
||
caller-> tckr: req | ||
activate caller | ||
group #LightBlue if web3SigningCredential == CACTUSKEYCHAINREF | ||
activate tckr | ||
tckr -> tpk: [transactionConfig, web3SigningCredential] | ||
activate tpk | ||
tpk -> weas: [transactionConfig, secret] | ||
activate weas | ||
weas --> tpk: return [signedTx] | ||
deactivate weas | ||
group #LightGray if defined: signedTx.rawTransaction | ||
tpk --> tckr: return [req with rawTransaction] | ||
tckr --> caller : return {transactionConfig, web3SigningCredential, consistencyStrategy} as resBody | ||
deactivate tckr | ||
else #LightCoral | ||
tpk --> tckr: throw Error: Failed to sign eth transaction. signedTransaction.rawTransaction is blank after .signTransaction() | ||
end | ||
deactivate tpk | ||
end | ||
@enduml |
35 changes: 35 additions & 0 deletions
35
...-connector-besu/docs/architecture/run-transaction-endpoint-transact-pollfortxreceipt.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,35 @@ | ||
@startuml Sequence Diagram - transact method | ||
|
||
title Hyperledger Cactus\nSequence Diagram\nRun Transaction Endpoint\npollForTxReceipt() method | ||
|
||
skinparam sequenceArrowThickness 2 | ||
skinparam roundcorner 20 | ||
skinparam maxmessagesize 100 | ||
skinparam sequenceParticipant underline | ||
|
||
actor "Caller" as caller | ||
participant "pollForTxReceipt()" as pftr | ||
participant "web3.eth.getTransactionReceipt" as wegt | ||
|
||
caller -> pftr: txHash, consistencyStrategy | ||
activate caller | ||
group #Orange | ||
activate pftr | ||
pftr -> wegt: | ||
activate wegt | ||
loop #LightGreen until confirmationCount >= \n consistencyStrategy.blockConfirmations | ||
wegt --> pftr: txReceipt | ||
deactivate wegt | ||
end loop | ||
|
||
group #LightGreen if defined: txReceipt | ||
pftr --> caller: txReceipt | ||
else #LightCoral | ||
pftr --> caller: Timed out | ||
deactivate pftr | ||
end | ||
end | ||
deactivate caller | ||
|
||
|
||
@enduml |
30 changes: 30 additions & 0 deletions
30
...ledger-connector-besu/docs/architecture/run-transaction-endpoint-transact-privatekey.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,30 @@ | ||
@startuml Sequence Diagram - transact method | ||
|
||
title Hyperledger Cactus\nSequence Diagram\nRun Transaction Endpoint\ntransactPrivateKey() method | ||
|
||
skinparam sequenceArrowThickness 2 | ||
skinparam roundcorner 20 | ||
skinparam maxmessagesize 120 | ||
skinparam sequenceParticipant underline | ||
|
||
actor "Caller" as caller | ||
participant "transactPrivateKey()" as tpk | ||
participant "web3.eth.accounts.signTransaction()" as weas | ||
|
||
caller -> tpk: req | ||
activate caller | ||
alt #LightGreen web3SigningCredential == PRIVATEKEYHEX | ||
group #LightGray if defined: signedTx.rawTransaction | ||
activate tpk | ||
tpk -> weas: [transactionConfig, secret] | ||
activate weas | ||
weas --> tpk: return [signedTx] | ||
deactivate weas | ||
tpk --> caller: return [req with rawTransaction] as resBody | ||
else #LightCoral | ||
tpk --> caller: throw Error: Failed to sign eth transaction. signedTransaction.rawTransaction is blank after .signTransaction() | ||
deactivate tpk | ||
end | ||
end | ||
|
||
@enduml |
35 changes: 35 additions & 0 deletions
35
...gin-ledger-connector-besu/docs/architecture/run-transaction-endpoint-transact-signed.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,35 @@ | ||
@startuml Sequence Diagram - transact method | ||
|
||
title Hyperledger Cactus\nSequence Diagram\nRun Transaction Endpoint\ntransactSigned() method | ||
|
||
skinparam sequenceArrowThickness 2 | ||
skinparam roundcorner 20 | ||
skinparam maxmessagesize 120 | ||
skinparam sequenceParticipant underline | ||
|
||
actor "Caller" as caller | ||
participant "transactSigned()" as ts | ||
participant "web3.eth.sendSignedTransaction()" as wesst | ||
|
||
caller -> ts: req | ||
activate caller | ||
group #e6e632 if web3SigningCredential == NONE | ||
activate ts | ||
ts -> wesst: rawTransaction | ||
activate wesst | ||
wesst --> ts: txPoolReceipt | ||
deactivate wesst | ||
group #ecec66 if ReceiptType == NODETXPOOLACK | ||
ts --> caller: returns [txPoolReceipt] as resBody | ||
else #f2f299 ReceiptType == LEDGERBLOCKACK | ||
ts -> ts: pollForTxReceipt(txHash, consistencyStrategy) | ||
ts --> caller: return [ledgerReceipt as transactionReceipt] as resBody | ||
else #LightCoral | ||
ts --> caller: throw Error: Unrecognized ReceiptType | ||
deactivate ts | ||
end | ||
end | ||
deactivate caller | ||
|
||
|
||
@enduml |
40 changes: 40 additions & 0 deletions
40
...tus-plugin-ledger-connector-besu/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,40 @@ | ||
@startuml | ||
title Hyperledger Cactus\nSequence Diagram\nRun Transaction Endpoint\ntransact() method | ||
|
||
skinparam sequenceArrowThickness 2 | ||
skinparam roundcorner 20 | ||
skinparam maxmessagesize 120 | ||
skinparam sequenceParticipant underline | ||
|
||
actor "Caller" as caller | ||
participant "PluginLedgerConnectorBesu" as t << (C,#ADD1B2) class >> | ||
|
||
autoactivate on | ||
|
||
activate caller | ||
caller -> t: transact(RunTransactionRequest) | ||
|
||
alt #LightBlue web3SigningCredential == CACTUSKEYCHAINREF | ||
t -> t: transactCactusKeychainRef(RunTransactionRequest) | ||
return RunTransactionResponse | ||
t --> caller: return RunTransactionResponse | ||
else #LightGreen web3SigningCredential == PRIVATEKEYHEX | ||
group #LightGray if defined: signedTx.rawTransaction | ||
t -> t: transactPrivateKey(RunTransactionRequest) | ||
return RunTransactionResponse | ||
t --> caller: return RunTransactionResponse | ||
else #LightCoral | ||
t --> caller: throw Error: Failed to sign eth transaction. signedTransaction.rawTransaction is blank after .signTransaction() | ||
end | ||
else #e6e632 web3SigningCredential == NONE | ||
group #LightGray if defined: req.transactionConfig.rawTransaction | ||
t -> t: transactSigned(RunTransactionRequest) | ||
return RunTransactionResponse | ||
t --> caller: return RunTransactionResponse | ||
else #LightCoral | ||
t --> caller: throw Error: Expected pre-signed raw transaction | ||
end | ||
else #LightCoral default | ||
t --> caller: throw Error: Unrecognized Web3SigningCredentialType | ||
end | ||
@enduml |
29 changes: 29 additions & 0 deletions
29
packages/cactus-plugin-ledger-connector-besu/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 |