This commit is contained in:
dr-frmr 2024-07-08 15:13:59 +02:00
parent 276b3ec11f
commit 0bb97b61da
No known key found for this signature in database
30 changed files with 70 additions and 439 deletions

38
Cargo.lock generated
View File

@ -3210,25 +3210,9 @@ dependencies = [
"wit-bindgen",
]
[[package]]
name = "kimap_indexer"
version = "0.1.0"
dependencies = [
"alloy-primitives",
"alloy-sol-types",
"anyhow",
"bincode",
"hex",
"kinode_process_lib 0.8.3 (git+https://github.com/kinode-dao/process_lib?rev=c8442ef)",
"rmp-serde",
"serde",
"serde_json",
"wit-bindgen",
]
[[package]]
name = "kinode"
version = "0.8.2"
version = "0.9.0"
dependencies = [
"aes-gcm",
"alloy",
@ -3285,7 +3269,7 @@ dependencies = [
[[package]]
name = "kinode_lib"
version = "0.8.2"
version = "0.9.0"
dependencies = [
"lib",
]
@ -3415,6 +3399,22 @@ dependencies = [
"zip 0.6.6",
]
[[package]]
name = "kns_indexer"
version = "0.1.0"
dependencies = [
"alloy-primitives",
"alloy-sol-types",
"anyhow",
"bincode",
"hex",
"kinode_process_lib 0.8.3 (git+https://github.com/kinode-dao/process_lib?rev=c8442ef)",
"rmp-serde",
"serde",
"serde_json",
"wit-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
@ -3435,7 +3435,7 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
[[package]]
name = "lib"
version = "0.8.2"
version = "0.9.0"
dependencies = [
"alloy",
"kit",

View File

@ -1,7 +1,7 @@
[package]
name = "kinode_lib"
authors = ["KinodeDAO"]
version = "0.8.2"
version = "0.9.0"
edition = "2021"
description = "A general-purpose sovereign cloud computing platform"
homepage = "https://kinode.org"
@ -19,7 +19,7 @@ members = [
"kinode/packages/chess/chess",
"kinode/packages/homepage/homepage",
"kinode/packages/kino_updates/widget",
"kinode/packages/kimap_indexer/kimap_indexer", "kinode/packages/kimap_indexer/get_block", "kinode/packages/kimap_indexer/state",
"kinode/packages/kns_indexer/kns_indexer", "kinode/packages/kns_indexer/get_block", "kinode/packages/kns_indexer/state",
"kinode/packages/settings/settings",
"kinode/packages/terminal/terminal",
"kinode/packages/terminal/alias", "kinode/packages/terminal/cat", "kinode/packages/terminal/echo", "kinode/packages/terminal/hi", "kinode/packages/terminal/kfetch", "kinode/packages/terminal/kill", "kinode/packages/terminal/m", "kinode/packages/terminal/top",

View File

@ -1,7 +1,7 @@
[package]
name = "kinode"
authors = ["KinodeDAO"]
version = "0.8.2"
version = "0.9.0"
edition = "2021"
description = "A general-purpose sovereign cloud computing platform"
homepage = "https://kinode.org"

View File

@ -353,7 +353,7 @@ impl State {
// if they do, we update the metadata for the package.
// note: if either of hash/uri doens't match//errors, we probably shouldn't throw errors except for in verbose mode.
// TEMP WAIT while we solve kimap_indexer getting race condition
// TEMP WAIT while we solve kns_indexer getting race condition
std::thread::sleep(std::time::Duration::from_millis(100));
match log.topics()[0] {
Note::SIGNATURE_HASH => {

View File

@ -1,4 +1,4 @@
interface kimap-indexer {
interface kns-indexer {
/// IndexerRequests are used to query discrete information from the indexer
/// for example, if you want to know the human readable name for a namehash,
/// you would send a NamehashToName request.
@ -34,7 +34,7 @@ interface kimap-indexer {
}
}
world kimap-indexer-sys-v0 {
import kimap-indexer;
world kns-indexer-sys-v0 {
import kns-indexer;
include process-v0;
}

View File

@ -1,5 +1,5 @@
[package]
name = "kimap_indexer"
name = "kns_indexer"
version = "0.1.0"
edition = "2021"

View File

@ -1,4 +1,4 @@
use crate::kinode::process::kimap_indexer::{
use crate::kinode::process::kns_indexer::{
GetStateRequest, IndexerRequests, NamehashToNameRequest, NodeInfoRequest,
};
use alloy_primitives::{keccak256, FixedBytes};
@ -17,7 +17,7 @@ use std::{
wit_bindgen::generate!({
path: "target/wit",
world: "kimap-indexer-sys-v0",
world: "kns-indexer-sys-v0",
generate_unused_types: true,
additional_derives: [serde::Deserialize, serde::Serialize],
});
@ -318,7 +318,7 @@ fn handle_log(
let get_return = getCall::abi_decode_returns(&res, false)?;
let tba = get_return.tokenBoundAccount.to_string();
state.names.insert(child_hash.clone(), name.clone());
println!("got mint, name: {name}, child_hash: {child_hash}, tba: {tba}",);
// println!("got mint, name: {name}, child_hash: {child_hash}, tba: {tba}",);
state
.nodes
.entry(name.clone())
@ -351,7 +351,7 @@ fn handle_log(
let name = get_node_name(state, &node_hash);
println!("got note, from name: {name}, note: {note}, note_hash: {node_hash}",);
// println!("got note, from name: {name}, note: {note}, note_hash: {node_hash}",);
match note.as_str() {
"~ws-port" => {
let ws = bytes_to_port(&decoded.data);
@ -377,16 +377,14 @@ fn handle_log(
}
}
"~net-key" => {
let netkey = std::str::from_utf8(&decoded.data);
println!("decoded.data: {:?}\r", decoded.data);
// note silent errors here...
// print silently for debugging?
if let Ok(netkey) = netkey {
state.nodes.entry(name.clone()).and_modify(|node| {
let pubkey = hex::encode(netkey);
node.public_key = pubkey;
});
node = Some(name.clone());
}
state.nodes.entry(name.clone()).and_modify(|node| {
node.public_key = decoded.data.to_string();
println!("node.public_key: {}", node.public_key);
});
node = Some(name);
}
"~routers" => {
state.nodes.entry(name.clone()).and_modify(|node| {

View File

@ -1,9 +1,9 @@
{
"name": "KiMap Indexer",
"name": "KNS Indexer",
"description": "Kinode OS PKI indexer",
"image": "",
"properties": {
"package_name": "kimap_indexer",
"package_name": "kns_indexer",
"current_version": "0.2.1",
"publisher": "sys",
"mirrors": [],

View File

@ -1,7 +1,7 @@
[
{
"process_name": "kimap_indexer",
"process_wasm_path": "/kimap_indexer.wasm",
"process_name": "kns_indexer",
"process_wasm_path": "/kns_indexer.wasm",
"on_exit": "Restart",
"request_networking": false,
"request_capabilities": [
@ -15,4 +15,4 @@
],
"public": false
}
]
]

View File

@ -1 +1 @@
import{B as e,g as a,s as t,d as s,i as r,c as n,a as o,e as c,H as l,b as d}from"./index-DzA96B0X.js";class u extends e{constructor({callbackSelector:e,cause:t,data:s,extraData:r,sender:n,urls:o}){var c;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(null==(c=t.metaMessages)?void 0:c.length)?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map((e=>` ${a(e)}`))],` Sender: ${n}`,` Data: ${s}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class i extends e{constructor({result:e,url:s}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${a(s)}`,`Response: ${t(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class f extends e{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const p="0x556f1830",b={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function h(e,{blockNumber:a,blockTag:t,data:l,to:d}){const{args:i}=s({data:l,abi:[b]}),[p,h,y,w,g]=i,{ccipRead:k}=e,x=k&&"function"==typeof(null==k?void 0:k.request)?k.request:m;try{if(!r(d,p))throw new f({sender:p,to:d});const s=await x({data:y,sender:p,urls:h}),{data:l}=await n(e,{blockNumber:a,blockTag:t,data:o([w,c([{type:"bytes"},{type:"bytes"}],[s,g])]),to:d});return l}catch(O){throw new u({callbackSelector:w,cause:O,data:l,extraData:g,sender:p,urls:h})}}async function m({data:e,sender:a,urls:s}){var r;let n=new Error("An unknown error occurred.");for(let c=0;c<s.length;c++){const u=s[c],f=u.includes("{data}")?"GET":"POST",p="POST"===f?{data:e,sender:a}:void 0;try{const s=await fetch(u.replace("{sender}",a).replace("{data}",e),{body:JSON.stringify(p),method:f});let o;if(o=(null==(r=s.headers.get("Content-Type"))?void 0:r.startsWith("application/json"))?(await s.json()).data:await s.text(),!s.ok){n=new l({body:p,details:(null==o?void 0:o.error)?t(o.error):s.statusText,headers:s.headers,status:s.status,url:u});continue}if(!d(o)){n=new i({result:o,url:u});continue}return o}catch(o){n=new l({body:p,details:o.message,url:u})}}throw n}export{m as ccipRequest,h as offchainLookup,b as offchainLookupAbiItem,p as offchainLookupSignature};
import{B as e,g as a,s as t,d as s,i as r,c as n,a as o,e as c,H as l,b as d}from"./index-C3h8FZ1j.js";class u extends e{constructor({callbackSelector:e,cause:t,data:s,extraData:r,sender:n,urls:o}){var c;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(null==(c=t.metaMessages)?void 0:c.length)?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map((e=>` ${a(e)}`))],` Sender: ${n}`,` Data: ${s}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class i extends e{constructor({result:e,url:s}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${a(s)}`,`Response: ${t(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class f extends e{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const p="0x556f1830",b={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function h(e,{blockNumber:a,blockTag:t,data:l,to:d}){const{args:i}=s({data:l,abi:[b]}),[p,h,y,w,g]=i,{ccipRead:k}=e,x=k&&"function"==typeof(null==k?void 0:k.request)?k.request:m;try{if(!r(d,p))throw new f({sender:p,to:d});const s=await x({data:y,sender:p,urls:h}),{data:l}=await n(e,{blockNumber:a,blockTag:t,data:o([w,c([{type:"bytes"},{type:"bytes"}],[s,g])]),to:d});return l}catch(O){throw new u({callbackSelector:w,cause:O,data:l,extraData:g,sender:p,urls:h})}}async function m({data:e,sender:a,urls:s}){var r;let n=new Error("An unknown error occurred.");for(let c=0;c<s.length;c++){const u=s[c],f=u.includes("{data}")?"GET":"POST",p="POST"===f?{data:e,sender:a}:void 0;try{const s=await fetch(u.replace("{sender}",a).replace("{data}",e),{body:JSON.stringify(p),method:f});let o;if(o=(null==(r=s.headers.get("Content-Type"))?void 0:r.startsWith("application/json"))?(await s.json()).data:await s.text(),!s.ok){n=new l({body:p,details:(null==o?void 0:o.error)?t(o.error):s.statusText,headers:s.headers,status:s.status,url:u});continue}if(!d(o)){n=new i({result:o,url:u});continue}return o}catch(o){n=new l({body:p,details:o.message,url:u})}}throw n}export{m as ccipRequest,h as offchainLookup,b as offchainLookupAbiItem,p as offchainLookupSignature};

View File

@ -1,4 +1,4 @@
import{n as t,s as e,T as r,t as o,a as n,o as i,R as a,p as l,y as s}from"./index-D7cvRtKi.js";import{l as c,m as d}from"./index-DzA96B0X.js";
import{n as t,s as e,T as r,t as o,a as n,o as i,R as a,p as l,y as s}from"./index-CxVP-eNA.js";import{l as c,m as d}from"./index-C3h8FZ1j.js";
/**
* @license
* Copyright 2019 Google LLC

View File

@ -11,7 +11,7 @@
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport"
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1.00001, viewport-fit=cover" />
<script type="module" crossorigin src="/assets/index-DzA96B0X.js"></script>
<script type="module" crossorigin src="/assets/index-C3h8FZ1j.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CZgkhW69.css">
</head>

View File

@ -9,7 +9,6 @@
"version": "0.1.0",
"dependencies": {
"@ensdomains/eth-ens-namehash": "^2.0.15",
"@ethersproject/hash": "^5.7.0",
"@rainbow-me/rainbowkit": "^2.1.2",
"@szhsin/react-menu": "^4.1.0",
"@tanstack/react-query": "^5.45.1",
@ -3014,376 +3013,6 @@
"node": ">=14"
}
},
"node_modules/@ethersproject/abstract-provider": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz",
"integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/logger": "^5.7.0",
"@ethersproject/networks": "^5.7.0",
"@ethersproject/properties": "^5.7.0",
"@ethersproject/transactions": "^5.7.0",
"@ethersproject/web": "^5.7.0"
}
},
"node_modules/@ethersproject/abstract-signer": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz",
"integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/abstract-provider": "^5.7.0",
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/logger": "^5.7.0",
"@ethersproject/properties": "^5.7.0"
}
},
"node_modules/@ethersproject/address": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz",
"integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/keccak256": "^5.7.0",
"@ethersproject/logger": "^5.7.0",
"@ethersproject/rlp": "^5.7.0"
}
},
"node_modules/@ethersproject/base64": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz",
"integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bytes": "^5.7.0"
}
},
"node_modules/@ethersproject/bignumber": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz",
"integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/logger": "^5.7.0",
"bn.js": "^5.2.1"
}
},
"node_modules/@ethersproject/bytes": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz",
"integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/logger": "^5.7.0"
}
},
"node_modules/@ethersproject/constants": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz",
"integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bignumber": "^5.7.0"
}
},
"node_modules/@ethersproject/hash": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz",
"integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/address": "^5.7.0",
"@ethersproject/base64": "^5.7.0",
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/keccak256": "^5.7.0",
"@ethersproject/logger": "^5.7.0",
"@ethersproject/properties": "^5.7.0",
"@ethersproject/strings": "^5.7.0"
}
},
"node_modules/@ethersproject/keccak256": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz",
"integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bytes": "^5.7.0",
"js-sha3": "0.8.0"
}
},
"node_modules/@ethersproject/keccak256/node_modules/js-sha3": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz",
"integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q=="
},
"node_modules/@ethersproject/logger": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz",
"integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT"
},
"node_modules/@ethersproject/networks": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz",
"integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/logger": "^5.7.0"
}
},
"node_modules/@ethersproject/properties": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz",
"integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/logger": "^5.7.0"
}
},
"node_modules/@ethersproject/rlp": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz",
"integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/logger": "^5.7.0"
}
},
"node_modules/@ethersproject/signing-key": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz",
"integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/logger": "^5.7.0",
"@ethersproject/properties": "^5.7.0",
"bn.js": "^5.2.1",
"elliptic": "6.5.4",
"hash.js": "1.1.7"
}
},
"node_modules/@ethersproject/strings": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz",
"integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/constants": "^5.7.0",
"@ethersproject/logger": "^5.7.0"
}
},
"node_modules/@ethersproject/transactions": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz",
"integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/address": "^5.7.0",
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/constants": "^5.7.0",
"@ethersproject/keccak256": "^5.7.0",
"@ethersproject/logger": "^5.7.0",
"@ethersproject/properties": "^5.7.0",
"@ethersproject/rlp": "^5.7.0",
"@ethersproject/signing-key": "^5.7.0"
}
},
"node_modules/@ethersproject/web": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz",
"integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==",
"funding": [
{
"type": "individual",
"url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@ethersproject/base64": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/logger": "^5.7.0",
"@ethersproject/properties": "^5.7.0",
"@ethersproject/strings": "^5.7.0"
}
},
"node_modules/@hapi/hoek": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz",
@ -4446,8 +4075,6 @@
},
"node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/napi-wasm/-/napi-wasm-1.1.0.tgz",
"integrity": "sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==",
"inBundle": true,
"license": "MIT"
},

View File

@ -4,6 +4,7 @@
"private": true,
"proxy": "http://localhost:8080",
"dependencies": {
"@ensdomains/eth-ens-namehash": "^2.0.15",
"@rainbow-me/rainbowkit": "^2.1.2",
"@szhsin/react-menu": "^4.1.0",
"@tanstack/react-query": "^5.45.1",

View File

@ -47,12 +47,14 @@ export const generateNetworkingKeys = async ({
setTcpPort(tcp_port || 0);
setRouters(allowed_routers);
console.log("networking_key: ", networking_key);
const netkeycall = encodeFunctionData({
abi: kinomapAbi,
functionName: 'note',
args: [
encodePacked(["bytes"], [stringToHex("~net-key")]),
encodePacked(["bytes"], [stringToHex(networking_key)]),
encodePacked(["bytes"], [networking_key as `0x${string}`]),
]
});

View File

@ -691,7 +691,7 @@ pub async fn assign_routing(
};
let netkey = getCall::abi_decode_returns(&results.returnData[0], false)?;
let netkey_data = netkey.data;
let net_key = netkey.data;
let ws = getCall::abi_decode_returns(&results.returnData[1], false)?;
let ws_data = ws.data;
@ -702,8 +702,6 @@ pub async fn assign_routing(
let ip = getCall::abi_decode_returns(&results.returnData[3], false)?;
let ip_data = ip.data;
let net_key = std::str::from_utf8(&netkey_data)?;
let ip = keygen::bytes_to_ip(&ip_data);
let ws = keygen::bytes_to_port(&ws_data);
let tcp = keygen::bytes_to_port(&tcp_data);

View File

@ -104,11 +104,13 @@ pub async fn terminal(
}
let mut reader = EventStream::new();
let mut stdout = stdout.lock();
loop {
tokio::select! {
Some(printout) = print_rx.recv() => {
// lock here so that runtime can still use println! without freezing..
// can lock before loop later if we want to reduce overhead
let mut stdout = stdout.lock();
let now = Local::now();
// always write print to log if in logging mode
if logging_mode {
@ -153,6 +155,9 @@ pub async fn terminal(
)?;
}
Some(Ok(event)) = reader.next().fuse() => {
// lock here so that runtime can still use println! without freezing..
// can lock before loop later if we want to reduce overhead
let mut stdout = stdout.lock();
match event {
//
// RESIZE: resize is super annoying because this event trigger often

View File

@ -1,7 +1,7 @@
[package]
name = "lib"
authors = ["KinodeDAO"]
version = "0.8.2"
version = "0.9.0"
edition = "2021"
description = "A general-purpose sovereign cloud computing platform"
homepage = "https://kinode.org"