fix: kns_indexer, update all packages to process_lib 0.7.0, change default providers

This commit is contained in:
dr-frmr 2024-04-24 03:40:57 +09:00
parent a0e78c1978
commit cca3133b61
No known key found for this signature in database
38 changed files with 435 additions and 242 deletions

367
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.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -90,36 +90,85 @@ version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
[[package]]
name = "alloy-consensus"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"alloy-primitives 0.7.0",
"alloy-rlp",
"alloy-serde",
"c-kzg",
"serde",
"sha2",
]
[[package]] [[package]]
name = "alloy-eips" name = "alloy-eips"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-rlp", "alloy-rlp",
"serde", "serde",
"thiserror", "thiserror",
] ]
[[package]]
name = "alloy-eips"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [
"alloy-primitives 0.7.0",
"alloy-rlp",
"alloy-serde",
"c-kzg",
"once_cell",
"serde",
]
[[package]]
name = "alloy-genesis"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [
"alloy-primitives 0.7.0",
"alloy-serde",
"serde",
]
[[package]] [[package]]
name = "alloy-json-rpc" name = "alloy-json-rpc"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives 0.6.4",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
] ]
[[package]]
name = "alloy-json-rpc"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [
"alloy-primitives 0.7.0",
"serde",
"serde_json",
"thiserror",
"tracing",
]
[[package]] [[package]]
name = "alloy-network" name = "alloy-network"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-eips", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-json-rpc", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-rlp", "alloy-rlp",
"serde", "serde",
] ]
@ -146,17 +195,39 @@ dependencies = [
"tiny-keccak", "tiny-keccak",
] ]
[[package]]
name = "alloy-primitives"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99bbad0a6b588ef4aec1b5ddbbfdacd9ef04e00b979617765b03174318ee1f3a"
dependencies = [
"alloy-rlp",
"bytes",
"cfg-if",
"const-hex",
"derive_more",
"hex-literal",
"itoa",
"k256",
"keccak-asm",
"proptest",
"rand 0.8.5",
"ruint",
"serde",
"tiny-keccak",
]
[[package]] [[package]]
name = "alloy-providers" name = "alloy-providers"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-network", "alloy-network",
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-rpc-client", "alloy-rpc-client",
"alloy-rpc-trace-types", "alloy-rpc-trace-types",
"alloy-rpc-types", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-transport", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-transport-http", "alloy-transport-http",
"async-trait", "async-trait",
"auto_impl", "auto_impl",
@ -170,9 +241,9 @@ name = "alloy-pubsub"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-json-rpc", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-transport", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"bimap", "bimap",
"futures", "futures",
"serde", "serde",
@ -209,10 +280,10 @@ name = "alloy-rpc-client"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-json-rpc", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-pubsub", "alloy-pubsub",
"alloy-transport", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-transport-http", "alloy-transport-http",
"alloy-transport-ws", "alloy-transport-ws",
"futures", "futures",
@ -230,8 +301,8 @@ name = "alloy-rpc-trace-types"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-rpc-types", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"serde", "serde",
"serde_json", "serde_json",
] ]
@ -241,7 +312,7 @@ name = "alloy-rpc-types"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-rlp", "alloy-rlp",
"itertools 0.12.1", "itertools 0.12.1",
"serde", "serde",
@ -249,13 +320,41 @@ dependencies = [
"thiserror", "thiserror",
] ]
[[package]]
name = "alloy-rpc-types"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [
"alloy-consensus",
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"alloy-genesis",
"alloy-primitives 0.7.0",
"alloy-rlp",
"alloy-serde",
"alloy-sol-types 0.7.0",
"itertools 0.12.1",
"serde",
"serde_json",
"thiserror",
]
[[package]]
name = "alloy-serde"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [
"alloy-primitives 0.7.0",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "alloy-signer" name = "alloy-signer"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-network", "alloy-network",
"alloy-primitives", "alloy-primitives 0.6.4",
"async-trait", "async-trait",
"auto_impl", "auto_impl",
"elliptic-curve", "elliptic-curve",
@ -278,18 +377,63 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.60", "syn 2.0.60",
"syn-solidity", "syn-solidity 0.6.4",
"tiny-keccak", "tiny-keccak",
] ]
[[package]]
name = "alloy-sol-macro"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "452d929748ac948a10481fff4123affead32c553cf362841c5103dd508bdfc16"
dependencies = [
"alloy-sol-macro-input",
"const-hex",
"heck 0.4.1",
"indexmap",
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.60",
"syn-solidity 0.7.0",
"tiny-keccak",
]
[[package]]
name = "alloy-sol-macro-input"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df64e094f6d2099339f9e82b5b38440b159757b6920878f28316243f8166c8d1"
dependencies = [
"const-hex",
"dunce",
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.60",
"syn-solidity 0.7.0",
]
[[package]] [[package]]
name = "alloy-sol-types" name = "alloy-sol-types"
version = "0.6.4" version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad09ec5853fa700d12d778ad224dcdec636af424d29fad84fb9a2f16a5b0ef09" checksum = "ad09ec5853fa700d12d778ad224dcdec636af424d29fad84fb9a2f16a5b0ef09"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-sol-macro", "alloy-sol-macro 0.6.4",
"const-hex",
"serde",
]
[[package]]
name = "alloy-sol-types"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43bc2d6dfc2a19fd56644494479510f98b1ee929e04cf0d4aa45e98baa3e545b"
dependencies = [
"alloy-primitives 0.7.0",
"alloy-sol-macro 0.7.0",
"const-hex", "const-hex",
"serde", "serde",
] ]
@ -299,7 +443,7 @@ name = "alloy-transport"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-json-rpc", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"base64 0.21.7", "base64 0.21.7",
"futures-util", "futures-util",
"serde", "serde",
@ -311,13 +455,31 @@ dependencies = [
"wasm-bindgen-futures", "wasm-bindgen-futures",
] ]
[[package]]
name = "alloy-transport"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"base64 0.22.0",
"futures-util",
"futures-utils-wasm",
"serde",
"serde_json",
"thiserror",
"tokio",
"tower",
"url",
"wasm-bindgen-futures",
]
[[package]] [[package]]
name = "alloy-transport-http" name = "alloy-transport-http"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-json-rpc", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-transport", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"reqwest 0.11.27", "reqwest 0.11.27",
"serde_json", "serde_json",
"tower", "tower",
@ -330,7 +492,7 @@ version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [ dependencies = [
"alloy-pubsub", "alloy-pubsub",
"alloy-transport", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"futures", "futures",
"http 0.2.12", "http 0.2.12",
"serde_json", "serde_json",
@ -417,13 +579,13 @@ checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
[[package]] [[package]]
name = "app_store" name = "app_store"
version = "0.3.0" version = "0.3.1"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives 0.7.0",
"alloy-sol-types", "alloy-sol-types 0.7.0",
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"rand 0.8.5", "rand 0.8.5",
"serde", "serde",
"serde_json", "serde_json",
@ -778,6 +940,18 @@ dependencies = [
"generic-array 0.14.7", "generic-array 0.14.7",
] ]
[[package]]
name = "blst"
version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b"
dependencies = [
"cc",
"glob",
"threadpool",
"zeroize",
]
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.16.0" version = "3.16.0"
@ -826,6 +1000,20 @@ dependencies = [
"pkg-config", "pkg-config",
] ]
[[package]]
name = "c-kzg"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3130f3d8717cc02e668a896af24984d5d5d4e8bf12e278e982e0f1bd88a0f9af"
dependencies = [
"blst",
"cc",
"glob",
"hex",
"libc",
"serde",
]
[[package]] [[package]]
name = "cap-fs-ext" name = "cap-fs-ext"
version = "3.0.0" version = "3.0.0"
@ -908,7 +1096,7 @@ name = "cat"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -966,12 +1154,12 @@ dependencies = [
[[package]] [[package]]
name = "chess" name = "chess"
version = "0.2.0" version = "0.2.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.22.0", "base64 0.22.0",
"bincode", "bincode",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"pleco", "pleco",
"serde", "serde",
"serde_json", "serde_json",
@ -1683,7 +1871,7 @@ name = "download"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -1714,7 +1902,7 @@ name = "echo"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -1934,7 +2122,7 @@ version = "0.2.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"rand 0.8.5", "rand 0.8.5",
"serde", "serde",
"serde_json", "serde_json",
@ -2042,6 +2230,12 @@ dependencies = [
"slab", "slab",
] ]
[[package]]
name = "futures-utils-wasm"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9"
[[package]] [[package]]
name = "fxhash" name = "fxhash"
version = "0.2.1" version = "0.2.1"
@ -2088,7 +2282,7 @@ dependencies = [
name = "get_block" name = "get_block"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -2288,7 +2482,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
name = "hi" name = "hi"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -2314,11 +2508,11 @@ dependencies = [
[[package]] [[package]]
name = "homepage" name = "homepage"
version = "0.1.0" version = "0.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -2629,7 +2823,7 @@ name = "install"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -2788,17 +2982,17 @@ dependencies = [
[[package]] [[package]]
name = "kinode" name = "kinode"
version = "0.7.0" version = "0.7.1"
dependencies = [ dependencies = [
"aes-gcm", "aes-gcm",
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-providers", "alloy-providers",
"alloy-pubsub", "alloy-pubsub",
"alloy-rpc-client", "alloy-rpc-client",
"alloy-rpc-types", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-signer", "alloy-signer",
"alloy-sol-macro", "alloy-sol-macro 0.6.4",
"alloy-sol-types", "alloy-sol-types 0.6.4",
"alloy-transport-ws", "alloy-transport-ws",
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -2861,7 +3055,7 @@ dependencies = [
[[package]] [[package]]
name = "kinode_lib" name = "kinode_lib"
version = "0.7.0" version = "0.7.1"
dependencies = [ dependencies = [
"lib", "lib",
] ]
@ -2871,10 +3065,10 @@ name = "kinode_process_lib"
version = "0.6.0" version = "0.6.0"
source = "git+https://github.com/kinode-dao/process_lib?rev=84b3d84#84b3d84c7c31185f15691a288f1b45dbffb18fe2" source = "git+https://github.com/kinode-dao/process_lib?rev=84b3d84#84b3d84c7c31185f15691a288f1b45dbffb18fe2"
dependencies = [ dependencies = [
"alloy-json-rpc", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-primitives", "alloy-primitives 0.6.4",
"alloy-rpc-types", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-transport", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"anyhow", "anyhow",
"bincode", "bincode",
"http 1.1.0", "http 1.1.0",
@ -2889,13 +3083,13 @@ dependencies = [
[[package]] [[package]]
name = "kinode_process_lib" name = "kinode_process_lib"
version = "0.6.1" version = "0.7.0"
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.0#b7c0abee62df683e6c78069c87072a1d52602408"
dependencies = [ dependencies = [
"alloy-json-rpc", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"alloy-primitives", "alloy-primitives 0.7.0",
"alloy-rpc-types", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"alloy-transport", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cad7935)",
"anyhow", "anyhow",
"bincode", "bincode",
"http 1.1.0", "http 1.1.0",
@ -2945,14 +3139,14 @@ dependencies = [
[[package]] [[package]]
name = "kns_indexer" name = "kns_indexer"
version = "0.2.0" version = "0.2.1"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives 0.7.0",
"alloy-sol-types", "alloy-sol-types 0.7.0",
"anyhow", "anyhow",
"bincode", "bincode",
"hex", "hex",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"rmp-serde", "rmp-serde",
"serde", "serde",
"serde_json", "serde_json",
@ -2979,9 +3173,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
[[package]] [[package]]
name = "lib" name = "lib"
version = "0.7.0" version = "0.7.1"
dependencies = [ dependencies = [
"alloy-rpc-types", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"anyhow", "anyhow",
"kit", "kit",
"lazy_static", "lazy_static",
@ -3153,7 +3347,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"regex", "regex",
"serde", "serde",
"serde_json", "serde_json",
@ -3285,7 +3479,7 @@ dependencies = [
name = "namehash_to_name" name = "namehash_to_name"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"rmp-serde", "rmp-serde",
"serde", "serde",
"wit-bindgen", "wit-bindgen",
@ -3313,7 +3507,7 @@ dependencies = [
name = "net_diagnostics" name = "net_diagnostics"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"rmp-serde", "rmp-serde",
"serde", "serde",
"wit-bindgen", "wit-bindgen",
@ -3606,7 +3800,7 @@ dependencies = [
name = "peer" name = "peer"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"rmp-serde", "rmp-serde",
"serde", "serde",
"wit-bindgen", "wit-bindgen",
@ -3616,7 +3810,7 @@ dependencies = [
name = "peers" name = "peers"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"rmp-serde", "rmp-serde",
"serde", "serde",
"wit-bindgen", "wit-bindgen",
@ -4829,7 +5023,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
name = "state" name = "state"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -4910,6 +5104,18 @@ dependencies = [
"syn 2.0.60", "syn 2.0.60",
] ]
[[package]]
name = "syn-solidity"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4497156948bd342b52038035a6fa514a89626e37af9d2c52a5e8d8ebcc7ee479"
dependencies = [
"paste",
"proc-macro2",
"quote",
"syn 2.0.60",
]
[[package]] [[package]]
name = "sync_wrapper" name = "sync_wrapper"
version = "0.1.2" version = "0.1.2"
@ -4979,11 +5185,11 @@ dependencies = [
[[package]] [[package]]
name = "terminal" name = "terminal"
version = "0.1.0" version = "0.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"rand 0.8.5", "rand 0.8.5",
"regex", "regex",
"serde", "serde",
@ -4997,7 +5203,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
@ -5006,12 +5212,12 @@ dependencies = [
[[package]] [[package]]
name = "tester" name = "tester"
version = "0.1.0" version = "0.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
"indexmap", "indexmap",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
@ -5048,6 +5254,15 @@ dependencies = [
"once_cell", "once_cell",
] ]
[[package]]
name = "threadpool"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa"
dependencies = [
"num_cpus",
]
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.36" version = "0.3.36"
@ -5243,7 +5458,7 @@ name = "top"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",
@ -5565,7 +5780,7 @@ name = "uninstall"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kinode_process_lib 0.6.1", "kinode_process_lib 0.7.0",
"serde", "serde",
"serde_json", "serde_json",
"wit-bindgen", "wit-bindgen",

View File

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

View File

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

View File

@ -1,17 +1,17 @@
[package] [package]
name = "app_store" name = "app_store"
version = "0.3.0" version = "0.3.1"
edition = "2021" edition = "2021"
[features] [features]
simulation-mode = [] simulation-mode = []
[dependencies] [dependencies]
alloy-primitives = "0.6.2" alloy-primitives = "0.7.0"
alloy-sol-types = "0.6.2" 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", tag = "v0.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -41,6 +41,7 @@ const ICON: &str = include_str!("icon");
const CHAIN_ID: u64 = 10; // optimism const CHAIN_ID: u64 = 10; // optimism
const CONTRACT_ADDRESS: &str = "0x52185B6a6017E6f079B994452F234f7C2533787B"; // optimism const CONTRACT_ADDRESS: &str = "0x52185B6a6017E6f079B994452F234f7C2533787B"; // optimism
const CONTRACT_FIRST_BLOCK: u64 = 118_590_088;
const EVENTS: [&str; 3] = [ const EVENTS: [&str; 3] = [
"AppRegistered(uint256,string,bytes,string,bytes32)", "AppRegistered(uint256,string,bytes,string,bytes32)",

View File

@ -111,7 +111,7 @@ impl State {
crate::print_to_terminal(1, "producing new state"); crate::print_to_terminal(1, "producing new state");
let mut state = State { let mut state = State {
contract_address, contract_address,
last_saved_block: 1, last_saved_block: crate::CONTRACT_FIRST_BLOCK,
package_hashes: HashMap::new(), package_hashes: HashMap::new(),
listed_packages: HashMap::new(), listed_packages: HashMap::new(),
downloaded_packages: HashMap::new(), downloaded_packages: HashMap::new(),
@ -371,14 +371,16 @@ impl State {
.ok_or(anyhow::anyhow!("got log with no block number"))? .ok_or(anyhow::anyhow!("got log with no block number"))?
.try_into()?; .try_into()?;
// let package_hash: alloy_primitives::U256 = log.topics[1].into(); match log.topics()[0] {
// let package_hash = package_hash.to_string();
match log.topics[0] {
AppRegistered::SIGNATURE_HASH => { AppRegistered::SIGNATURE_HASH => {
let package_hash = log.topics[1]; let package_hash = log.topics()[1];
let (package_name, publisher_dnswire, metadata_url, metadata_hash) =
AppRegistered::abi_decode_data(&log.data, true)?; let app = AppRegistered::decode_log_data(log.data(), false)?;
let package_name = app.packageName;
let publisher_dnswire = app.publisherName;
let metadata_url = app.metadataUrl;
let metadata_hash = app.metadataHash;
let package_hash = package_hash.to_string(); let package_hash = package_hash.to_string();
let metadata_hash = metadata_hash.to_string(); let metadata_hash = metadata_hash.to_string();
@ -390,13 +392,14 @@ impl State {
), ),
); );
if generate_package_hash(&package_name, publisher_dnswire.as_slice()) if generate_package_hash(&package_name, publisher_dnswire.to_vec().as_slice())
!= package_hash != package_hash
{ {
return Err(anyhow::anyhow!("got log with mismatched package hash")); return Err(anyhow::anyhow!("got log with mismatched package hash"));
} }
let Ok(publisher_name) = dnswire_decode(publisher_dnswire.as_slice()) else { let Ok(publisher_name) = dnswire_decode(publisher_dnswire.to_vec().as_slice())
else {
return Err(anyhow::anyhow!("got log with invalid publisher name")); return Err(anyhow::anyhow!("got log with invalid publisher name"));
}; };
@ -430,9 +433,12 @@ impl State {
self.insert_listing(package_hash, listing); self.insert_listing(package_hash, listing);
} }
AppMetadataUpdated::SIGNATURE_HASH => { AppMetadataUpdated::SIGNATURE_HASH => {
let package_hash = log.topics[1].to_string(); let package_hash = log.topics()[1].to_string();
let (metadata_url, metadata_hash) =
AppMetadataUpdated::abi_decode_data(&log.data, false)?; let upd = AppMetadataUpdated::decode_log_data(log.data(), false)?;
let metadata_url = upd.metadataUrl;
let metadata_hash = upd.metadataHash;
let metadata_hash = metadata_hash.to_string(); let metadata_hash = metadata_hash.to_string();
let current_listing = self let current_listing = self
@ -484,9 +490,9 @@ impl State {
} }
} }
Transfer::SIGNATURE_HASH => { Transfer::SIGNATURE_HASH => {
let from = alloy_primitives::Address::from_word(log.topics[1]); let from = alloy_primitives::Address::from_word(log.topics()[1]);
let to = alloy_primitives::Address::from_word(log.topics[2]); let to = alloy_primitives::Address::from_word(log.topics()[2]);
let package_hash = log.topics[3].to_string(); let package_hash = log.topics()[3].to_string();
if from == alloy_primitives::Address::ZERO { if from == alloy_primitives::Address::ZERO {
match self.get_listing_with_hash_mut(&package_hash) { match self.get_listing_with_hash_mut(&package_hash) {

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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -4,11 +4,11 @@
"image": "", "image": "",
"properties": { "properties": {
"package_name": "app_store", "package_name": "app_store",
"current_version": "0.3.0", "current_version": "0.3.1",
"publisher": "sys", "publisher": "sys",
"mirrors": [], "mirrors": [],
"code_hashes": { "code_hashes": {
"0.3.0": "" "0.3.1": ""
} }
}, },
"external_url": "https://kinode.org", "external_url": "https://kinode.org",

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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -1,6 +1,6 @@
[package] [package]
name = "chess" name = "chess"
version = "0.2.0" version = "0.2.1"
edition = "2021" edition = "2021"
[features] [features]
@ -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.0" }
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

@ -4,11 +4,11 @@
"image": "", "image": "",
"properties": { "properties": {
"package_name": "chess", "package_name": "chess",
"current_version": "0.2.0", "current_version": "0.2.1",
"publisher": "sys", "publisher": "sys",
"mirrors": [], "mirrors": [],
"code_hashes": { "code_hashes": {
"0.2.0": "" "0.2.1": ""
} }
}, },
"external_url": "https://kinode.org", "external_url": "https://kinode.org",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "homepage" name = "homepage"
version = "0.1.0" version = "0.1.1"
edition = "2021" edition = "2021"
[features] [features]
@ -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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -4,11 +4,11 @@
"image": "", "image": "",
"properties": { "properties": {
"package_name": "homepage", "package_name": "homepage",
"current_version": "0.1.0", "current_version": "0.1.1",
"publisher": "sys", "publisher": "sys",
"mirrors": [], "mirrors": [],
"code_hashes": { "code_hashes": {
"0.1.0": "" "0.1.1": ""
} }
}, },
"external_url": "https://kinode.org", "external_url": "https://kinode.org",

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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -1,6 +1,6 @@
[package] [package]
name = "kns_indexer" name = "kns_indexer"
version = "0.2.0" version = "0.2.1"
edition = "2021" edition = "2021"
[features] [features]
@ -8,11 +8,11 @@ simulation-mode = []
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
alloy-primitives = "0.6.2" alloy-primitives = "0.7.0"
alloy-sol-types = "0.6.2" 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", tag = "v0.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -17,6 +17,7 @@ wit_bindgen::generate!({
// perhaps a constant in process_lib? // perhaps a constant in process_lib?
const KNS_OPTIMISM_ADDRESS: &'static str = "0xca5b5811c0c40aab3295f932b1b5112eb7bb4bd6"; const KNS_OPTIMISM_ADDRESS: &'static str = "0xca5b5811c0c40aab3295f932b1b5112eb7bb4bd6";
const KNS_FIRST_BLOCK: u64 = 114_923_786;
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
struct State { struct State {
@ -132,7 +133,7 @@ fn init(our: Address) {
contract_address, contract_address,
names: HashMap::new(), names: HashMap::new(),
nodes: HashMap::new(), nodes: HashMap::new(),
block: 1, block: KNS_FIRST_BLOCK,
} }
} else { } else {
println!("loading in {} persisted PKI entries", s.nodes.len()); println!("loading in {} persisted PKI entries", s.nodes.len());
@ -144,7 +145,7 @@ fn init(our: Address) {
contract_address: contract_address.clone(), contract_address: contract_address.clone(),
names: HashMap::new(), names: HashMap::new(),
nodes: HashMap::new(), nodes: HashMap::new(),
block: 1, block: KNS_FIRST_BLOCK,
}, },
}; };
@ -188,7 +189,12 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> {
match eth_provider.get_logs(&filter) { match eth_provider.get_logs(&filter) {
Ok(logs) => { Ok(logs) => {
for log in logs { for log in logs {
handle_log(&our, &mut state, &log)?; match handle_log(&our, &mut state, &log) {
Ok(_) => {}
Err(e) => {
println!("log-handling error! {e:?}");
}
}
} }
break; break;
} }
@ -345,7 +351,7 @@ fn handle_eth_message(
} }
fn handle_log(our: &Address, state: &mut State, log: &eth::Log) -> anyhow::Result<()> { fn handle_log(our: &Address, state: &mut State, log: &eth::Log) -> anyhow::Result<()> {
let node_id = log.topics[1]; let node_id = log.topics()[1];
let name = match state.names.entry(node_id.to_string()) { let name = match state.names.entry(node_id.to_string()) {
Entry::Occupied(o) => o.into_mut(), Entry::Occupied(o) => o.into_mut(),
@ -359,15 +365,15 @@ fn handle_log(our: &Address, state: &mut State, log: &eth::Log) -> anyhow::Resul
let mut send = true; let mut send = true;
match log.topics[0] { match log.topics()[0] {
KeyUpdate::SIGNATURE_HASH => { KeyUpdate::SIGNATURE_HASH => {
node.public_key = KeyUpdate::abi_decode_data(&log.data, true) node.public_key = KeyUpdate::decode_log_data(log.data(), true)
.unwrap() .unwrap()
.0 .key
.to_string(); .to_string();
} }
IpUpdate::SIGNATURE_HASH => { IpUpdate::SIGNATURE_HASH => {
let ip = IpUpdate::abi_decode_data(&log.data, true).unwrap().0; let ip = IpUpdate::decode_log_data(log.data(), true).unwrap().ip;
node.ip = format!( node.ip = format!(
"{}.{}.{}.{}", "{}.{}.{}.{}",
(ip >> 24) & 0xFF, (ip >> 24) & 0xFF,
@ -380,15 +386,15 @@ fn handle_log(our: &Address, state: &mut State, log: &eth::Log) -> anyhow::Resul
node.routers = vec![]; node.routers = vec![];
} }
WsUpdate::SIGNATURE_HASH => { WsUpdate::SIGNATURE_HASH => {
node.port = WsUpdate::abi_decode_data(&log.data, true).unwrap().0; node.port = WsUpdate::decode_log_data(log.data(), true).unwrap().port;
// when we get port data, we should delete any router data, // when we get port data, we should delete any router data,
// since the assignment of port indicates an direct node // since the assignment of port indicates an direct node
node.routers = vec![]; node.routers = vec![];
} }
RoutingUpdate::SIGNATURE_HASH => { RoutingUpdate::SIGNATURE_HASH => {
node.routers = RoutingUpdate::abi_decode_data(&log.data, true) node.routers = RoutingUpdate::decode_log_data(log.data(), true)
.unwrap() .unwrap()
.0 .routers
.iter() .iter()
.map(|r| r.to_string()) .map(|r| r.to_string())
.collect::<Vec<String>>(); .collect::<Vec<String>>();
@ -413,7 +419,7 @@ fn handle_log(our: &Address, state: &mut State, log: &eth::Log) -> anyhow::Resul
} }
// if new block is > 100 from last block, save state // if new block is > 100 from last block, save state
let block = log.block_number.expect("expect").to::<u64>(); let block = log.block_number.expect("expect");
if block > state.block + 100 { if block > state.block + 100 {
kinode_process_lib::print_to_terminal( kinode_process_lib::print_to_terminal(
1, 1,
@ -430,9 +436,12 @@ fn handle_log(our: &Address, state: &mut State, log: &eth::Log) -> anyhow::Resul
} }
fn get_name(log: &eth::Log) -> anyhow::Result<String> { fn get_name(log: &eth::Log) -> anyhow::Result<String> {
let decoded = let decoded = NodeRegistered::decode_log_data(log.data(), false).map_err(|_e| {
NodeRegistered::abi_decode_data(&log.data, true).map_err(|e| anyhow::anyhow!(e))?; anyhow::anyhow!(
dnswire_decode(decoded.0.clone()).map_err(|e| anyhow::anyhow!(e)) "got event other than NodeRegistered without knowing about existing node name"
)
})?;
dnswire_decode(decoded.name.to_vec()).map_err(|e| anyhow::anyhow!(e))
} }
fn dnswire_decode(wire_format_bytes: Vec<u8>) -> Result<String, FromUtf8Error> { fn dnswire_decode(wire_format_bytes: Vec<u8>) -> Result<String, FromUtf8Error> {

View File

@ -1,14 +1,14 @@
{ {
"name": "KNS Indexer", "name": "KNS Indexer",
"description": "Kinode OS pki indexer", "description": "Kinode OS PKI indexer",
"image": "", "image": "",
"properties": { "properties": {
"package_name": "kns_indexer", "package_name": "kns_indexer",
"current_version": "0.1.0", "current_version": "0.2.1",
"publisher": "sys", "publisher": "sys",
"mirrors": [], "mirrors": [],
"code_hashes": { "code_hashes": {
"0.1.0": "" "0.2.1": ""
} }
}, },
"external_url": "https://kinode.org", "external_url": "https://kinode.org",

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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -4,11 +4,11 @@
"image": "", "image": "",
"properties": { "properties": {
"package_name": "terminal", "package_name": "terminal",
"current_version": "0.1.0", "current_version": "0.1.1",
"publisher": "sys", "publisher": "sys",
"mirrors": [], "mirrors": [],
"code_hashes": { "code_hashes": {
"0.1.0": "" "0.1.1": ""
} }
}, },
"external_url": "https://kinode.org", "external_url": "https://kinode.org",

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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -1,6 +1,6 @@
[package] [package]
name = "terminal" name = "terminal"
version = "0.1.0" version = "0.1.1"
edition = "2021" edition = "2021"
[features] [features]
@ -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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -4,11 +4,11 @@
"image": "", "image": "",
"properties": { "properties": {
"package_name": "tester", "package_name": "tester",
"current_version": "0.1.0", "current_version": "0.1.1",
"publisher": "sys", "publisher": "sys",
"mirrors": [], "mirrors": [],
"code_hashes": { "code_hashes": {
"0.1.0": "" "0.1.1": ""
} }
}, },
"external_url": "https://kinode.org", "external_url": "https://kinode.org",

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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -1,6 +1,6 @@
[package] [package]
name = "tester" name = "tester"
version = "0.1.0" version = "0.1.1"
edition = "2021" edition = "2021"
[features] [features]
@ -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.6.1" } kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.0" }
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

@ -1,11 +1,4 @@
[ [
{
"chain_id": 1,
"trusted": false,
"provider": {
"RpcUrl": "wss://ethereum.publicnode.com"
}
},
{ {
"chain_id": 31337, "chain_id": 31337,
"trusted": true, "trusted": true,
@ -13,6 +6,13 @@
"RpcUrl": "wss://localhost:8545" "RpcUrl": "wss://localhost:8545"
} }
}, },
{
"chain_id": 1,
"trusted": false,
"provider": {
"RpcUrl": "wss://ethereum.publicnode.com"
}
},
{ {
"chain_id": 10, "chain_id": 10,
"trusted": false, "trusted": false,
@ -21,18 +21,18 @@
} }
}, },
{ {
"chain_id": 10, "chain_id": 1,
"trusted": false, "trusted": false,
"provider": { "provider": {
"Node": { "Node": {
"use_as_provider": true, "use_as_provider": true,
"kns_update": { "kns_update": {
"name": "default-router-1.os", "name": "providerfren.os",
"owner": "", "owner": "",
"node": "0xb35eb347deb896bc3fb6132a07fca1601f83462385ed11e835c24c33ba4ef73d", "node": "",
"public_key": "0xe1f7a266eafe46c79494d4dcce4222d81e5767511b295f1ed26c37221aecb80b", "public_key": "",
"ip": "147.135.114.167", "ip": "147.135.114.167",
"port": 9000, "port": 9999,
"routers": [] "routers": []
} }
} }
@ -45,30 +45,12 @@
"Node": { "Node": {
"use_as_provider": true, "use_as_provider": true,
"kns_update": { "kns_update": {
"name": "default-router-2.os", "name": "providerfren.os",
"owner": "", "owner": "",
"node": "0xd827ae579fafa604af79fbed977e8abe048497f10885c6473dfd343a3b7b4458", "node": "",
"public_key": "0xcc2752e30ba865ab6baa1b819b0291b71f1136245234274b274df5950c3abcc4", "public_key": "",
"ip": "147.135.114.167", "ip": "147.135.114.167",
"port": 9001, "port": 9999,
"routers": []
}
}
}
},
{
"chain_id": 10,
"trusted": false,
"provider": {
"Node": {
"use_as_provider": true,
"kns_update": {
"name": "default-router-3.os",
"owner": "",
"node": "0x96e36331c8f0882f2c0c46c13b15d812def04fe8606d503bc0e2be39db26486a",
"public_key": "0xe992841b17212206a3929b4cc065ad2854875d48fc7177e260005b9eb8d4f123",
"ip": "147.135.114.167",
"port": 9005,
"routers": [] "routers": []
} }
} }
@ -81,48 +63,12 @@
"Node": { "Node": {
"use_as_provider": true, "use_as_provider": true,
"kns_update": { "kns_update": {
"name": "default-router-3.os", "name": "providerfren.os",
"owner": "", "owner": "",
"node": "0x96e36331c8f0882f2c0c46c13b15d812def04fe8606d503bc0e2be39db26486a", "node": "",
"public_key": "0xe992841b17212206a3929b4cc065ad2854875d48fc7177e260005b9eb8d4f123", "public_key": "",
"ip": "147.135.114.167", "ip": "147.135.114.167",
"port": 9005, "port": 9999,
"routers": []
}
}
}
},
{
"chain_id": 11155111,
"trusted": false,
"provider": {
"Node": {
"use_as_provider": true,
"kns_update": {
"name": "default-router-2.os",
"owner": "",
"node": "0xd827ae579fafa604af79fbed977e8abe048497f10885c6473dfd343a3b7b4458",
"public_key": "0xcc2752e30ba865ab6baa1b819b0291b71f1136245234274b274df5950c3abcc4",
"ip": "147.135.114.167",
"port": 9001,
"routers": []
}
}
}
},
{
"chain_id": 11155111,
"trusted": false,
"provider": {
"Node": {
"use_as_provider": true,
"kns_update": {
"name": "default-router-1.os",
"owner": "",
"node": "0xb35eb347deb896bc3fb6132a07fca1601f83462385ed11e835c24c33ba4ef73d",
"public_key": "0xe1f7a266eafe46c79494d4dcce4222d81e5767511b295f1ed26c37221aecb80b",
"ip": "147.135.114.167",
"port": 9000,
"routers": [] "routers": []
} }
} }

View File

@ -177,11 +177,6 @@ pub async fn provider(
allow: HashSet::new(), allow: HashSet::new(),
deny: HashSet::new(), deny: HashSet::new(),
}; };
let _ = tokio::fs::write(
format!("{}/.eth_access_settings", home_directory_path),
serde_json::to_string(&access_settings).unwrap(),
)
.await;
access_settings access_settings
} }
}; };
@ -556,10 +551,13 @@ async fn fulfill_request(
let Some(mut aps) = providers.get_mut(&chain_id) else { let Some(mut aps) = providers.get_mut(&chain_id) else {
return EthResponse::Err(EthError::NoRpcForChain); return EthResponse::Err(EthError::NoRpcForChain);
}; };
// first, try any url providers we have for this chain, // first, try any url providers we have for this chain,
// then if we have none or they all fail, go to node provider. // then if we have none or they all fail, go to node provider.
// finally, if no provider works, return an error. // finally, if no provider works, return an error.
for url_provider in &mut aps.urls {
// bump the successful provider to the front of the list for future requests
for (index, url_provider) in aps.urls.iter_mut().enumerate() {
let pubsub = match &url_provider.pubsub { let pubsub = match &url_provider.pubsub {
Some(pubsub) => pubsub, Some(pubsub) => pubsub,
None => { None => {
@ -571,16 +569,34 @@ async fn fulfill_request(
.await; .await;
url_provider.pubsub.as_ref().unwrap() url_provider.pubsub.as_ref().unwrap()
} else { } else {
verbose_print(
print_tx,
&format!("eth: could not activate url provider {}", url_provider.url),
)
.await;
continue; continue;
} }
} }
}; };
let Ok(value) = pubsub.inner().prepare(method, params.clone()).await else { match pubsub.inner().prepare(method, params.clone()).await {
// this provider failed and needs to be reset Ok(value) => {
url_provider.pubsub = None; let successful_provider = aps.urls.remove(index);
continue; aps.urls.insert(0, successful_provider);
}; return EthResponse::Response { value };
return EthResponse::Response { value }; }
Err(rpc_error) => {
verbose_print(
print_tx,
&format!(
"eth: got error from url provider {}: {}",
url_provider.url, rpc_error
),
)
.await;
// this provider failed and needs to be reset
url_provider.pubsub = None;
}
}
} }
for node_provider in &mut aps.nodes { for node_provider in &mut aps.nodes {
let response = forward_to_node_provider( let response = forward_to_node_provider(

View File

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