di-dao / sonr Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://dids.guide
Home Page: https://dids.guide
Create better discovery structure that implements a goroutine similar to the lobby layout, then provide a callback to show updated peers in frontend.
CodeFactor found an issue: Duplicate Code
It's currently on:
internalhosthost.go:84-102
internalhosthost.go:144-162
Net.Stream
interface is wrapped into PID handler function for Inbound StreamsReferences:
https://berty.tech/blog/bluetooth-low-energy/
Create Contact Card Service and Implement same RPC Auth/Reply Structure as Authentication, except Card is Passed instead of Requesting
User handles card in frontend to save or dismiss
Handle Invited/Accepted/Declined as callbacks
Handle Exit/Close/Busy/Leave Events
OnRequested
message the peer for authentication
Invite
User has invited peer to transfer
Accept
User has accepted transfer request
Decline
User has declined transfer request
Identify FileType prior to request invitation
Code Example
// encode a slice of packet
buf := new(bytes.Buffer)
err := binary.Write(buf, binary.LittleEndian, dataOut)
if err != nil {
fmt.Println(err)
return
}
// decode all items from slice
dataIn := make([]packet, 3)
err := binary.Read(buf, binary.LittleEndian, dataIn)
if err != nil {
fmt.Println("failed to Read:", err)
return
}
Case 1: Register before connect.
In this case, both peers will send the known supported protocols on connect using the identify protocol. When that happens, we use something called "lazy" stream negotiation.
NewStream
, we find a protocol (out of the list specified by the user) that we know the peer speaks.We do this because:
Case 2: Register after connect.
In this case, the identify handshake didn't tell our peer about this protocol. We don't know if they speak the protocol so we negotiate up-front.
Potential Fields in Transfer ProtoBuf TransferBlock
const { info } = this.files.outgoing[connection.peer];
const chunkSize = WebRTC.CHUNK_MTU;
const chunksPerAck = WebRTC.CHUNKS_PER_ACK;
const remainingChunks = info.chunksTotal - beginChunkNum;
const chunksToSend = Math.min(remainingChunks, chunksPerAck);
const endChunkNum = beginChunkNum + chunksToSend - 1;
const blockBegin = beginChunkNum * chunkSize;
const blockEnd = endChunkNum * chunkSize + chunkSize;
Queue
Event queues the file in memory store and initiates thumbnail processingOnQueued
informs the frontend that the file has finished processingStateMachine
updated to allow incoming streamsSessionPID
to remote peerUtilize this tutorial in order to return the uploaded data hashes back from IPFS.
┆Issue is synchronized with this Asana task by Unito
Pass Contexts to Allow User to Cancel Action at any time
https://github.com/uber-go/zap: 👍🏼 For Logging
MsgIO
Stream for Authentication┆Issue is synchronized with this Asana task by Unito
┆Issue is synchronized with this Asana task by Unito
PeerID
into sound metadataPlugin
be listening for events to add peers and provide user PeerID
Utilize OrbitDB
PeerConnection
, await reply from peer for roughly 10 seconds before calling denied and reseting GRPCdone
after authenticationsyntax = "proto2";
package main;
message Request {
enum Type {
SEND_MESSAGE = 0;
UPDATE_PEER = 1;
}
required Type type = 1;
optional SendMessage sendMessage = 2;
optional UpdatePeer updatePeer = 3;
}
message SendMessage {
required bytes data = 1;
required int64 created = 2;
required bytes id = 3;
}
message UpdatePeer {
optional bytes userHandle = 1;
}
mod(10%Total)
┆Issue is synchronized with this Asana task by Unito
OnPeersUpdate
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.