Created
March 30, 2017 08:04
-
-
Save dignifiedquire/6a4a0cdb25e3cd96efa8cd4217c32c38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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