Skip to content

Commit 2161b24

Browse files
architecture api page draft
1 parent ea66b21 commit 2161b24

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
id: architecture-api
3+
title: SC API architecture
4+
---
5+
6+
[comment]: # (mx-abstract)
7+
8+
There is quite a long way from smart contract code to VM hook calls.
9+
10+
[comment]: # (mx-context-auto)
11+
12+
## Components overview
13+
14+
```mermaid
15+
graph BT
16+
sc[Smart Contract code]
17+
sc --> wrapper[Api Wrapper]
18+
wrapper --> api[Api]
19+
api --> UncallableApi --> ABI
20+
api --> VmApiImpl --> wasm-imports[Wasm FFI Imports]
21+
wasm-imports --> wasm[.wasm binary] --> Wasmer
22+
api --> VMHooksApi
23+
Wasmer --> |hooks| capi[C API] --> go-vm[Go VM]
24+
Wasmer -.->|hooks| TxContextStack
25+
subgraph VMHooksApi["VMHooksApi<Backend>"]
26+
StaticApi
27+
DebugApi
28+
SingleTxApi
29+
end
30+
DebugApi --> DebugApiBackend
31+
DebugApiBackend ---->|hooks| TxContextStack
32+
DebugApiBackend -->|static data| StaticVarStack
33+
StaticApi --> StaticApiBackend
34+
StaticApiBackend --->|hooks| STATIC_API_VH_CELL
35+
StaticApiBackend -->|static data| STATIC_API_STATIC_CELL
36+
SingleTxApi --> SingleTxApiBackend
37+
SingleTxApiBackend --->|hooks| SINGLE_TX_API_VH_CELL
38+
SingleTxApiBackend -->|static data| SINGLE_TX_API_STATIC_CELL
39+
TxContextStack --> context[Rust VM]
40+
```

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ const sidebars = {
128128
label: "Architecture",
129129
items: [
130130
"developers/architecture/architecture-overview",
131+
"developers/architecture/architecture-api",
131132
],
132133
},
133134
],

0 commit comments

Comments
 (0)