Skip to content

Instantly share code, notes, and snippets.

@dignifiedquire
Created March 30, 2017 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dignifiedquire/6a4a0cdb25e3cd96efa8cd4217c32c38 to your computer and use it in GitHub Desktop.
Save dignifiedquire/6a4a0cdb25e3cd96efa8cd4217c32c38 to your computer and use it in GitHub Desktop.
// torn between addr, multiaddr, multiaddress and address
// multi<> seems not needed as we only ever talk about multiaddresses so I feel that is superflous in this context
// Manage multiaddrs
// TODO: do we want ttl handling now?
class MultiaddrSet {
constructor (addrs) {}
get length () {}
forEach (fn) {}
add (add) {}
toArray () {}
has (addr) {}
delete (addr) {}
clear () {}
}
class ProtocolSet {
constructor (protocols) {}
get length () {}
forEach (fn) {}
add (proto) {}
toArray () {}
has (proto) {}
delete (proto) {}
clear () {}
}
class PeerInfo {
constructor (peerId) {
this.addrs = new MultiaddrSet()
this.protocols = new ProtocolSet()
}
// -- key handling (proxy through to the peerid)
get pubKey () {}
set pubKey () {}
get privKey () {}
set privKey () {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment