---
# System prepended metadata

title: Architecture overview of Mosaic node
tags: [' draft', docs]

---

---
title: Architecture overview of Mosaic node
tags: docs, draft
---

# Mosaic node architecture

Mosaic streams node. Layout of code components:
```graphviz
digraph Mosaic{
        node[shape=record]
        
        Cmd
        eth [label="Ethereum" shape=box];
        App [label="AppProxy"]
        Nde
        Landscape
        
        Explorer
        GraphQL;
        subgraph cluster_brd {
            Boards
            Net [label="Threads"]
            Libp2p
            
            Switch
            subgraph cluster_reactors{
                View
                Slice
                ViewReactor
                SliceReactor
            }
        }
 
        Cmd -> {App Nde Landscape};
        Nde -> {Boards, Scout};
        Landscape -> {Explorer};
        Landscape -> Scout;

        Scout->Boards

        Explorer -> {GraphQL eth};
        GraphQL -> eth;

        App -> {Slice View};
        View->ViewReactor;
        Slice->SliceReactor;
        ViewReactor -> Switch;
        SliceReactor -> Switch;
        Boards -> {Net Libp2p Switch}
        Net -> Libp2p
        
        {rank=same; App Nde Landscape}
	}
```


## Structured ACL message flow

A board creates a context to separate message flows so that the libp2p network can prioritise peer connections closer to boards of interest to the node.
Threads ensure ACL enforcement, and grouping for easy cleanup of outdated messages.
Logs are append-only single-writer logs, ensuring authentication and ordering of message by author.

```
    Board (contract representation)
     |--Threads (groups ACL with service and read key encryption)
         |--Logs (appended by a single writer participating in the board)
              |--Messages (topicId identifies reactor responsible)
```

A tuple `(BoardID, TopicID)` forms a `locus` defining "where" and "what" (about) a message is.