Comments (5)
A nice brief intro to keys from the Suibase Cookbook
from suibase.
Hey @mario4tier ,
Do you have/know an opensource JavaScript/TypeScript API to manage Sui keys? Should it be just Sui cli system calls?
Does VSCode extension have access to Sui cli in terms of permissions?
from suibase.
I recommend to do it with Sui cli call. Not aware of an API that does this.
Two locations the shell call can be done from (the code is already doing this from both places):
(1) From the "core" of the VSCode extension (not the webview).
(2) From the suibase-daemon (this is a JSON-RPC backend for the extension).
The advantage of the suibase-daemon is there is only one writer to the files (shell commands are serialized). Less possibility of messing up the files and better "single source of truth" when, say, there are two competing VSCode extension.
Doing it directly from the VSCode extension is simpler and would be good enough for a "first phase" implementation.
What is that core vs webview twist?
You might already know this, but saying just in case. In a VSCode extension a Webview (e.g. the "Suibase dashboard") does not run always on the same machine as the "core" VSCode extension. This happen when people do remote development (e.g. windows WSL).
Only the "core" of the extension is guaranteed to run on the machine where the sui.keystore files are located (and suibase-daemon is running).
This is why you will see in the code the Webview exchanging messages with the core to perform the shell calls (and get any backend data).
I have implemented all such message passing to conveniently work with react, and can walk you through this code as needed.
Typescript "Core" extension:~/suibase/typescript/vscode-extension/src
Typescript/react "webview": ~/suibase/typescript/vscode-extension/webview-ui
Some shell commands: ~/suibase/typescript/vscode-extension/src/SuibaseExec.ts
Example of a related view<->core messages in ~/suibase/typescript/vscode-extension/src/common/ViewMessages.ts
:
from suibase.
The same visually:
This seems over-complicated, but it is necessary. The suibase-daemon is polling the filesystem to maintain a "single source of truth" and be the backend.
I do not have a lot of front-end experience, and wondering if something like redux would help to synchronize the webviews with the backend (keeping in mind that the "Core" extension is an intermediate)? For now, I did develop my own "data versioning polling" to minimize heavy data transfer.
from suibase.
Thank you for the detailed explanation of how Suibase VSCode extension communicates with Suibase backend @mario4tier.
I need to learn it further.
from suibase.
Related Issues (20)
- Implement easier Sui call on CLI + "Suibase registry"?
- Remove pre-requesites installation HOT 6
- VSCode extension update should automate update of the backend daemon
- Add Walrus integration docs to Suibase website HOT 2
- Suibase - Add GraphQL support
- Add safe retry on failed "sui_getObject" JSON-RPC HOT 2
- "localnet regen" fails building binaries on Mysten Labs 'main' branch HOT 1
- Integrate address "alias" feature HOT 1
- Reduce suibase-daemon.log size HOT 1
- Misleading warning when localnet is configured to use testnet branch.
- Consider adding a templating system to "move new"
- 'lsof' need to be installed on Arch Linux
- Invalid private key format error HOT 6
- error in sui-exec.sh HOT 2
- DTP integration HOT 1
- Github action to install Suibase + Sui binaries HOT 1
- Better mac installation devex
- MacOS: Failed to extract binary. Trying to re-download again HOT 8
- Feature: Switch from Sui binaries to Docker images HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from suibase.