-
Notifications
You must be signed in to change notification settings - Fork 247
Usage Patterns
Ivan Tomilov edited this page Sep 21, 2017
·
3 revisions
status-go has a number of customisations for go-ethereum and many of them are usually not obvious. Nor what status-react is present in human-readable form.
This page serves as a place with a collection of random facts about how status-react uses status-go. This should be revised and structured and currently just a quick start.
- React Native, which is used for running app itself, this env can call web3 through CallRPC and we have a full control over code inside this env
- webviews: among other things Status is dapp browser, so users can run dapps in the webview and we inject web3 object into webview in order to make this happen. We don’t have control over code inside this env, it’s third party. All calls to web3 inside webview are passed to CallRPC as well
- jail (otto vm): we are using this env in order to allow third party to define commands and different bot’s behaviour in chat. Calls to web3 are handled internally on go side, so we don’t use CallRPC at least from status-react side here. Ans again, code is written by third parties, except our own bots
- JNI signals: https://github.com/status-im/status-go/wiki/Notes-on-Bindings
The source:
Consumer->Go Bindings: Call
Go Bindings->statusAPI: JailCall
statusAPI->Jail: Call
Jail->JailCell: Call
note right of JailCell: cell.Lock()
JailCell->Otto: Call
Otto->+web3: eth_whateverWithoutCallback
web3->jail: Send
note left of jail: cell.Unlock()
note over jail: RPC calls and VM interactions
note left of jail: cell.Lock()
web3-->-Otto: result
note right of JailCell: cell.Unlock()
Consumer->Go Bindings: Call
Go Bindings->statusAPI: JailCall
statusAPI->Jail: Call
Jail->JailCell: Call
note right of JailCell: cell.Lock()
JailCell->Otto: Call
Otto->+web3: eth_whateverWithCallback
web3->jail: SendAsync
web3-->-Otto: otto.UndefinedValue()
note right of JailCell: cell.Unlock()
note over jail: RPC calls and VM interactions
When the (async) handler of /send
command is executed, the callback doesn’t return till the transaction queue is committed (confirmed), but immediately we got confirmation from jail about transaction being added (“transaction.queued” event).
Also, some insights can be found in https://github.com/status-im/status-go/wiki/Notes-on-Bindings
Project Information
Getting started
Developers
Support
Internal