> For the complete documentation index, see [llms.txt](https://myben.gitbook.io/ben-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://myben.gitbook.io/ben-platform/sdlc/development/architecture/container.md).

# Container

Mermaid diagrams

{% hint style="info" %}
Mermaid diagrams require javascript enabled.&#x20;
{% endhint %}

Ben Wallet mobile app

{% @mermaid/diagram content="C4Container
Person(user, "Ben Wallet user")
Container(wallet\_app, "Ben Wallet mobile app", "Kotlin + Jetpack Compose", "Account management, Balances, Local Stats, Settings, Tx Info")
Container(ben\_rpc, "Ben RPC", "Rust +Axum (jsonrpsee transport)", "Harvest, Plant (seed) and Grow (work)")

Container\_Boundary(android\_services, "Android OS Services") {
Container(android\_cm, "Android Credential Manager API", "OS Service, C++", "Passkeys")
Container(android\_ndk, "Android Native modules", ".so modules", "GPU & OS-ops")
}

Container\_Boundary(launchtube\_services, "Launchtube Services") {
Container\_Ext(launchtube, "Launchtube API", "typescript", "Tx Sponsorship, Fee-Bump, Launchtube Tokens")
}

Container\_Boundary(stellar, "Stellar Network : Edge") {
Container\_Ext(mainnet\_rpc, "Stellar Mainnet RPC", "go", "Simulations")
}

BiRel(user, wallet\_app, "interacts")
Rel(wallet\_app, ben\_rpc, "calls")
Rel(wallet\_app, android\_cm, "uses")
Rel(wallet\_app, android\_ndk, "uses")
BiRel(ben\_rpc, launchtube, "interacts")
BiRel(ben\_rpc, mainnet\_rpc, "calls")

UpdateRelStyle(wallet\_app, ben\_rpc, $offsetY="-20", $offsetX="-10")
UpdateRelStyle(wallet\_app, android\_cm, $offsetY="80", $offsetX="-60")
UpdateRelStyle(wallet\_app, android\_ndk, $offsetY="180", $offsetX="-105")
UpdateRelStyle(ben\_rpc, launchtube, $offsetY="80", $offsetX="-50")
UpdateRelStyle(ben\_rpc, mainnet\_rpc, $offsetY="80", $offsetX="40")

UpdateElementStyle(wallet\_app, $bgColor="green")
UpdateElementStyle(launchtube, $bgColor="black")
UpdateElementStyle(mainnet\_rpc, $bgColor="black")
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="3")
" %}

***

Ben RPC

{% @mermaid/diagram content="C4Container
Container(wallet\_app, "Ben Wallet mobile app")

Container\_Boundary(shuttle, "Shuttle.dev") {
Container(lt\_token\_mgr, "Launchtube Token Manager", "Rust", "Manages available Launchtube tokens")
Container(ben\_rpc, "Ben RPC", "Rust + Axum (jsonrpsee transport)", "Harvest, Plant (seed) and Grow (work)")
ContainerDb(lt\_token\_mgr\_db, "Launchtube Tokens", "PostgreSQL", "Token accounting")
Container(ben\_openstats, "Ben OpenStats", "Rust + PostgreSQL")
}

Container\_Boundary(launchtube\_services, "Launchtube Services") {
Container\_Ext(launchtube\_api, "Launchtube API", "typescript", "Tx Sponsorship, Fee-Bump, Launchtube Tokens")
}

Container\_Boundary(stellar, "Stellar Network : Edge") {
Container\_Ext(mainnet\_rpc, "Mainnet RPC", "", "KALE-related operations, KALE SAC")
}

System\_Boundary(stellar\_kale, "Stellar Network : Soroban") {
System\_Ext(kale\_homestead, "Kale Homestead", "Smart Contract")
}

Rel(wallet\_app, ben\_rpc, "interacts")
Rel(ben\_rpc, lt\_token\_mgr, "uses")
Rel(lt\_token\_mgr, lt\_token\_mgr\_db, "uses")
Rel(ben\_rpc, ben\_openstats, "logs")

Rel(ben\_rpc, launchtube\_api, "uses")
Rel(launchtube\_api, mainnet\_rpc, "uses")
Rel(mainnet\_rpc, kale\_homestead, "calls")

UpdateRelStyle(ben\_rpc, launchtube\_api, $offsetX="-10", $offsetY="10")
UpdateRelStyle(ben\_rpc, ben\_openstats, $offsetX="10", $offsetY="10")
UpdateRelStyle(launchtube\_api, mainnet\_rpc, $offsetX="-10", $offsetY="12")

UpdateElementStyle(wallet\_app, $bgColor="green")
UpdateElementStyle(launchtube\_api, $bgColor="black")
UpdateElementStyle(mainnet\_rpc, $bgColor="black")
UpdateElementStyle(kale\_homestead, $bgColor="gold", $fontColor="#000")

UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="2")
" %}

KALE Homestead: [CDL74RF5BLYR2YBLCCI7F5FB6TPSCLKEJUBSD2RSVWZ4YHF3VMFAIGWA](https://stellar.expert/explorer/public/contract/CDL74RF5BLYR2YBLCCI7F5FB6TPSCLKEJUBSD2RSVWZ4YHF3VMFAIGWA)

***

Ben OpenStats

{% @mermaid/diagram content="C4Container
Container(ben\_rpc, "Ben RPC")

Boundary(ben\_openstats, "Ben OpenStats") {
Container(ben\_openstats\_api, "Ben OpenStats API", "Rust + Axum", "API for logging")
ContainerDb(ben\_db, "Database", "PostgreSQL", "per tx logs, per account logs, per harvest logs, per block logs")
Container\_Ext(ben\_indexer, "Ben Indexer", "Rust +Sqlx (eval: +Zephyr)", "Indexer for Kale Homestead Smart Contract")
}

System\_Boundary(stellar\_kale, "Stellar Network : Soroban") {
System\_Ext(kale\_homestead, "Kale Homestead", "Smart Contract")
System\_Ext(kale\_sac, "Kale SAC", "Smart Contract")
}

Rel(ben\_rpc, ben\_openstats\_api, "uses")
Rel(ben\_openstats\_api, ben\_db, "feeds")
Rel(ben\_indexer, ben\_db, "feeds")
Rel(kale\_homestead, ben\_indexer, "updates contract instance + temporary data")
Rel(kale\_sac, ben\_indexer, "emits events")

UpdateElementStyle(ben\_rpc, $bgColor="green")

UpdateRelStyle(ben\_indexer, ben\_db, $offsetY="-20")
UpdateRelStyle(ben\_rpc, ben\_openstats\_api, $offsetY="-20")
UpdateRelStyle(kale\_homestead, ben\_indexer, $offsetX="-350", $offsetY="-10")

UpdateElementStyle(kale\_homestead, $bgColor="gold", $fontColor="#000")
UpdateElementStyle(kale\_sac, $bgColor="gold", $fontColor="#000")
UpdateElementStyle(ben\_indexer, $bgColor="purple")

UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")

" %}
