Merge branch 'develop' into hf/wit-apis

This commit is contained in:
doria 2024-05-14 10:43:15 +09:00 committed by GitHub
commit c032092edc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 218 additions and 132 deletions

98
Cargo.lock generated
View File

@ -78,7 +78,7 @@ name = "alias"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -649,7 +649,7 @@ dependencies = [
"alloy-sol-types 0.7.0", "alloy-sol-types 0.7.0",
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?rev=1ea6eda)", "kinode_process_lib 0.7.1",
"rand 0.8.5", "rand 0.8.5",
"serde", "serde",
"serde_json", "serde_json",
@ -1160,7 +1160,7 @@ name = "cat"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -1223,7 +1223,7 @@ dependencies = [
"anyhow", "anyhow",
"base64 0.22.0", "base64 0.22.0",
"bincode", "bincode",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"pleco", "pleco",
"serde", "serde",
"serde_json", "serde_json",
@ -1935,7 +1935,7 @@ name = "download"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -1966,7 +1966,7 @@ name = "echo"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -2186,7 +2186,7 @@ version = "0.2.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"rand 0.8.5", "rand 0.8.5",
"serde", "serde",
"serde_json", "serde_json",
@ -2346,7 +2346,7 @@ dependencies = [
name = "get_block" name = "get_block"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -2546,7 +2546,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
name = "hi" name = "hi"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -2576,7 +2576,7 @@ version = "0.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -2887,7 +2887,7 @@ name = "install"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -3151,52 +3151,8 @@ dependencies = [
[[package]] [[package]]
name = "kinode_process_lib" name = "kinode_process_lib"
version = "0.6.1" version = "0.7.1"
source = "git+https://github.com/kinode-dao/process_lib?tag=v0.6.1#37a20b0249dc2c86ae6c2c69cfb199fb177f1520" source = "git+https://github.com/kinode-dao/process_lib?tag=v0.7.2#61a8de975fd0a812a0a033ee0975fb83dd166224"
dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-primitives 0.6.4",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"anyhow",
"bincode",
"http 1.1.0",
"mime_guess",
"rand 0.8.5",
"rmp-serde",
"serde",
"serde_json",
"thiserror",
"url",
"wit-bindgen",
]
[[package]]
name = "kinode_process_lib"
version = "0.7.0"
source = "git+https://github.com/kinode-dao/process_lib?tag=v0.7.0#b7c0abee62df683e6c78069c87072a1d52602408"
dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"alloy-primitives 0.7.0",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"anyhow",
"bincode",
"http 1.1.0",
"mime_guess",
"rand 0.8.5",
"rmp-serde",
"serde",
"serde_json",
"thiserror",
"url",
"wit-bindgen",
]
[[package]]
name = "kinode_process_lib"
version = "0.7.0"
source = "git+https://github.com/kinode-dao/process_lib?rev=1ea6eda#1ea6edad610b02a6fecb307c67dfa51fba0fb0de"
dependencies = [ dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"alloy-primitives 0.7.0", "alloy-primitives 0.7.0",
@ -3315,7 +3271,7 @@ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"hex", "hex",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?rev=1ea6eda)", "kinode_process_lib 0.7.1",
"rmp-serde", "rmp-serde",
"serde", "serde",
"serde_json", "serde_json",
@ -3516,7 +3472,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"regex", "regex",
"serde", "serde",
"serde_json", "serde_json",
@ -3648,7 +3604,7 @@ dependencies = [
name = "namehash_to_name" name = "namehash_to_name"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"rmp-serde", "rmp-serde",
"serde", "serde",
"wit-bindgen", "wit-bindgen",
@ -3676,7 +3632,7 @@ dependencies = [
name = "net_diagnostics" name = "net_diagnostics"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"rmp-serde", "rmp-serde",
"serde", "serde",
"wit-bindgen", "wit-bindgen",
@ -3969,7 +3925,7 @@ dependencies = [
name = "peer" name = "peer"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"rmp-serde", "rmp-serde",
"serde", "serde",
"wit-bindgen", "wit-bindgen",
@ -3979,7 +3935,7 @@ dependencies = [
name = "peers" name = "peers"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"rmp-serde", "rmp-serde",
"serde", "serde",
"wit-bindgen", "wit-bindgen",
@ -4988,7 +4944,7 @@ dependencies = [
"anyhow", "anyhow",
"base64 0.22.0", "base64 0.22.0",
"bincode", "bincode",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.1",
"rmp-serde", "rmp-serde",
"serde", "serde",
"serde_json", "serde_json",
@ -5207,7 +5163,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
name = "state" name = "state"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -5373,7 +5329,7 @@ version = "0.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"rand 0.8.5", "rand 0.8.5",
"regex", "regex",
"serde", "serde",
@ -5387,7 +5343,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
@ -5401,7 +5357,7 @@ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"indexmap", "indexmap",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
@ -5642,7 +5598,7 @@ name = "top"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -5964,7 +5920,7 @@ name = "uninstall"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -6659,7 +6615,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.7.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.7.0)", "kinode_process_lib 0.7.1",
"serde", "serde",
"serde_json", "serde_json",
"url", "url",

View File

@ -11,7 +11,7 @@ alloy-primitives = "0.7.0"
alloy-sol-types = "0.7.0" alloy-sol-types = "0.7.0"
anyhow = "1.0" anyhow = "1.0"
bincode = "1.3.3" bincode = "1.3.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1ea6eda" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
rand = "0.8" rand = "0.8"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@ -8,7 +8,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -9,7 +9,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
bincode = "1.3.3" bincode = "1.3.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
rand = "0.8" rand = "0.8"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@ -8,7 +8,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -8,7 +8,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -10,7 +10,7 @@ simulation-mode = []
anyhow = "1.0" anyhow = "1.0"
base64 = "0.22.0" base64 = "0.22.0"
bincode = "1.3.3" bincode = "1.3.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
pleco = "0.5" pleco = "0.5"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@ -9,7 +9,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
bincode = "1.3.3" bincode = "1.3.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -9,7 +9,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
bincode = "1.3.3" bincode = "1.3.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
url = "2.5.0" url = "2.5.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
simulation-mode = [] simulation-mode = []
[dependencies] [dependencies]
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -12,7 +12,7 @@ alloy-primitives = "0.7.0"
alloy-sol-types = "0.7.0" alloy-sol-types = "0.7.0"
bincode = "1.3.3" bincode = "1.3.3"
hex = "0.4.3" hex = "0.4.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1ea6eda" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag="v0.7.2" }
rmp-serde = "1.1.2" rmp-serde = "1.1.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
simulation-mode = [] simulation-mode = []
[dependencies] [dependencies]
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -12,45 +12,58 @@
<body> <body>
<h1>system diagnostics & settings</h1> <h1>system diagnostics & settings</h1>
<main> <main>
<article id="net-diagnostics">
<h2>networking diagnostics</h2>
<p id="diagnostics"></p>
</article>
<article id="node-info"> <article id="node-info">
<p>node info</p> <h2>node info</h2>
<p id="node-name"></p> <p id="node-name"></p>
<p id="net-key"></p> <p id="net-key"></p>
<p id="ip-ports"></p> <p id="ip-ports"></p>
<p id="routers"></p> <p id="routers"></p>
<button>reset networking key</button> <button>reset networking key (TODO)</button>
<button>adjust networking info</button> <button>adjust networking info (TODO)</button>
<button id="shutdown">shut down node</button> <button id="shutdown">shut down node</button>
</article> </article>
<article id="net-diagnostics">
<p>networking diagnostics</p>
<p id="diagnostics"></p>
</article>
<article id="pings"> <article id="pings">
<p>fetch PKI data</p> <h2>fetch PKI data</h2>
<form id="get-peer-pki"> <form id="get-peer-pki">
<input type="text" name="peer" placeholder="peer-name.os"> <input type="text" name="peer" placeholder="peer-name.os">
<button type="submit">get peer info</button> <button type="submit">get peer info</button>
</form> </form>
<p id="peer-pki-response"></p> <p id="peer-pki-response"></p>
<p>ping a node</p> <h2>ping a node</h2>
<form id="ping-peer"> <form id="ping-peer">
<input type="text" name="peer" placeholder="peer-name.os"> <input type="text" name="peer" placeholder="peer-name.os">
<input type="text" name="content" placeholder="message"> <input type="text" name="content" placeholder="message">
<label><input type="number" name="timeout">timeout (seconds)</label> <input type="number" name="timeout" placeholder="timeout (seconds)">
<button type="submit">ping</button> <button type="submit">ping</button>
</form> </form>
<p id="peer-ping-response"></p> <p id="peer-ping-response"></p>
</article> </article>
<article id="eth-rpc-providers"> <article id="eth-rpc-providers">
<p>ETH RPC providers</p> <h2>ETH RPC providers</h2>
<div id="provider-edits">
<form id="add-eth-provider">
<input type="number" name="chain-id" placeholder="1">
<input type="text" name="rpc-url" placeholder="wss://rpc-url.com">
<button type="submit">add provider</button>
</form>
<form id="remove-eth-provider">
<input type="number" name="chain-id" placeholder="1">
<input type="text" name="rpc-url" placeholder="wss://rpc-url.com">
<button type="submit">remove provider</button>
</form>
</div>
<ul id="providers"></ul> <ul id="providers"></ul>
</article> </article>
<article id="eth-rpc-settings"> <article id="eth-rpc-settings">
<p>ETH RPC settings</p> <h2>ETH RPC settings</h2>
<p id="public"></p> <p id="public"></p>
<div> <div>
<p>nodes allowed to connect:</p> <p>nodes allowed to connect:</p>
@ -63,7 +76,7 @@
</article> </article>
<article id="kernel"> <article id="kernel">
<p>running processes:</p> <h2>running processes</h2>
<p>(TODO)</p> <p>(TODO)</p>
<ul></ul> <ul></ul>
</article> </article>

View File

@ -56,17 +56,17 @@ function populate_eth_rpc_providers(providers) {
ul.innerHTML = ''; ul.innerHTML = '';
providers.forEach(provider => { providers.forEach(provider => {
const li = document.createElement('li'); const li = document.createElement('li');
li.innerHTML = `<li>${JSON.stringify(provider)}</li>`; li.innerHTML = `${JSON.stringify(provider, undefined, 2)}`;
ul.appendChild(li); ul.appendChild(li);
}); });
} }
function populate_eth_rpc_settings(settings) { function populate_eth_rpc_settings(settings) {
if (settings.public) { if (settings.public) {
document.getElementById('public').innerText = 'public'; document.getElementById('public').innerText = 'status: public';
document.getElementById('allowed-nodes').style.display = 'none'; document.getElementById('allowed-nodes').style.display = 'none';
} else { } else {
document.getElementById('public').innerText = 'private'; document.getElementById('public').innerText = 'status: private';
const ul = document.getElementById('allowed-nodes'); const ul = document.getElementById('allowed-nodes');
ul.innerHTML = ''; ul.innerHTML = '';
if (settings.allow.length === 0) { if (settings.allow.length === 0) {
@ -119,7 +119,8 @@ document.getElementById('get-peer-pki').addEventListener('submit', (e) => {
if (data === null) { if (data === null) {
document.getElementById('peer-pki-response').innerText = "no pki data for peer"; document.getElementById('peer-pki-response').innerText = "no pki data for peer";
} else { } else {
document.getElementById('peer-pki-response').innerText = JSON.stringify(data); e.target.reset();
document.getElementById('peer-pki-response').innerText = JSON.stringify(data, undefined, 2);
} }
}); });
}) })
@ -143,6 +144,7 @@ document.getElementById('ping-peer').addEventListener('submit', (e) => {
}).then(response => response.json()) }).then(response => response.json())
.then(data => { .then(data => {
if (data === null) { if (data === null) {
e.target.reset();
document.getElementById('peer-ping-response').innerText = "ping successful!"; document.getElementById('peer-ping-response').innerText = "ping successful!";
} else if (data === "HiTimeout") { } else if (data === "HiTimeout") {
document.getElementById('peer-ping-response').innerText = "node timed out"; document.getElementById('peer-ping-response').innerText = "node timed out";
@ -152,6 +154,66 @@ document.getElementById('ping-peer').addEventListener('submit', (e) => {
}); });
}) })
document.getElementById('add-eth-provider').addEventListener('submit', (e) => {
e.preventDefault();
const data = new FormData(e.target);
const rpc_url = data.get('rpc-url');
// validate rpc url
if (!rpc_url.startsWith('wss://') && !rpc_url.startsWith('ws://')) {
alert('Invalid RPC URL');
return;
}
const body = {
"EthConfig": {
"AddProvider": {
chain_id: Number(data.get('chain-id')),
trusted: false,
provider: { "RpcUrl": rpc_url },
}
}
};
fetch(APP_PATH, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
}).then(response => response.json())
.then(data => {
if (data === null) {
e.target.reset();
return;
} else {
alert(data);
}
});
})
document.getElementById('remove-eth-provider').addEventListener('submit', (e) => {
e.preventDefault();
const data = new FormData(e.target);
const body = {
"EthConfig": {
"RemoveProvider": [Number(data.get('chain-id')), data.get('rpc-url')]
}
};
fetch(APP_PATH, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
}).then(response => response.json())
.then(data => {
if (data === null) {
e.target.reset();
return;
} else {
alert(data);
}
});
})
// Setup WebSocket connection // Setup WebSocket connection
const wsProtocol = location.protocol === 'https:' ? 'wss://' : 'ws://'; const wsProtocol = location.protocol === 'https:' ? 'wss://' : 'ws://';
const ws = new WebSocket(wsProtocol + location.host + "/settings:settings:sys/"); const ws = new WebSocket(wsProtocol + location.host + "/settings:settings:sys/");

View File

@ -82,14 +82,58 @@ h1 {
} }
main { main {
margin: 0 auto;
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-template-columns: 1fr 1fr 1fr;
gap: 20px; gap: 20px 20px;
grid-auto-flow: row;
grid-template-areas:
"diagnostics diagnostics diagnostics"
"node-info pings pings"
"eth-rpc-providers eth-rpc-providers eth-rpc-settings"
"kernel kernel kernel";
padding: 20px; padding: 20px;
max-width: 1200px; max-width: 1100px;
min-width: 300px; min-width: 300px;
} }
article#net-diagnostics {
grid-area: diagnostics;
}
p#diagnostics,
p#peer-pki-response,
p#peer-ping-response {
white-space: pre-wrap;
}
article#node-info {
grid-area: node-info;
}
article#pings {
grid-area: pings;
}
article#eth-rpc-providers {
grid-area: eth-rpc-providers;
}
article#eth-rpc-settings {
grid-area: eth-rpc-settings;
}
article#kernel {
grid-area: kernel;
}
div#provider-edits {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px 20px;
grid-auto-flow: row;
}
article { article {
background-color: #333; background-color: #333;
border: 1px solid #444; border: 1px solid #444;
@ -129,11 +173,20 @@ button {
border-radius: 4px; border-radius: 4px;
} }
button#shutdown {
background-color: #f44336;
}
button:hover { button:hover {
background-color: white; background-color: white;
color: #4CAF50; color: #4CAF50;
} }
button#shutdown:hover {
background-color: white;
color: #f44336;
}
input[type="text"], input[type="text"],
input[type="number"], input[type="number"],
select, select,
@ -178,4 +231,5 @@ li {
background-color: #2c2c2c; background-color: #2c2c2c;
border-radius: 4px; border-radius: 4px;
word-wrap: break-word; word-wrap: break-word;
white-space: pre-wrap;
} }

View File

@ -10,7 +10,7 @@ simulation-mode = []
anyhow = "1.0" anyhow = "1.0"
base64 = "0.22.0" base64 = "0.22.0"
bincode = "1.3.3" bincode = "1.3.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag="v0.7.2" }
rmp-serde = "1.2.0" rmp-serde = "1.2.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@ -243,16 +243,18 @@ fn handle_http_request(
state: &mut SettingsState, state: &mut SettingsState,
http_request: &http::IncomingHttpRequest, http_request: &http::IncomingHttpRequest,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
state.fetch()?;
match http_request.method()?.as_str() { match http_request.method()?.as_str() {
"GET" => Ok(http::send_response( "GET" => {
http::StatusCode::OK, state.fetch()?;
Some(HashMap::from([( Ok(http::send_response(
String::from("Content-Type"), http::StatusCode::OK,
String::from("application/json"), Some(HashMap::from([(
)])), String::from("Content-Type"),
serde_json::to_vec(&state)?, String::from("application/json"),
)), )])),
serde_json::to_vec(&state)?,
))
}
"POST" => { "POST" => {
let Some(blob) = get_blob() else { let Some(blob) = get_blob() else {
return Ok(http::send_response( return Ok(http::send_response(
@ -263,6 +265,7 @@ fn handle_http_request(
}; };
let request = serde_json::from_slice::<SettingsRequest>(&blob.bytes)?; let request = serde_json::from_slice::<SettingsRequest>(&blob.bytes)?;
let response = handle_settings_request(state, request); let response = handle_settings_request(state, request);
state.fetch()?;
state.ws_update(); state.ws_update();
Ok(http::send_response( Ok(http::send_response(
http::StatusCode::OK, http::StatusCode::OK,

View File

@ -8,7 +8,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -8,7 +8,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -8,7 +8,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
simulation-mode = [] simulation-mode = []
[dependencies] [dependencies]
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -9,7 +9,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
clap = "4.4.18" clap = "4.4.18"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
regex = "1.10.3" regex = "1.10.3"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
simulation-mode = [] simulation-mode = []
[dependencies] [dependencies]
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
rmp-serde = "1.1.2" rmp-serde = "1.1.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
simulation-mode = [] simulation-mode = []
[dependencies] [dependencies]
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
rmp-serde = "1.1.2" rmp-serde = "1.1.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
simulation-mode = [] simulation-mode = []
[dependencies] [dependencies]
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
rmp-serde = "1.1.2" rmp-serde = "1.1.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
simulation-mode = [] simulation-mode = []
[dependencies] [dependencies]
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
rmp-serde = "1.1.2" rmp-serde = "1.1.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -9,7 +9,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
bincode = "1.3.3" bincode = "1.3.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
rand = "0.8" rand = "0.8"
regex = "1.10.3" regex = "1.10.3"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View File

@ -8,7 +8,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
wit-bindgen = "0.24.0" wit-bindgen = "0.24.0"

View File

@ -9,7 +9,7 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
bincode = "1.3.3" bincode = "1.3.3"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
thiserror = "1.0" thiserror = "1.0"

View File

@ -10,7 +10,7 @@ simulation-mode = []
anyhow = "1.0" anyhow = "1.0"
bincode = "1.3.3" bincode = "1.3.3"
indexmap = "2.1" indexmap = "2.1"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
thiserror = "1.0" thiserror = "1.0"

View File

@ -411,13 +411,11 @@ async fn maintain_remote_subscription(
&send_to_loop, &send_to_loop,
).await; ).await;
} }
incoming = net_error_rx.recv() => { _incoming = net_error_rx.recv() => {
if let Some(Err(_net_error)) = incoming { break EthSubError {
break EthSubError { id: sub_id,
id: sub_id, error: "subscription node-provider failed keepalive".to_string(),
error: "subscription node-provider failed keepalive".to_string(), };
};
}
} }
_ = tokio::time::sleep_until(last_received + two_hours) => { _ = tokio::time::sleep_until(last_received + two_hours) => {
break EthSubError { break EthSubError {