-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #634 from kinode-dao/dr/settings-userspace-api
add settings userspace WIT API
- Loading branch information
Showing
7 changed files
with
262 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
interface settings { | ||
variant request { | ||
/// lazy-load-blob: none. | ||
hi(hi-request), | ||
/// lazy-load-blob: none. | ||
peer-id(string), | ||
/// lazy-load-blob: none. | ||
eth-config(eth-config-request), | ||
/// lazy-load-blob: none. | ||
shutdown, | ||
/// lazy-load-blob: none. | ||
reset, | ||
/// lazy-load-blob: none. | ||
kill-process(string), | ||
/// lazy-load-blob: none. | ||
set-stylesheet(string), | ||
} | ||
|
||
type response = result<option<settings-data>, settings-error>; | ||
|
||
record hi-request { | ||
node: string, | ||
content: string, | ||
timeout: u64, | ||
} | ||
|
||
/// A subset of the actions that can be taken on the `eth` | ||
/// runtime module. These are mostly used by the settings frontend. | ||
variant eth-config-request { | ||
add-provider(provider-config), | ||
remove-provider(tuple<u64, string>), | ||
set-public, | ||
set-private, | ||
allow-node(string), | ||
unallow-node(string), | ||
deny-node(string), | ||
undeny-node(string), | ||
} | ||
|
||
/// This will be converted to the ProviderConfig type used in `eth`. | ||
/// `trusted` in ProviderConfig will always be true. | ||
/// Rather than provide full NodeOrRpcUrl, the settings | ||
/// process will fetch KNS update for node-providers | ||
/// and convert this to the type used in `eth`. | ||
record provider-config { | ||
chain-id: u64, | ||
node-or-rpc-url: node-or-rpc-url, | ||
} | ||
|
||
variant node-or-rpc-url { | ||
node(string), | ||
rpc-url(string), | ||
} | ||
|
||
variant settings-data { | ||
peer-id(identity), | ||
} | ||
|
||
record identity { | ||
name: string, | ||
networking-key: string, | ||
routing: node-routing, | ||
} | ||
|
||
variant node-routing { | ||
routers(list<string>), | ||
direct(direct), | ||
} | ||
|
||
record direct { | ||
ip: string, | ||
ports: list<tuple<string, u16>>, | ||
} | ||
|
||
variant settings-error { | ||
hi-timeout, | ||
hi-offline, | ||
kernel-nonresponsive, | ||
malformed-request, | ||
state-fetch-failed, | ||
} | ||
} | ||
|
||
world settings-sys-v0 { | ||
import settings; | ||
include process-v1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.