mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-22 19:34:06 +03:00
wtf: try and fix cargo manifest
This commit is contained in:
parent
a7d7f4f89e
commit
ff0b411eed
726
Cargo.lock
generated
726
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ alloy-primitives = "0.7.0"
|
||||
alloy-sol-types = "0.7.0"
|
||||
anyhow = "1.0"
|
||||
bincode = "1.3.3"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "7eb3a04" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
rand = "0.8"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
|
@ -8,7 +8,7 @@ simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -9,7 +9,7 @@ simulation-mode = []
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
bincode = "1.3.3"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
rand = "0.8"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
|
@ -8,7 +8,7 @@ simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -8,7 +8,7 @@ simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -10,7 +10,7 @@ simulation-mode = []
|
||||
anyhow = "1.0"
|
||||
base64 = "0.22.0"
|
||||
bincode = "1.3.3"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
pleco = "0.5"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
|
@ -9,7 +9,7 @@ simulation-mode = []
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
bincode = "1.3.3"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -9,7 +9,7 @@ simulation-mode = []
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
bincode = "1.3.3"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
url = "2.5.0"
|
||||
|
@ -36,5 +36,5 @@ interface kns-indexer {
|
||||
|
||||
world kns-indexer-sys-v0 {
|
||||
import kns-indexer;
|
||||
include process;
|
||||
include process-v0;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||
simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -2,7 +2,7 @@ use kinode_process_lib::{await_next_message_body, call_init, eth, println, Addre
|
||||
|
||||
wit_bindgen::generate!({
|
||||
path: "target/wit",
|
||||
world: "process",
|
||||
world: "process-v0",
|
||||
});
|
||||
|
||||
call_init!(init);
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "kns_indexer"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
@ -12,7 +12,7 @@ alloy-primitives = "0.7.0"
|
||||
alloy-sol-types = "0.7.0"
|
||||
bincode = "1.3.3"
|
||||
hex = "0.4.3"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", ref = "c8ad6b0" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", ref = "900428d" }
|
||||
rmp-serde = "1.1.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
|
@ -1,3 +1,6 @@
|
||||
use crate::kinode::process::kns_indexer::{
|
||||
GetStateRequest, IndexerRequests, NamehashToNameRequest, NodeInfoRequest,
|
||||
};
|
||||
use alloy_sol_types::{sol, SolEvent};
|
||||
use kinode_process_lib::{
|
||||
await_message, call_init, eth, net, println, Address, Message, Request, Response,
|
||||
@ -8,10 +11,6 @@ use std::collections::{
|
||||
BTreeMap,
|
||||
};
|
||||
|
||||
use crate::kinode::process::kns_indexer::{
|
||||
GetStateRequest, IndexerRequests, NamehashToNameRequest, NodeInfoRequest,
|
||||
};
|
||||
|
||||
wit_bindgen::generate!({
|
||||
path: "target/wit",
|
||||
world: "kns-indexer-sys-v0",
|
||||
@ -43,24 +42,11 @@ struct State {
|
||||
names: HashMap<String, String>,
|
||||
// human readable name to most recent on-chain routing information as json
|
||||
// NOTE: not every namehash will have a node registered
|
||||
nodes: HashMap<String, KnsUpdate>,
|
||||
nodes: HashMap<String, net::KnsUpdate>,
|
||||
// last block we have an update from
|
||||
block: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum NetAction {
|
||||
KnsUpdate(KnsUpdate),
|
||||
KnsBatchUpdate(Vec<KnsUpdate>),
|
||||
}
|
||||
|
||||
impl TryInto<Vec<u8>> for NetAction {
|
||||
type Error = anyhow::Error;
|
||||
fn try_into(self) -> Result<Vec<u8>, Self::Error> {
|
||||
Ok(rmp_serde::to_vec(&self)?)
|
||||
}
|
||||
}
|
||||
|
||||
sol! {
|
||||
// Logged whenever a KNS node is created
|
||||
event NodeRegistered(bytes32 indexed node, bytes name);
|
||||
@ -190,9 +176,9 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> {
|
||||
// shove initial state into net::net
|
||||
Request::new()
|
||||
.target((&our.node, "net", "distro", "sys"))
|
||||
.try_body(NetAction::KnsBatchUpdate(
|
||||
.body(rmp_serde::to_vec(&net::NetAction::KnsBatchUpdate(
|
||||
state.nodes.values().cloned().collect::<Vec<_>>(),
|
||||
))?
|
||||
))?)
|
||||
.send()?;
|
||||
|
||||
// set_state(&bincode::serialize(&state)?);
|
||||
@ -345,7 +331,7 @@ fn handle_log(our: &Address, state: &mut State, log: ð::Log) -> anyhow::Resul
|
||||
let node = state
|
||||
.nodes
|
||||
.entry(name.to_string())
|
||||
.or_insert_with(|| KnsUpdate {
|
||||
.or_insert_with(|| net::KnsUpdate {
|
||||
name: name.to_string(),
|
||||
owner: "".to_string(),
|
||||
node: node_id.to_string(),
|
||||
@ -406,7 +392,7 @@ fn handle_log(our: &Address, state: &mut State, log: ð::Log) -> anyhow::Resul
|
||||
{
|
||||
Request::new()
|
||||
.target((&our.node, "net", "distro", "sys"))
|
||||
.try_body(NetAction::KnsUpdate(node.clone()))?
|
||||
.body(rmp_serde::to_vec(&net::NetAction::KnsUpdate(node.clone()))?)
|
||||
.send()?;
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,9 @@
|
||||
"code_hashes": {
|
||||
"0.2.1": ""
|
||||
},
|
||||
"wit_version": 0,
|
||||
"dependencies": []
|
||||
},
|
||||
"external_url": "https://kinode.org",
|
||||
"animation_url": ""
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||
simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -4,7 +4,7 @@ use std::collections::HashMap;
|
||||
|
||||
wit_bindgen::generate!({
|
||||
path: "target/wit",
|
||||
world: "process",
|
||||
world: "process-v0",
|
||||
});
|
||||
|
||||
/// From main kns_indexer process
|
||||
|
@ -8,7 +8,7 @@ simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -8,7 +8,7 @@ simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -8,7 +8,7 @@ simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||
simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -9,7 +9,7 @@ simulation-mode = []
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
clap = "4.4.18"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
regex = "1.10.3"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||
simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
rmp-serde = "1.1.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||
simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
rmp-serde = "1.1.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||
simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
rmp-serde = "1.1.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||
simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
rmp-serde = "1.1.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -9,7 +9,7 @@ simulation-mode = []
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
bincode = "1.3.3"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
rand = "0.8"
|
||||
regex = "1.10.3"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
@ -8,7 +8,7 @@ simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
wit-bindgen = "0.24.0"
|
||||
|
@ -9,7 +9,7 @@ simulation-mode = []
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
bincode = "1.3.3"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
thiserror = "1.0"
|
||||
|
@ -10,7 +10,7 @@ simulation-mode = []
|
||||
anyhow = "1.0"
|
||||
bincode = "1.3.3"
|
||||
indexmap = "2.1"
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.7.2" }
|
||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "900428d" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
thiserror = "1.0"
|
||||
|
@ -12,7 +12,7 @@ license = "Apache-2.0"
|
||||
|
||||
[build-dependencies]
|
||||
anyhow = "1.0.71"
|
||||
kit = { git = "https://github.com/kinode-dao/kit", rev = "49093a0" }
|
||||
kit = { git = "https://github.com/kinode-dao/kit", rev = "d319c5b" }
|
||||
reqwest = { version = "0.12.4", features = ["blocking"] }
|
||||
tokio = "1.28"
|
||||
|
||||
|
@ -2,7 +2,7 @@ use crate::wit;
|
||||
use ring::signature;
|
||||
use rusqlite::types::{FromSql, FromSqlError, ToSql, ValueRef};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet, BTreeMap};
|
||||
use thiserror::Error;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
@ -1843,7 +1843,7 @@ pub struct KnsUpdate {
|
||||
pub node: String, // hex namehash of node
|
||||
pub public_key: String,
|
||||
pub ips: Vec<String>,
|
||||
pub ports: HashMap<String, u16>,
|
||||
pub ports: BTreeMap<String, u16>,
|
||||
pub routers: Vec<String>,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user