Skip to content

Commit c6b8cdc

Browse files
committed
ci lint
1 parent 46c4519 commit c6b8cdc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/src/architecture/08_concepts/gateway/concrete.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ icon: material/hub
33
---
44

55
# Pseudocode
6-
Building blocks in the form of *pseudocode*;
6+
Building blocks in the form of *pseudocode*;
77
Intended to make the conceptual design more concrete; not setting rules.
88

99
## Node
1010

1111
Restart node with new config
12+
1213
```rust
1314
fn restart_node(config: Config) -> Result<(), Err>{
1415
// graceful restart
@@ -18,6 +19,7 @@ fn restart_node(config: Config) -> Result<(), Err>{
1819
## Config
1920

2021
Check if config exists; all orchestration is coordinated via the DB, more specifically the config.
22+
2123
```rust
2224
fn config_exists(db: DBHandler) -> Option<Config> {
2325
// lock db
@@ -28,6 +30,7 @@ fn config_exists(db: DBHandler) -> Option<Config> {
2830
```
2931

3032
Node polls for config until it exists in database
33+
3134
```rust
3235
fn poll_config(db: DBHandler) -> Option<Config> {
3336
loop {
@@ -39,6 +42,7 @@ fn poll_config(db: DBHandler) -> Option<Config> {
3942
```
4043

4144
Check if config has been updated
45+
4246
```rust
4347
fn config_updated(db: DBHandler) -> Option<Config> {
4448
// lock db
@@ -51,6 +55,7 @@ fn config_updated(db: DBHandler) -> Option<Config> {
5155
## Updates
5256

5357
Continually race to update database
58+
5459
```rust
5560
fn index_follower_data(db: DBHandler, stream: FollowerIo)-> Result<(), Err> {
5661
loop {
@@ -63,6 +68,7 @@ fn index_follower_data(db: DBHandler, stream: FollowerIo)-> Result<(), Err> {
6368

6469
Check most recent update on cardano update table
6570
If it falls within the threshold boundary, node should update db with latest data
71+
6672
```rust
6773
fn database_ready_to_update(db: DBHandler) -> bool {
6874
// lock db
@@ -73,6 +79,7 @@ fn database_ready_to_update(db: DBHandler) -> bool {
7379
```
7480

7581
Update database with follower data
82+
7683
```rust
7784
fn update_database(db: DBHandler, stream: FollowerIo) -> Result<(), Err> {
7885
// lock db
@@ -85,13 +92,15 @@ fn update_database(db: DBHandler, stream: FollowerIo) -> Result<(), Err> {
8592
```
8693

8794
Parse block
95+
8896
```rust
8997
fn parse(block: Block) -> Result<MetaBlock, Err> {
9098
// extract era, UTXO, spent TXs and registration metadata
9199
}
92100
```
93101

94102
Calculate if threshold conditional has been met
103+
95104
```rust
96105
fn update_threshold(last_updated: ThresholdMetric) -> bool {
97106
// threshold calculation

0 commit comments

Comments
 (0)