-
Notifications
You must be signed in to change notification settings - Fork 35
Grid Architecture #523
Description
Some notes on the new architecture that I envision:
Electron App Manager
Electron app manager used to implement a lot of functionality beyond updating. All backend functionality will be moved upstream into ehtpkg.
The app loading functionality will be moved into a separate module app-pkg-server aka "Packaged App Server".
After the refactoring, the electron-app-manager will just implement updating strategies and use ethpkg and packaged-app-server for package queries and app loading respectively.
Ethpkg
Will become a more feature powered package manager. It will implement different backend APIs and abstract from how and where packages are hosted. Key to this functionality are digital signatures.
The CLI will be extended to list and query packages which is helpful for debugging:

Packaged App Server
Will download a packaged web app from an arbitrary location using ethpkg and serve the contents with a web server or custom protocol handler.
Grid Core
Will be decoupled from Electron logic. This allows for Grid to be run headless on CI servers, in test runners, scripts etc.
Moreover: we will replace the ElectronIpc transport layer with a versioned RPC API so that other components and apps can make use of the functionality. Examples include Remix or VSCode plugins and Apps like the BlockExplorer or RPCTester running in a browser.
Grid Core will probably provide a similar CLI like ethpkg (see screenshots above) which additionally includes binary specific logic.
Grid (Electron)
Will become a thin wrapper around grid-core. The goal is to remove the injected API apart from some window managing and OS specific logic and use instead the json rpc API like other apps.
For the updating of grid-ui and the management of grid apps it will use the app-pkg-server which can be run in two modes:
- Electron webviews
- Browser
Plugin System
The plugin system can be used to extend Grid functionality in a secure way. All plugins need to be signed and we can include a set of trusted addresses with Grid. Plugins are similar to JSON file but and should only export a configuration object. They are evaluated in a sandbox that has access to some platform and os onformation to dynamically adjust settings but does NOT have access to NodeJS modules or any dependencies i.e. require() won't work. The remix team expressed interest to join forces and find synergies between their and our plugin system.
Grid Client
Is a module that Grid apps can include to have a nicer interface that abstracts from RPC calls. This hopefully allows grid apps to run in a browser withour the webview that grid-electron currently provides and without injected API.

