Skip to content

Commit

Permalink
architecture api page draft
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Oct 26, 2023
1 parent ea66b21 commit 2161b24
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/developers/architecture/architecture-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
id: architecture-api
title: SC API architecture
---

[comment]: # (mx-abstract)

There is quite a long way from smart contract code to VM hook calls.

[comment]: # (mx-context-auto)

## Components overview

```mermaid
graph BT
sc[Smart Contract code]
sc --> wrapper[Api Wrapper]
wrapper --> api[Api]
api --> UncallableApi --> ABI
api --> VmApiImpl --> wasm-imports[Wasm FFI Imports]
wasm-imports --> wasm[.wasm binary] --> Wasmer
api --> VMHooksApi
Wasmer --> |hooks| capi[C API] --> go-vm[Go VM]
Wasmer -.->|hooks| TxContextStack
subgraph VMHooksApi["VMHooksApi<Backend>"]
StaticApi
DebugApi
SingleTxApi
end
DebugApi --> DebugApiBackend
DebugApiBackend ---->|hooks| TxContextStack
DebugApiBackend -->|static data| StaticVarStack
StaticApi --> StaticApiBackend
StaticApiBackend --->|hooks| STATIC_API_VH_CELL
StaticApiBackend -->|static data| STATIC_API_STATIC_CELL
SingleTxApi --> SingleTxApiBackend
SingleTxApiBackend --->|hooks| SINGLE_TX_API_VH_CELL
SingleTxApiBackend -->|static data| SINGLE_TX_API_STATIC_CELL
TxContextStack --> context[Rust VM]
```
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const sidebars = {
label: "Architecture",
items: [
"developers/architecture/architecture-overview",
"developers/architecture/architecture-api",
],
},
],
Expand Down

0 comments on commit 2161b24

Please sign in to comment.