grin/doc/wallet/design/wallet-arch.puml
Yeastplume 5ba163fa66
Provide wallet 'plugin' architecture (#1983)
* remove receive_coinbase fn from wallet to wallet client

* start moving clients into separate mod

* rustfmt

* move wallet client + start listener into wallet 'clients'

* rustfmt

* refactor API to make it more modular and completely decouple sending

* rustfmt

* further decouple API from sending methods

* rustfmt

* remove wallet to wallet client trait

* rustfmt

* rename / refactor client + adapters

* rustfmt

* add adapter concept

* add midding node_clients dir

* add file and null adapters

* rustfmt

* remove receive from owner api

* factor out receiving slates into trait

* rustfmt

* adding listen trait

* rustfmt

* change listener to use trait

* rustfmt

* add test for file-based exchange

* replace http api send command

* rustfmt

* move controller out of libwallet and into top-level wallet dir

* rustfmt

* add moved controller
2018-11-19 19:47:40 +00:00

110 lines
No EOL
2.7 KiB
Text

@startuml grin-wallet-overview
skinparam componentStyle uml2
[Grin Node] as grin_node
folder "Provided by Grin" as services {
component foreign_api [
**Foreign API**
External-Facing functions
- receive_tx, build coinbase
]
component owner_api [
**Owner API**
Functions used by wallet owner only
- retrieve outputs, retrieve txs,
get balances, send, etc. . .
]
component libtx [
**Transaction Library (libTx)**
Lower-Level transaction functions
- Build transaction (via Slate), sign,
build reward, fees, etc. . .
]
component libwallet [
**Wallet Library (libWallet) **
- Higher level wallet functions (select coins,
update wallet from node, etc)
- Service Controller
(instantiate libs, start listeners)
]
() "Owner HTTP Listener (localhost only)" as owner_http
() "Foreign HTTP Listener" as foreign_http
() "Owner Single-Use" as owner_single
() "Foreign Single-Use" as foreign_single
}
' Trait definitions
package "Traits Implemented by Wallets" as traits {
database "WalletBackend" as wallet_backend
database "KeyChain" as keychain
component "NodeClient" as wallet_client
}
note left of wallet_client
- Communication layer implementation
- Handles underlying communication with grin node
or other wallets
- HTTP implementation provided currently, (Other,
more secure protocols possible.)
end note
note bottom of keychain
- Handles all key derivation operations
end note
note bottom of wallet_backend
- Implements underlying storage for wallet data
- LMDB storage provided in default client, others
possible (Flat-file, other DBs, etc)
end note
libtx <--> traits
libwallet <--> traits
note right of traits
**Default Wallet simply a struct that provides**
**implementations for these 3 traits**
end note
' Client Side
'package "Provided as reference implementation" {
[Pure JS Wallet Client Implementation] as js_client
[Command Line Wallet Client] as cl_client
component web_server [
V. Light Rust Web Server - Serve static files (TBD)
(Provided by default - localhost only)
(Serve up pure JS client)
]
'}
[External Wallets] as external_wallets
[External Wallets] as external_wallets_2
wallet_client <--> grin_node
wallet_client <--> external_wallets_2
web_server <--> owner_http
js_client <-- web_server
cl_client <--> owner_single
cl_client <--> foreign_single
owner_single <--> owner_api
foreign_single <--> foreign_api
libwallet <--> libtx
foreign_api --> libwallet
owner_api --> libwallet
js_client <--> owner_http
owner_http <--> owner_api
external_wallets <--> foreign_http
foreign_http <--> foreign_api
'layout fix
'grin_node -[hidden]- wallet_backend
@enduml