Skip to content

Commit

Permalink
Syncer's sequence diagram #16
Browse files Browse the repository at this point in the history
  • Loading branch information
janekolszak committed Jan 30, 2023
1 parent 6be9a83 commit c792e75
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,51 @@

Service for syncing with Arweave nodes. It downloads all transaction from Arweve, filters for SmarWeave contracts, parses and saves interactions to the database.

## Architecture

```mermaid
sequenceDiagram
autonumber
loop Periodically
NetworkMonitor->>+WarpGateway: GetNetworkInfo
activate NetworkMonitor
WarpGateway-->>-NetworkMonitor: NetworkInfo
NetworkMonitor->>NetworkMonitor: Check Height Changed
NetworkMonitor->>BlockMonitor: Updated Block Height
deactivate NetworkMonitor
end
activate BlockMonitor
loop For Every Height
BlockMonitor->>+ArweaveNodes: GetBlockByHeight
ArweaveNodes-->>-BlockMonitor: Block
BlockMonitor->>BlockMonitor: Verify Block
par Workers
BlockMonitor->>+ArweaveNodes: GetTransactionById
ArweaveNodes-->>-BlockMonitor: Transaction
end
BlockMonitor->>+TransactionMonitor: Transactions
end
deactivate BlockMonitor
activate TransactionMonitor
TransactionMonitor->>TransactionMonitor: Filter SmartWeave Transactions
TransactionMonitor->>TransactionMonitor: Verify Transactions
TransactionMonitor->>TransactionMonitor: Parse Interactions
TransactionMonitor->>+Controller: Interactions, Block height
deactivate TransactionMonitor
Controller->>-Store: Save Interactions
activate Store
Store->>Store: Cache Interactions
rect rgb(191, 223, 255)
note left of DB: Transaction
Store->>DB: Update Last Transaction Height
activate DB
Store->>DB: Batch Insert Interactions
deactivate DB
deactivate Store
end
```



## Build
We use Make for build orchestration. To generate binaries simply use `make` in the root directory
Expand Down

0 comments on commit c792e75

Please sign in to comment.