Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Bruno Tavares bltavares

💭
I may be slow to respond.
View GitHub Profile
View Cargo.toml
[package]
name = "async-internal-spawn"
version = "0.1.0"
authors = ["Ryan James Spencer <spencer.ryanjames@gmail.com>"]
edition = "2018"
[dependencies.async-std]
version = '1.6.2'
features = ['unstable']
View gist:f37af663cb6f9fb4bd30ccabb1453a2a
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::network::hyperdrive] Metadata audit: Ok(Audit { valid_blocks: 4, invalid_blocks: 0 })
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::network::hyperdrive] Metadata len: 4
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::network::hyperdrive] Content audit: Ok(Audit { valid_blocks: 1, invalid_blocks: 0 })
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::network::hyperdrive] Content len: 1
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::observer::event] Error count reached maximum penalty. Bailing.
View main.rs
fn main() {
let client = hypercore_protocol::ProtocolBuilder::initiator().connect(tcp_stream);
let shared_client = Arc::new(async_std::sync::RwLock::new(client));
let bg_client = shared_client.clone();
let bg_task = task::spawn(async move {
while let Ok(e) = bg_client.write().await.loop_next().await {
dbg!(e);
}
});
View rust.rs
pub fn with_discovery(&mut self, mechanisms: Vec<impl Stream<Item = SocketAddr>>) {
let stream = mechanisms
.into_iter()
.fold(stream::pending(), |init, item| init.merge(item));
/// mismatched types
/// expected struct `async_std::stream::pending::Pending<_>`
/// found struct `async_std::stream::stream::merge::Merge<async_std::stream::pending::Pending<_>, impl Stream<Item = SocketAddr>>`
}
View gist:7ad55ed035b3099b9042bd2821a1ea68
handshaken, sending want
Ignoring feed discoveryKey: ",=\002\356P9Qd\341 \373J\377\214\277\305 S_\035j6\327\006\003s\242$G\216\262\306" @ 1
Received message "2c3d02ee50395164e120fb4aff8cbfc520535f1d6a36d7060373a224478eb2c6"
Metadata audit: Ok(Audit { valid_blocks: 0, invalid_blocks: 0 })
Metadata len: 4
View rust-sp-march.md

Lugar: ThoughtWorks SP

Data: 07 Marco

Endereco: Av Paulista 2300

Empresa/Nome do contato: ThoughtWorks / @Daniel Pilon

View colmeia-nc.txt
collected info 0 dat://"5db1de5611f405cc7f362f31e2bfe5f74444634b567c37289a18ec9caf8ccc45"
collected info 1 dat://"2c3d02ee50395164e120fb4aff8cbfc520535f1d6a36d7060373a224478eb2c6"
View gist:c57b720858d0f4d6a2d1596089c479ce
Compiling colmeia-dat-proto v0.1.0 (C:\Users\bltav\repos\colmeia\colmeia-dat-proto)
Compiling colmeia v0.1.0 (C:\Users\bltav\repos\colmeia)
Finished dev [unoptimized + debuginfo] target(s) in 6.45s
Running `target\debug\colmeia-nc.exe 127.0.0.1:3282 dat://460f04cf12c3b9833e5a0d3dd8eea05eab59dd8c1438a7454afe9630b9b4f8bd`
[2020-01-26T16:46:34Z DEBUG colmeia_dat_proto::socket] content to read 1
[2020-01-26T16:46:34Z DEBUG colmeia_dat_proto::socket] original content [61]
[2020-01-26T16:46:34Z DEBUG colmeia_dat_proto::socket] maybe encrypted content [61]
[2020-01-26T16:46:34Z DEBUG colmeia_dat_proto::socket] content to read 61
[2020-01-26T16:46:34Z DEBUG colmeia_dat_proto::socket] original content [0, 10, 32, 250, 182, 154, 103, 52, 211, 221, 131, 78, 152, 109, 24, 179, 67, 132, 102, 87, 171, 209, 60, 187, 89, 166, 247, 139, 102, 133, 137, 83, 119, 55, 175, 18, 24, 89, 189, 224, 209, 85, 49, 229, 107, 66, 146, 183, 244, 34, 61, 167, 251, 188, 203, 45, 160, 208, 239, 235, 165]
[2020-01-26T16:46:34Z D
View gist:1781dc1de4e8c0c97257eca51f708001
PS C:\Users\bltav\repos\colmeia> cargo run --bin colmeia-nc -- 127.0.0.1:3282
Open(discoveryKey: "\315\2057\024kP\313\025\276\316\364\006?\371`z\036{w\016@\215\021\345\260\273\341\340\227\214\213m" capability: "\2345}x\214\312\020\304\002q0\237NN\362\206\223(\336\215\n\315N\220")
PS C:\Users\bltav\repos\colmeia> cargo run --bin colmeia-nc -- 127.0.0.1:62497
Open(discoveryKey: "\317\203\277L\032\340\267\224\033\004\240\035\220\207\177b3D\310-\262\212\351j\030\330\307-\307^\006c" capability: "\300o\326\200=\205\230\n\010\303|\317K\262i\374\005\240\254\324tL\247\033")
View gist:ed65cda530d29326054c5e9c86141398
[2020-01-22T12:19:51Z DEBUG colmeia_proto] Length to read 61
[2020-01-22T12:19:51Z DEBUG colmeia_proto] Encoded channel-type 0
[2020-01-22T12:19:51Z DEBUG colmeia_proto] Msg channel 0
[2020-01-22T12:19:51Z DEBUG colmeia_proto] Msg type 0
Message { header: Header { length: 61, channel: 0, msg_type: 0 }, body: [10, 32, 250, 182, 154, 103, 52, 211, 221, 131, 78, 152, 109, 24, 179, 67, 132, 102, 87, 171, 209, 60, 187, 89, 166, 247, 139, 102, 133, 137, 83, 119, 55, 175, 18, 24, 218, 122, 195, 162, 218, 23, 242, 167, 56, 246, 15, 196, 128, 50, 131, 226, 86, 69, 191, 207, 176, 171, 133, 60, 100] }
Body lenght: 61
[2020-01-22T12:19:51Z DEBUG colmeia_proto] Length to read 9355
[2020-01-22T12:19:51Z DEBUG colmeia_proto] Encoded channel-type 11065
[2020-01-22T12:19:51Z DEBUG colmeia_proto] Msg channel 691
[2020-01-22T12:19:51Z DEBUG colmeia_proto] Msg type 9