n0-computer / beetle Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Dir etags are not utilized and need to fully resolve each time.
Since the watch command, the gateway (and presumably other services) are unresponsive. On gateway it's due to https://github.com/n0-computer/iroh/blob/main/iroh-gateway/src/core.rs#L87, the call never returns as it's basically starting the tonic server on the current thread and essentially waiting for it to halt. Should probably spin it off similar to https://github.com/n0-computer/iroh/blob/main/iroh-gateway/src/main.rs#L49
I'm looking into leveraging iroh-ctl as a hub to report on some stats, for that it would be ideal if I could list and tag different RpcClientConfig
so that it watches over all of them. Ideally I could do aggregate result vs per tag/namespace/somekey.
ie iroh-ctl status --watch --cfg=./mycfg.[toml|yaml|json]
& iroh-ctl status --watch --tag=node_omega --cfg=./mycfg.[toml|yaml|json]
If we had this, I'd be happy to add an option to run --with-metrics
so that it reports some sort of uptime metric. Useful for a central health/uptime monitoring solution.
The current windows actions environment runs out of disk space.
Either use hacks to remove stuff from the environment on each run or self host runners.
Should support both v1 and v2
Serve pretty 404 where possible.
Improve iroh-store metrics & add underlying rocksdb metrics.
We're starting to see OpenTelemetry trace error occurred. cannot send span to the batch span processor because the channel is full
which is usually the result of performance limitations on the collector side.
The gateway must be deployed to the cloud:
Metrics dashboards need to be updated with the latest knowledge and metrics.
Ops game needs to be improved - propper auth, backups, configuring storage, retention policies, rollups etc.
Add new dashboards: libp2p, dht, storage
Dir listing is very plain. We should list size where possible, breadcrumbs to parent, potentially resolve paths to list items.
Improve overall template styling, add execution time.
Record detailed metrics about bitswap.
Some inspiration can be taken from https://github.com/ipfs-rust/libp2p-bitswap/blob/master/src/stats.rs
Must be able to launch the gateway, network, & storage processes via the command line.
Should be able to add configuration that allows each of the three processes to know about each other, using a config that specifies what address that process should be listening on, and the addresses of the processes to which it should connect.
Look into testground
Setup 1st integration test
Would be nice if iroh-ctl had a readme
iroh-p2p
iroh-gateway
http://localhost:9050/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
from the gatewaytraces use a TON of storage and bw, we should have those configurable and able to compile without traces.
Streaming content from the gateway is set up for the happy path. Breaking the connection or anything along the lines just errors out. Ideally we should track those requests, add metrics & handle errors better.
depends on #280
Gateway is half baked right now and needs some love on putting the resolver in the right place, adding metrics and cleaning up the client.
We already have iroh-car
to read car files, so now this needs to be hooked up through the cli so we can ingest large files of data into the store.
See https://docs.rs/libp2p/latest/libp2p/tutorials/hole_punching/index.html for instructions on how to set this up
Should add gossipsub, and rpc commands & cli commands ideally to interact with it
Ref: https://docs.rs/libp2p/latest/libp2p/gossipsub/struct.Gossipsub.html
maybe store the Path
directly instead of the stringified version?
Originally posted by @dignifiedquire in n0-computer/iroh#87 (comment)
Very little care is given for properly handling or responding to utf-8 based urls or headers.
Most services will need some configuration support. Should get started on having a centralized ~/.iroh
config folder.
dig suggests taking a look at https://github.com/mehcode/config-rs/blob/master/examples/hierarchical-env/settings.rs
If a config file exists, pull from it. Otherwise use defaults or env variables.
At this stage, if you want to use a config file, you must manually add it yourself to the iroh "home" folder /.iroh
.
As a first round, we are only focusing on the ability to add custom rpc addresses.
Currently error handling is pretty scattered and we have lots of unchecked unwraps etc.
We've got the basic building blocks in place however many pieces are either not instrumented, don't have counters or lose the trace context between internal over the wire calls.
Currently many requests go and invoke fetch_bitswap
with an empty provider list (ref trace ID 2b90b66cb34b936f005cde120d35de0e
). We should fail fast here and return 404 or something similar.
The response from the resolver on gateway should be a stream, both to avoid loading everything into memory and significantly reduce the time to first byte which is currently t(fetch_bitswap) + some_overhead
while it could be t(fetch_bitswap_first_byte) + some_overhead
. This also allows us to return metrics like time to first byte/block, latency vs time etc.
We should have a set of peers (configurable size) that we store in memory, as main peers. These can be used to send bitswap requests to, as well as improve general connectivity.
Ops game needs to be improved - propper auth, backups, configuring storage, retention policies, rollups etc.
We're flying blind, we should have alerts for basic uptime issues.
HEAD
requests are not accepted and not set up to properly respond even if we allow it.
Create RPC client & network server implementations/
The goal is to have something like this run:
async fn main() {
let client = iroh_rpc_client::new().await.unwrap();
let c = client.close();
let task = tokio::spawn(|| async move { c.run().await; });
let my_bytes = client.network.get("foobar").await.unwrap();
println!("mybytes: {:?}", my_bytes);
task.join().await.unwrap();
}
Crates:
iroh-rpc
iroh-rpc-client
iroh-rpc-network
pub mod rpc {
//! equivalenet to grpc or jsonrpc_v2
//!
//! - manages libp2p node
//! - manages addresses
//! - manages serialization
//! - manages all internal comms
pub struct Client {
server: Libp2p,
config: ClientConfig,
}
pub struct Server {
server: Libp2p,
config: ServerConfig,
client_config: ClientConfig,
state: State<T>
router: R
}
}
pub mod iroh_rpc_client {
pub fn client_config() -> rpc::ClientConfig {
rpc::ClientConfig::new()
.with_namespace("db", |db| {
db.with_method("get", crate::db::get)
})
.with_namespace("network", |n| {
n.with_method("get", crate::network::get)
})
}
pub fn new() -> Client {
rpc::Client::with_config(client_config())
}
mod db {
pub async fn get(cid: Cid) -> Result<()> {
make_stream_request(DbRequest::Get(cid))
}
}
mod network {
pub async fn get(cid: Cid) -> Result<()> {
make_stream_request(NetworkRequest::Get(cid))
}
}
}
pub mod iroh_network {
// /network/get
fn new_rpc_server(server_state: NetworkState) -> rpc::Server {
let server = rpc::Server::new()
.with_state(server_state)
.with_namespace("network", |n| {
n.with_method("get", network::get)
})
.with_client_config(iroh_rpc_client::client_config());
server
}
mod network {
pub async fn get(state &NetworkState, cid: Cid) -> Result<Bytes> {
let result = state.get_cid(cid).await;
result
}
}
}
pub mod iroh_db {
// /db/get
fn new_rpc_server(db_state: DbState) -> rpc::Server {
let server = rpc::Server::new()
.with_state(server_state)
.with_namespace("db", |n| {
n.with_method("get", db::get)
})
.with_client_config(iroh_rpc_client::client_config());
// we can now make requests: server.client().namespace("db").call("get", "foobar").await;
server
}
mod db {
pub async fn get(state &DbState, cid: Cid) -> Result<Bytes> {
let result = db.get(cid).await;
result
}
}}
pub mod iroh_cli {
async fn main() {
let client = iroh_rpc_client::new().await.unwrap();
let c = client.close();
let task = tokio::spawn(|| async move { c.run().await; });
let my_bytes = client.db.get("foobar").await.unwrap();
println!("mybytes: {:?}", my_bytes);
task.join().await.unwrap();
}
}
Based on #276
Passing trace contexts over our internal RPC messaging bus still isn't implemented.
We should start working on a load balancer for the gateway.
It's still early to have real use for it but it's much easier to evolve and grow with us.
Reasons to do it:
Why not use something off the shelf
Fail/Error count are only recorded if we serve a gateway reponse/error directly. Error handling swallows the response and never triggers the counters.
Also trace ID is missing from such cases as the trace ID is resolved from within the call and not globally.
Our header logic for cache control is very crude. Either we say to the browser to cache forever if it's a ipfs/CID
or simply set the Last-Modified
header to now()
.
We should explore cache logic around ipns/dns TTLs, content publishing timestamp for Last-Modified
iroh-rpc-types
:pub async fn put<T: AsRef<[u8]>, L>(&self, cid: Cid, blob: T, links: L) -> Result<()>
where
L: IntoIterator<Item = Cid>
get
pub async fn get(&self, cid: &Cid) -> Result<Option<DBPinnableSlice<'_>>>
get_links
pub async fn get_links(&self, cid: &Cid) -> Result<Option<Vec<Cid>>>
store.rs
client & associated methodsiroh-rpc-store::rpc
mod that can create a store specific server & knows how to respond to rpc requestsrpc_addr
to the store Config
StoreServer
rpc in main
so we can communicate with the store.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.