This is an old revision of the document!
Table of Contents
Peonect Architecture
Overview
Site
Site is base compute unit of Peonect network. It consists of a web server that serves local connections and authenticates users. Its functions are:
- Authenticate user (a site normally has one user, preferably with unique domain)
- Execute memo apps (see later)
- Hold users memos, provide pserver interface
- Keep track of folders with subscribers, notify pServer on changes
- delete “foreign” Memos that are not referenced anymore
Memo App
Memo is data structure that has associated data handler, similarily to data and code separation in OOP. Code is written in Lua and is executed in sandbox. API methods to read and call referenced Memos allows writing sophisticated applications.
Exported Folders
Memos are stored into Folders in “Private” area, that is visible to owner only. User might choose to mark some folders as externally accessible, for others to be able to see them. Exported folders have mandatory “Epoch” and “Digital Signature”. They also might be encrypted with public key of intended recipients, thus limiting who can see the content.
pCache server
Every Site is connected to a pCache server. It might be discovered by asking centralized “pCache servers registry”. It is publicly accessible and should be at location with good connectivity. The pCache servers perform functions below:
- retrieve list of subscriptions from sites under its control, send back matching Memos
- retrieve “exported” data from sites and share it to sites that request it. Cache the data.
- receive notifications from children sites about data change, forward them to upstream pServers or other sites
JQ queries
Microapps need to access data from other Memos. They can run jq queries on “known” Memos:
- what is default measurement system of the owner? Imperial or standard
- get list of neighbours who know me:
- find Memos of kind People and have homeAt geo and have Memo of kind Subscription where (site=me and kind Memo=Message)
- remove ones that have distance between me and homeAt more than 100 m
Stored queries (subscriptions) also use jq to find matching Memos: TBD How?
