mirror of
https://github.com/lux-apps/papers.git
synced 2026-11-03 05:07:46 +00:00
Restructured from flat .tex/.pdf files into per-paper subdirectories. Added Antje Worring as co-author on all papers. Synced PDFs to pdfs/ for download site.
75 lines
1.9 KiB
TeX
75 lines
1.9 KiB
TeX
\section{Horizontal Scaling Architecture}
|
|
|
|
|
|
\subsection{Node Types}
|
|
|
|
G-Chain supports three node deployment models:
|
|
|
|
\begin{enumerate}
|
|
\item \textbf{Full Sync Nodes}: Complete network state across all 8 chains
|
|
\item \textbf{Chain Sync Nodes}: Specific chains only (e.g., C-Chain + X-Chain for DEX)
|
|
\item \textbf{App Sync Nodes}: Application-specific subgraphs (e.g., DeFi protocols only)
|
|
\end{enumerate}
|
|
|
|
\begin{algorithm}[H]
|
|
\caption{Selective Synchronization}
|
|
\begin{algorithmic}[1]
|
|
\Function{SyncNode}{$config$}
|
|
\State $syncMode \gets config.syncMode$
|
|
\State $chainFilter \gets config.chainFilter$
|
|
|
|
\If{$syncMode = \text{FULL}$}
|
|
\State Subscribe to all chain events
|
|
\ElsIf{$syncMode = \text{CHAIN}$}
|
|
\For{each $chain$ in $chainFilter$}
|
|
\State Subscribe to $chain$ events
|
|
\EndFor
|
|
\ElsIf{$syncMode = \text{APP}$}
|
|
\State $subgraph \gets$ Load application subgraph definition
|
|
\State Subscribe to events matching $subgraph$ filters
|
|
\EndIf
|
|
|
|
\State Process incoming blocks and update GraphDB
|
|
\State Commit Verkle trie state
|
|
\State Publish state root to consensus
|
|
\EndFunction
|
|
\end{algorithmic}
|
|
\end{algorithm}
|
|
|
|
\subsection{Custom Indexing}
|
|
|
|
Applications can define custom indexes for optimized queries:
|
|
|
|
\begin{lstlisting}[language=YAML, basicstyle=\small\ttfamily]
|
|
# config.yaml
|
|
customIndexes:
|
|
- name: "token_transfers"
|
|
chains: [C, X]
|
|
nodeType: "Transfer"
|
|
fields:
|
|
- name: "from"
|
|
type: "address"
|
|
indexed: true
|
|
- name: "to"
|
|
type: "address"
|
|
indexed: true
|
|
- name: "amount"
|
|
type: "uint256"
|
|
indexed: false
|
|
|
|
- name: "defi_positions"
|
|
chains: [C]
|
|
nodeType: "Position"
|
|
fields:
|
|
- name: "user"
|
|
type: "address"
|
|
indexed: true
|
|
- name: "protocol"
|
|
type: "string"
|
|
indexed: true
|
|
- name: "collateral"
|
|
type: "uint256"
|
|
indexed: false
|
|
\end{lstlisting}
|
|
|