Skip to content

Commit 9165009

Browse files
Merge pull request #82 from chronicleprotocol/diagramPush
Add PUSH Oracle diagram in Mermaid
2 parents 8cad9af + 2431283 commit 9165009

File tree

5 files changed

+881
-203
lines changed

5 files changed

+881
-203
lines changed

docs/Intro/dive/offchain.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
sidebar_position: 2
3+
---
14
# Off-Chain Components
25

36
- **Validator** (aka Feed) Creates usable information out of raw data that is read from various Origins. Validators query Origins no matter whether they are on-chain or off-chain for the price data. The Validator transform the original data into Chronicle data by using Data Models. After the Chronicle data is calculated it is signed and sent to the peer-to-peer network.

docs/Intro/dive/pushOracle.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# PUSH Oracles
6+
7+
**Chronicle uses a PUSH model for its Oracles.**
8+
9+
## How do PUSH Oracles Work?
10+
PUSH oracles actively deliver data to smart contracts without needing an explicit request. Upon the occurrence of a specific event or condition, the PUSH oracle automatically triggers the smart contract with the relevant data. For example, a PUSH Oracle might send price data to a smart contract every X minutes/hours, or whenever the price deviates by a certain percentage from its previous value.
11+
12+
13+
```mermaid
14+
sequenceDiagram
15+
16+
participant DS as Data Source<br />(offchain)
17+
participant PO as PUSH Oracle<br />(offchain)
18+
participant OC as Oracle Smart Contract<br />(onchain)
19+
participant SC as Smart Contract
20+
21+
DS->>PO: Event or condition occurs
22+
PO->>OC: Push data to Oracle Smart Contract
23+
OC->>OC: Process data and update the state
24+
SC->>OC: Request data from Oracle
25+
OC->>SC: Deliver data to Smart Contract
26+
SC->>SC: Process and use data
27+
```

docusaurus.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ const config = {
6262
}),
6363
],
6464
],
65+
markdown: {
66+
mermaid: true
67+
},
68+
69+
themes: ['@docusaurus/theme-mermaid'],
6570

6671
themeConfig:
6772
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
@@ -76,6 +81,9 @@ const config = {
7681
textColor: '#1C1E21',
7782
isCloseable: false,
7883
},
84+
mermaid: {
85+
theme: {light: 'neutral', dark: 'forest'},
86+
},
7987
navbar: {
8088
title: 'Chronicle Docs',
8189
logo: {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@cookbookdev/docsbot": "^4.21.5",
1818
"@docusaurus/core": "3.0.1",
1919
"@docusaurus/preset-classic": "3.0.1",
20+
"@docusaurus/theme-mermaid": "3.0.1",
2021
"@iconify/react": "^5.0.2",
2122
"@markprompt/docusaurus-theme-search": "^0.26.1",
2223
"@mdx-js/react": "^3.0.0",

0 commit comments

Comments
 (0)