►
Description
In this course we will cover common problems encountered when developing distributed apps and ways we are able to solve them with libp2p. As we discuss these capabilities we will implement them in live coding exercises to see them in action.
https://github.com/ipfs/camp/tree/master/CORE_AND_ELECTIVE_COURSES/CORE_COURSE_B
Learn more about IPFS Camp: https://camp.ipfs.io/
For more information on IPFS
- visit the project website: https://ipfs.io
- or follow IPFS on Twitter: https://twitter.com/IPFS
Sign up to get IPFS news, including releases, ecosystem updates, and community announcements in your inbox, each Tuesday: http://eepurl.com/gL2Pi5
A
B
When
we
break
out
because
we'll
be
only
going
through
a
few
of
these,
but
you
can
feel
free
to
pull
it
down
and
go
through
the
next
week
because
we
talked
to
you,
this
I
think
the
one
that
you're
most
comfortable
with
just
because
you
will
be
going
through
a
lot
of
you
concepts.
So
here's
work
the
most
in
the
browser
with.
B
So
while
everybody
doing
that,
we'll
go
over
some
basic
concepts
and
start
talking
to
things
so
what
is
lit
p2p,
so
we
got
the
world
wide
web
back
in
91,
which
is
28
years
ago,
and
building
networking
and
applications
still
kind
of
sucks.
If
you
want
to
do
that,
distributed
or
peer-to-peer
it
sucks
extra
hard.
B
So
ultimately,
what
we
want
to
do
is
be
able
to
create
a
library
where
we
can
just
pull
in
the
bits
that
we
need
for
our
specific
use
cases
for
our
applications
and
then
focus
on
actually
writing
that
our
application
code
not
worry
about
the
network
effect.
So
this
is
also
what
we're
trying
to
do
it
with,
because
we're
trying
to
make
that
easy
to
just
pull
it
in
the
networking
layer
and
then
call
it
a
day.
B
Limpia
Pete
is
the
networking
layer
that
I
get
best
uses
and
ultimately
it's
just
a
composable,
not
modular
networking
librarian.
So
if
you
go
to
whip
me
to
be
core,
there's
usually
not
a
whole
lot
of
logic
there
it's
a
smelled
in
from
all
of
these
different
projects,
but
you
can
just
bring
in
a
bundle.
B
So
what
are
we
building
today?
So
this
is
the
browser
version,
we're
building
the
chat
app
by
the
end
of
the
course
we'll
be
using
pub/sub
to
go
through
and
send
chat
messages
across
the
whole
available
clients,
and
we
have
a
basic
chat,
metrics
being
passed
over
pups
up
as
well
just
kind
of
show
connected
peers-
and
you
can
also
shortly
on
this
slide
over
here
as
ears-
join
the
network.
B
Alright,
so
another
channel,
why
are
we
building
a
chat?
Even
a
basic
chat,
app
is
gonna.
Let
us
walk
through
a
lot
of
the
problems
that
we
have
with
building
distributed
systems
just
connecting
to
the
network.
How
do
we
connect
shion's
so
that
we
can
make
sure
that
our
chat
data
is
safe?
How
do
we
create
our
own
chat
board
fault?
This
is
something
that
a
lot
of
people
get
hung
up
on
when
they
were
building.
The
PPP
is
grating
their
own
protocol.
B
How
we
use
connections
if
we
want
to
go
through
a
myriad
of
using
different
protocols,
dhts
pub/sub
direct
messaging,
identify.
We
don't
want
to
create
connections
to
tears
every
time
we
do
that,
we
don't
want
multiple
connections
to
peer.
So
how
do
we
reuse
the
attention
that
we
have
we're
also
going
to
talk
about
discovering
tears?
B
Doesn't
it
was
very
good
to
be
distributed
if
we
can't
justify
tears
on
the
network
and
then,
if
we
view
fun
peers,
how
do
we
connect
to
them
if
they're
Navin,
so
talking
to
browsers
talking
to
people
on
home
networks?
Oh
well,
I've
been
playing
around
I
get
best.
They
might
do
that
at
home
and
most
homes
are
behind
Nats.
So
how
can
we
dial
those
handling
more
complex
data
on
our
protocol?
We
want
to
be
able
to
have
a
protocol
that
does
many
different
things
and
not
just
a
specific
thing.
B
B
We
use
transports
to
do
the
actual
interface
data
exchange
in
Lib
PP,
so
I
transports
are
going
to
have
two
components:
they're
going
to
have
a
dialing
component
for
outbound
connections
and
listening
component,
something
important
to
note
on
all
transports
we'll
be
able
to
listen.
This
is
very
common
for
browsers.
However,
we
do
have
exceptions
to
that
rule
and
we
actually
haven't
run
in
today.
So
I'm
running
on
my
machine
at
this
IP
address
a
bootstrap
node
that
is
also
running
a
web.
B
So,
let's
some
of
these
transports,
this
is
just
a
subset.
The
transports
we
have
available.
These
are
some
of
the
more
common
ones.
Tcp.
We
can
see
its
availability
here
across
the
different
implementations.
Tcp
doesn't
work
in
the
browser,
unfortunately
not
yet,
but
it
does
work
in,
don't
go
and
rust.
So
that's
a
good
option,
especially
if
you're
running
a
server
WebSockets
works
on
all
of
them.
B
So
that's
definitely
an
option
to
look
at
WebRTC
is
getting
an
implementation,
then
go
limp,
leave
it's
quite
there
yet,
and
that's
nice,
because
web
RTC
has
some
built-in
Nats
bristle
techniques.
So
once
we
get
that
that
will
help
a
lot
with
network
connectivity
and
then
quick
has
a
working
implementation
in
go,
but
they
could
expect
not
complete
yet
so
we're
not
going
to
see
a
lot
of
the
other
things
annotations
until
that's
done.
B
Although
I
believe
there
is
a
j/s
version
in
provinces,
all
right
so
for
workshop
today,
the
transports
that
we're
gonna
be
using
we're
going
to
be
using
TCP
and
WebSockets.
This
will
we'll
be
able
to
run
out
a
node
and
go
WebSockets,
we'll
be
able
to
add
to
the
browser
and
then
on
the
jas
side
of
things,
we're
going
to
add
web
RPC,
and
so
what
WebRTC
is
going
to
give
us
is
that
that
direct
browser
browser
communication
and
then
it's
also
going
to
give
us
the
ability
to
listen
on
this
signaling.
So.
B
Use
to
you
need
to
use
system
server
to
have
access
to
emergency
mention,
so
you
still
need
a
stun
server.
However,
we
are
in
partners
of
building
working
on
aspect
to
create
a
distributed,
signaling
servers
so
giving
any
node
the
ability
to
run
a
stun
server
for
you.
So
as
long
as
you're
connected
to
a
node,
you
could
use
that
node
as
a
signature.
B
So
this
is
when
we
would
break
and
go
into
configuring
transports
because
we're
on
a
compressed
timeline
we'll
skip
over
that,
but
as
you're
going
through
that,
if
you
do
this
on
your
own
or
you're
doing
it
right
now
pulling
along.
If
you
do
get
stuck,
you
can
look
at
chapter
2
and
it
will
have
all
the
solution
code
for
you.
We're
likely
going
to
go
through
and
we'll
probably
stop
at
chapter
4
and
walk
through.
B
So
once
we
have
that
initial
transport
configuration
we
want
to
create
our
first
connection.
This
is
typically
going
to
be
to
a
bootstrap
here.
So
for
us
locally.
This
would
be
this
bootstrap
code
on
that
I'm
running
a
long
machine
for
ipfs.
Those
are
gateway
notes
in
particularly
with
IP.
That's
what
we
have,
because
we
have
a
list
of
10
new
gateway
notes
and
we
dial
directly
to
those
when
we
start
up
now,
that's
the
strap
into
the
network
and
we
can
find
crews
from
there.
B
So
in
order
to
dial
to
those,
we
need
to
know
the
address.
So
this
is
where
multi
addresses
come
in
commonly
refer
to
as
multi
adders
because
ease
suck.
So
what
multi
addresses
do?
Is
they?
Let
us
compose
flexible
addresses
as
species?
Our
communication
has
changed
a
lot
over
time
and
the
address
of
those
forms.
Communication
has
changed.
Postal
addresses,
email
addresses
phone
numbers
domains.
B
The
format
of
this
has
changed
over
time.
So
we
need
to
do.
Is
we
need
to
create
days,
flexible
mechanism
that
we
can
describe
addresses
over
time
as
we
get
to
etudes
transports
if
we
get
radio
transports
whatever?
Those
look
like
how
do
we
make
sure
that
we
have
a
flexible
form
of
describing
that
and
that's
what
multi
addresses
aim
to
do.
So,
let's
look
at
a
few
of
those.
B
So
if
you
run
an
IP
FS
server
you're
likely
going
to
see
the
very
first
dress
pop-up,
which
is
a
TCP
address,
running
on
your
local
IP
on
port
4001.
So
tomorrow
dial
that
node
do
you
have
to
have
local
access
to
it?
The
second
one,
almost
the
same,
is
running
on
four
thousand
two,
but
there's
a
WS
at
the
end,
which
is
WebSockets.
If
you
see
WSS,
that's
WebSocket
secure.
B
B
So
let's
look
at
some
fun
lines.
This
one
up
top
is
a
with
our
TC
star
address
which
would
be
using
today,
and
we
can.
These
are
best
I
found
to
read
from
the
right-hand
side
because
we
pick
up
what
the
target
node
is
running
over.
So
here
we
see
the
target.
Node
is
running,
PGP,
weather
arkinson
start,
that's
our
signaling
server
address.
This
indicates
that
whatever
we're
about
style
is
running
over
Singh,
it's
listening
on.
This
is
net
server.
B
So
and
then
we
can
see
that
signaling
server's
address
is
a
WebSocket
address
over
TCP
on
for
fifteen
five
by
five,
the
next
one,
a
bit
more
complicated,
is
a
circuit
address.
So
this
means
we're
running
over
a
relay
relay.
The
idea
of
that
relay
is
PT,
p,
qm
relays.
This
is
an
abbreviated
version
of
your
qm.
I
t's.
B
If
you
look
at
multi
addresses
in
the
wild,
though
PGP
will
probably
beat
ipfs.
The
goal
is
to
move
to
be
poppy.
It's
currently
supported
in
wolf,
jeaious
and
go
and
we'll
fall
back
to
a
PFF,
but
because,
when
we
built
it
it
was
very
specific
or
like
I'd
be
best,
but
no
anybody
can
use
that
any
lip
p2p
node
can
use
it.
So
we
need
to
be
people,
and
then
we
see
that
that
relay
server
is
running
over
the
quick
transport
which
runs
over
UDP
on
four
four
thousand.
One
super
easy
right.
B
So
once
we
have
that
multi
address,
we
can
set
it
up
and
actually
dial
to
our
peer.
The
multi
address
tells
us
a
lot
about
our
peer.
Most
of
the
time.
We're
going
to
enable
multiple
transports
are
clear,
so
we're
going
to
get
a
giant
list
of
potential
multi
addresses,
which
is
a
great
thing,
because
the
more
transports
that
we
have
and
we
support
the
more
people
can
dial
us
assuming
our
addresses
are
public,
so
chapter
two
is
going
to
be
focused
on
just
adding
that.
B
So,
if
you
go
into
the
code,
it's
just
going
to
be
you're
going
to
add
your
listening
addresses.
If
you
can,
then,
luckily,
mostly
everything
will
be
able
to
add
this
new
addresses
forth,
because
we
are
using
the
signaling
server
and
then
the
dialing
addresses
which
will
dial
to
good
bootstrap
node.
For
you
locally,
there
is
in
the
node.js
folder
and
there's
a
bootstrap
folder
in
there,
which
has
the
bootstrap
node
in
a
signaling
server,
and
so,
if
you
run
that
locally
on
your
own,
that
will
the
examples
will
automatically
dial
to
it.
B
So
when
you
do
that
this
is
what
happens
over
Wireshark.
This
is
the
connection.
So
the
only
thing
we
see
here
is
our
new
dialing
to
the
important
of
the
beechcraft
hood
and
the
only
information
that
we
exchange
is
a
multi
stream
pension.
This
is
our
protocol
negotiation
and
tape,
which
we
will
talk
a
little
bit
more
about
notation
a
little
bit
and
then
we
see
plaintext
switches
are
very,
very
secure.
Encryption
merry-go-round
encryption
for
it
a
little
bit,
but
this
is
it.
It
stops
like
there's
no
more
data.
That's
exchanged
we're
connected.
B
So
how
do
we
reuse
that
connection?
We
have
this
connection.
Lit
p2p
wants
to
do
a
bunch
of
things
in
the
background.
It
wants
to
do
a
bunch
of
exchanges
to
verify
things,
but
when
we're
not
when
we
don't
have
a
multiplex
connection,
it's
hard
for
us
to
do
that
painful
first,
so
we
want
to
be
able
to
reuse
that
connection.
We've
got
pub/sub
messages,
DHT
queries,
we've
got
the
living
to
be
identify
protocol,
there's
direct
communication.
The
chat
protocol
that
we're
gonna
write
for
this.
B
Tin
can
phone,
so
it's
the
idea
that
you
can
take
a
can
of
your
favorite
foodstuffs
punch
a
hole
in
the
bottom
of
it
run
a
string
to
the
other
kam,
and
you
can
talk
with
somebody
know
what
not
yet,
maybe
maybe
someday,
maybe
it'll,
be
a
science,
fair,
very
reliable
on
a
network
like
today
yeah.
So
how
do
we?
How
do
we
get
from
here
to
something
like
this?
But
with
that
multiple
connections?
What
if
we
had
one
connection?
That
is
a
lot
of
virtual
strength.
B
This
is
what
stream
multi
planning
for
this
work,
combo
verbally
as
muxing,
so
multiplexing,
it's
not
a
new
concept.
They
actually
used
it
in
the
1870s
for
telegraphy.
So
it's
been
around
for
quite
a
long
time.
If
you
think
about
TCP
connections
running
over
an
IP
address,
those
are
multiplex
by
Porter
telephone
lines.
Will
they
collect
phone
calls
by
historical
event,
frequency
of
the
phone?
B
So
if
you
were
calling
your
neighbor
down
the
road,
it
would
operate
on
a
different
frequency
and
somebody
else
using
the
line
and
as
soon
as
we
had
too
many
people
living
in
a
space
with
non
appliance
eventually
ran
out
of
frequencies.
We
had
to
add
more
telephone
that
Lippe
to
people,
tech
lectures,
don't
work
the
same
way,
but
they
do
a
similar
thing
so,
for
example,
multiplex
RM
plaits.
It
does
this
by
prepending
data
in
the
stream,
with
a
streamlined
edifying
pattern,
as
well
as
the
length
of
the
content
that
you
want
to
send.
B
So
when
we
go
in
and
we
send
a
chat
over
the
wire,
you
see
that
chat
message
is
100
bytes.
What
we
do
at
the
very
beginning
of
that
we
say:
okay,
let's
create
a
new
stream,
will
call
the
idea
of
that
stream.
V.
We're
gonna
send
a
message
of
a
hundred
bytes,
so
we
say
it's
gonna
be
a
hundred,
and
then
we
tack
on
our
message.
We
send
that
over
the
wire
and
we're
going
to
read
that
in
and
you
say,
okay,
this
data
is
going
to
stream
five
there's
a
hundred
bytes
of
it.
B
So
I'm,
not
gonna,
read
the
next
100
bytes
and
then
I'm
gonna
stop
I'm
gonna,
pull
that
into
Senate.
This
way,
it'll
chew
in
to
the
next
message
on
the
stream
or
on
the
connection,
because
it
might
be
going
somewhere
else,
so
muck,
search
that
we
currently
have
available
at
bucks
is
the
most
widely
supported.
It's
a
JSON,
rust
llaman
using
going
rust,
speedy
Jason,
go
quick,
has
a
built
in
multi
collector,
so
only
go.
Has
that
support
right
now
and
then
Mikado
is
also
things
go
again.
B
You
can
bring
multiple
multiplexers
configure
multiples
of
those.
The
advantage
there
is
perhaps
not
all
nodes
are
going
to
be.
The
same
thing
like
we've
talked
about
a
varying
degree
of
support
here,
and
some
multiplexers
are
more
performant
than
others.
So
if
you
bring
multiple
multiplexers
you're
going
to
have
more
options
going
forward,
this
also
helps
with
upgrading
network.
Over
time,
as
we
add
supports,
we
can
slow
the
deprecated
support
rather
than
cutting
each
type
of
network.
B
B
This
is
what
happens
if
you
see
up,
on
the
right
hand,
side
there
is
a
scroll
bar,
so
we
still
have
our
multi
stream
handshake
and
then
we
have
our
super
secure,
plaintext
and
then
we
negotiate,
which
is
our
stream
little
bit
as
soon
as
we
do
that
logic
rat
happens,
we
negotiate
circuit
relay,
we
negotiate,
we
send
over
IDs,
so
we're
letting
each
other
know
what
protocols
we
support.
We're
negotiating
eh
to
be
late,
determine
what
we
support.
Ideally,
this
would
be
a
lot
shorter
right
now.
B
B
But
yes,
this
is
just
enabling
multi-stream
are
sorry
the
multi-touch
something
you'll
notice
here.
All
of
this
data
is
free
to
look
at
over
the
wire,
not
the
best.
Our
plain
text
is
failing
us.
So
how
do
we
put
that
data?
So
we
can
see
it.
Luckily,
the
p2p
you
can
bring
whatever
encryption
framework
you
want
currently
sekai
up
is
are
mostly
supported.
That's
supported
by
go
Jas
and
Russ
TLS.
B
One
three
has
support
for
go
south
now,
as
we
get
more
support
will
likely
migrate
away
from
the
SEC
I/o
over
to
TLS
three
or
one
of
these
other
prime
encryption.
Some
people
are
working
on
noise
for
that
and
then
the
quick
transport
also
have
built-in
TLS
encryption
support.
We
originally
built
sekai.
Oh,
it's
just
a
liquid
history
overview
because
of
needing
central
authorities
to
do
certificate
generation
that
doesn't
work
very
well
in
a
period
here.
I
just
remember
so
we
rolled
that
until
seal
s13,
though,
and
complete
it's
almost
there
for
4
KS.
B
So
people
have
that
same
and
again
in
chapter
3
we'll
deal
with
the
encryption.
So
as
you
go
through
chapter
3,
it
will
have
stream
multiplexing
added
in
there
and
encryption
and
if
you
get
stuck
at
any
point
check
out
chapter
4
now
this
would
go
back
to
Wireshark.
Look
at
that
we'll
see.
Multi-Stream
plaintext
is
gone.
We
now
have
a
sec
IATA
data
exchange
and
then,
after
that
we
have
some
nuts
exchanges
like
24
or
32
bytes,
and
then
everything
gets
encrypted
out
the
back
after
our
original
identity
exchange.
B
So
now
that
weren't
proof
that
we've
been
talking
a
lot
about
protocols
and
Lippi
to
be
this
multi-stream
100
protocol
there's
an
IPF
s
being
protocol,
there's
a
certain
real
early
protocol.
So
what
the
hell
are
protocols,
if
you
think
about
like
a
restful,
api
and
you're
familiar
with
restful
api's,
you
can
think
of
protocols
like
influenced
or
paths
in
your
system
and
also
mean
what
you're
going
to
do
is
you're
going
to
register
handlers
for
those
paths.
Multi-Stream
100
is
like
the
router
for
that.
B
So
ultimately
it's
deciding
about
how
our
ABI
is
going
to
work
and
how
we're
gonna
negotiate
those
so
just
like
Anna
wrestled
API
it.
If
you
try
to
send
data
to
one
endpoint
that
doesn't
exist
there,
it's
not
gonna
work
and
if
it
tries
us-
and
you
date
it
back
that
you're
not
expecting
yeah.
Ok
should
probably
have
a
bad
time.
So,
just
if
you're
familiar
with
that
think
about
it
that
way
so
we're
building
a
chat
app.
B
We
should
create
a
chat
protocol
and
we'll
go
ahead
and
call
that
lip
baby
chat
100.
Something
to
note
if,
when
you're
building
protocol
names,
if
you're
going
to
be
joining
the
public
network,
be
descriptive.
If
you
just
pick
something
like
Chaplin
ello
I,
even
let
me
check
might
have
better
if
you're,
connecting
to
millions
or
billions
of
nodes,
there's
probably
going
to
be
some
conflict
there,
because
you
will
try
to
negotiate
at
some
point
with
other
peers.
So
you
have
to
just
be
descriptive.
B
B
B
All
right,
so
we
have
our
chat,
protocol
stream,
chat,
100
and
then
here's
our
handler.
It's
pretty
basic.
If
you
go
through
the
browser
code,
it's
going
to
be
almost
the
same.
There's
just
some
view
differentiation
and
how
we're
setting
stuff
up
cause.
It's
reactin
versus
printing
to
determine
so
in
here
richly
in
our
hand,
are
gorgeous.
It
requires
too.
Big
part
takes
two
arguments.
B
One
is
protocol
right
now
we're
not
using
it
at
all,
but
what
this
lets
you
do
is
actually
do
like
match,
functions
and
things
so,
for
example,
like
in
ipfs,
we
have
bit
swap
1,
1
and
100.
What
we
can
actually
do
is
use
this
protocol
information
to
figure
out
what
version
it
is
and
then
do
like
case
specific
checks.
So
if
we
have
one.
B
We
can
run
a
different
set
of
code
than
100
and
then
we're
just
taking
the
discrete
oh,
we
have
here
and
all
we're
doing.
If
you're
not
familiar
with
pull
streams
is
this
is
basically
a
pipe
so
we're
taking
the
stream
and
we're
piping
all
of
that
data
into
a
collect
and
then
just
plugging
it
off
to
the
console.
So
all
we're
doing
in
the
browser
is
setting
that
on
the
react
component.
So
it's
just
a
very
super,
simple
thing
and
then
the
only
other
thing
we
have
here
is
a
send
method.
B
B
Let's
go
to
chapter
five,
so
chapter
five
has
all
of
our
solution
code.
So
in
here
all
we
do
is
we
do
a
lip,
PP
and
alcohol
and
that's
going
to
take
our
protocol
and
our
handler
function?
That's
it,
and
if
we
had
multiple
support
so
say
we
had
another
chat
protocol
you
could
do
live
p2p,
slash,
chat,
slash,
wound
up
on
the
o,
get
far
handler.
Did
that
check
on
the
version
number?
We
would
be
able
to
do
this
and.
B
B
B
B
So
here
the
crude
code
that
we're
doing
right
now
is
we
look
in
our
pure
book
and
go.
This
is
called
pure
storm,
which
would
probably
coalesce
on
those
names
all
we
do
is
we
get
all
of
the
piers
we
check
if
we're
committed
to
them
and
if
they
support
the
chat
protocol.
This
is
our
check
the
house
and
then
we
dial
to
them
and
negotiate
the
chat
protocol,
and
if
we
connect,
we
send
them
that
message.
B
B
B
We
can
talk
about
a
few
of
these,
but
let
P
be
how
support
to
build
your
own
peer
discovery
towers.
So,
if
you're
toying
around
with
Bluetooth
or
NFC
or
radio
or
anything
else,
you
can
build
a
discovery
channel
for
that,
just
plug
it
into
the
PP.
So
the
first
four
that
we're
currently
use
gonna
be
using
this
workshop.
Bootstrap
bootstrap
is
a
discovery
mechanism
that
all's,
it
doesn't
say:
hey
you
have
a
list
of
multi
addresses.
B
B
So
if
you
think
about
printer
discovering
a
controller
network
or
the
old
mac
modular,
app
finding
people
in
the
local
network
that
all
uses
mdns,
so
ultimately
what
happens
is
you're
going
to
connect
to
the
local
network
you're
going
to
use
the
Lupita
vlookup
to
look
up
the
p2p
services
on
the
network
and
then
every
little
V?
If
you
note,
is
going
to
respond
back
to
you
and
you're
also
going
to
reply
to
that
query.
The
advantage
of
this
is
when
you
join
the
network.
B
You're
also
going
to
be
broadcasting
your
new
identity
to
the
network,
so
people
can
connect
to
you.
If
you
look
at
the
visualization,
there
are
going
to
be
some
people
running
this.
There
are
also
just
people
there
are
now
I'm
finding
on
the
network
because
I'm
running
no
GS
and
empty
nesters,
so
these
are
people
that
are
also
running
the
VP.
So
we
do
see
a
couple
of
notes
there
that
are
part
of
our
chat
client,
the
green
notes,
which
are
no
chance,
I,
believe
there's
a
legend
and
the
purple.
B
Ideas
so
the
tht
we'll
talk
about
right
after
this,
because
it's
a
bit
of
a
thing
but
we'll
talk
specifically
about
the
read
and
walk
component
for
that,
and
then
we
have
Rhonda
Mason
run
two
new
servers
so
for
this
we're
using
the
WebRTC
signaling
server,
we
also
have
a
web
socket
under
your
server.
Not
only
does
the
WebRTC
signaling
server
allow
us
to
negotiate
and
get
direct
dials,
but
it
will
also
tell
us
about
every
other
period
that's
connected
to
it,
so
it
also
acts
as
a
peer
discovery
mechanism
which
is
nice.
B
So
let's
talk
about
the
DHT
random
walk.
This
is
a
very
useful
discovery
mechanism.
Once
you
join
something
like
the
bootstrap
noise.
So
the
way
the
DHT
random
walk
works
is
also
below
you're,
going
to
do
a
query
on
the
DHT.
If
you're
not
familiar
with
a
PhD,
it's
a
distributed
hash
table
just
a
big
fancy,
key
value
store.
Basically,
so
what
we
do
is
we're
going
to
create
a
random
pure
ID,
we're
not
looking
for
anything
specific
we're
just
going
to
create
a
random
ID.
We
don't
want
to
find
anything
on
the
network.
B
We
just
want
to
find
other
peers
on
the
network,
so
we
create
a
random
ID
and
for
simplicity
since
QM
I.
These
are
art
to
keep
in
your
mind,
we'll
just
say
random,
so
we
create
a
random
ID,
Oh
Brandon
we're
going
to
look
for
that
peer.
So
the
first
thing
we
do
is
we
looked
at
all
of
the
degrees
that
we
know
are
any
of
them
Brandon,
hopefully
not
because
we
just
made
up
this
ID.
We
got
that
kind
of
collision.
We
have
bigger
problems,
but
we
shouldn't
get
collision
later.
B
So
what
we'll
do
is
we'll
look
at
all
the
peers
that
we
know
and
we're
gonna
find
up
here
with
the
closest
ID,
it's
a
brand
new.
So
this
is
eventually
going
to
be
a
DHT
heat
and
what
we
do
is
we
do
an
explore
binary
on
that
to
see
what
the
big
difference
is
and
the
closer
the
smaller
the
bit
difference
is
those
are
the
peers
we're
going
to
use.
B
So
if
we
look
at
our
group
of
six
here,
we
check
our
five
peers
and
we
see
that
Alice
and
Bob
are
have
the
closest
IDs
for
Brandon.
So
we'll
go
ahead
and
say:
okay,
I'm
gonna,
query:
Bob
Bob,
do
you
know
Brandon
offices,
no
I,
don't
know
Brandon,
but
I
know
Brenda,
who
has
a
closer
ID
to
Brandon.
So
this
is
how
we
discovered
Brenda,
and
this
is
how
the
ght
random
walk
works,
except
that
a
much
larger
skill
look
at
the
su
random
walk.
B
Query
is
probably
gonna
grade
between
100
and
200
peers
yeah.
So
we're
gonna
continue
down
that
query,
and
so
we
can't
find
anybody
that's
closer.
So
this
is
why
we
end
up
grading.
So
many
Pierce's
we
should
you
asking
and
asking
and
asking
the
jst
80
will
query
40
peers
in
parallel
right
now,
because,
ultimately
we
don't
go
down
one
path.
We
go
down
many
paths
and
we
do
that
recursively
until
we
get
no
better
results.
So.
B
Just
like
transports
and
multiplexers
discovery
works
best
when
you
bring
many
of
them.
If
you
just
bring
loot,
strap
you're,
probably
gonna
end
up
here,
the
first
one
like
yeah.
We
know
this
bootstrap
node,
that's
not
super
helpful,
let's
add
mdns
and
meanness.
We
get
local
discovery.
That's
all.
It
appears
that
we
know
will
now
get
access
to
the
network
and
then
rendezvous
server
lets
us
do
stuff
like
just
swap
RPC
signally.
We
can
get
natural
versus
all.
We
can
actually
start
talking
directly
to
people
so
also
we
were
trying
to
get
here
right
now.
B
The
Internet
is
here
so
chapter
5
is
going
to
show
you
how
to
set
up
that
discovery.
It's
pretty
pretty
simple
for
all
of
us.
It's
all,
basically
just
configuration
and
adding
in
a
couple
modules
if
you
do
get
stuck
there.
What
do
you
want
to
look
at
that
towards
the
end
here
we
can
go
through
that
code
and
again
the
solution
will
be
in
Chapter
six,
we'll
be
able
to
see
that.
B
B
Currently
we
have
two
pub
sub
libraries,
there's
gossip
sub
or
floods
up,
so
flotsam
is
a
very,
very
crude,
simple,
inefficient
version
of
pub.
So
what
we
do
is
we
take
every
peer
that
we
know
who's
the
pops
up
here
and
we
send
them
a
message
and
they
take
that
message
and
set
it
onto
every
peer
that
they
know
will
do
that
over
and
over
and
over
and
over
again
we
do
add
a
cache.
So
we
don't
continually
flood
the
network,
but
it's
crude
in
its
gross
and
but
it
works,
it
works
very
well.
B
People
will
get
that
message,
hopefully
not
multiple
times,
but
it
does
happen.
So
gossip
sub
is
a
better
version
of
this.
What
gossip
sub
does
is
when
we
connect
through
pub
sub
Network.
We
take
a
subset
of
peers,
so
maybe
there's
20
of
us
in
the
room,
we'll
take
maybe
five
peers
and
we
create
an
overlay
network
with
those
pub
sub
peers
on
national
relations.
What
happens
is
whenever
we
get
a
message.
We
only
send
it
to
those
appears
when
we
subscribe
to
those
peers.
B
We've
also
told
them
that
we
were
adding
them
to
our
men
at
us
to
theirs.
So
they'll
also
send
us
messages.
The
problem
with
this
approach
is
a
peers
might
not
get
messages
like
we're
only
sub
broadcasting
to
some
set.
This
is
this
is
where
gossip
the
gossip
component
comes
in.
So
what
we
do,
in
addition
to
sending
messages
to
our
mesh,
is
we
pick
random
peers
who
aren't
in
our
map?
We
broadcast
the
metadata
about
recent
messages
we've
seen
so
we
might
say:
hey
I,
just
sent
these
five
message.
B
Ids
and
they'll
say:
oh
I
haven't
seen
two
of
those
giving
you
those
messages.
They'll
get
the
message
from
the
peer
and
then
they'll
broadcast
to
their
match.
So
this
is
how
we
overcome
that
issue.
So
it's
a
more
efficient.
That's
up,
so
why
would
you
use
what's
up
support
right
now?
The
only
reason
currently
j/s
and
rust
have
implementations
in
progress.
Hopefully
we'll
get
them
soon.
B
So
this
is
why
you
would
use
Plus
up.
The
advantage
for
all
you
go
folks
is
that
you
can
use
gossips
up
right
now
and
it
will
fall
back
the
klutz
up
for
all
your
peers.
You
don't
to
be
customers,
so
when
we
you
go
yeah
so
chapter
six
deals
with
getting
rid
of
that
super
gross
Jackpine
code
will
look
over
that
at
the
end.
B
I
just
want
to
make
sure
that
we
get
through
the
rest
of
the
content
and
we
can
go
over
what
that
transition
looks
like
how
we
just
switch
over
to
evening
pub
side.
So
total
pub
sub
is
going
to
introduce
messaging
like
protobuf
messaging,
so
we're
chatting
over
pubs
up.
That's
great.
We
actually
are
exchanging
messages
using
protobuf.
B
If
you're
not
familiar
with
wrote
about
it
is
a
data
serialization,
deserialization
library,
just
like
JSON
or
seaboard,
you
don't
have
to
use
protocol,
you
could
use
JSON
or
seaboard
just
most
lathela
p2p
protocols
today
currently
use
proto
buck.
What
put
a
buff
lets
us
do
is
take
data
objects,
serialize
them
send
them
as
binary
our
bytes
over
the
network
and
then
from
there
back
into
objects,
and
that
kind
of
looks
like
this.
B
Currently,
we
were
just
sending
in
Chapter
six
we're
just
sending
messages
over
the
network-
that's
not
terribly
good
use
of
like
one
protocol.
So
how
can
we
make
this
a
little
bit
more
complicated?
Well,
the
loop
EP?
We
do
this
with
two
bucks,
so
you
can
see
here
as
we're
using
in
Chapter
seven
in
the
new
code.
Well
also,
the
J's
code
will
also
have
an
extra
a
request
type.
So
we
add
the
request
types
here.
The
first
one
you'll
see
a
send
message.
D
B
That's
just
our
basic
message:
data
that
we're
sending
this
is
our
data,
our
chat
message
when
we
created
it
and
very
basic
idea
for
the
chat.
We
also
do
an
update
here
of
us,
so
we
add
the
ability.
If
you
are
using
chat,
you
can
do
you
are
in
chapter
8.
You
can
do
/
name
and
rename
yourself
well.
This
is
a
terribly
good
way
to
change
your
name,
because
if
anybody
joins
pub/sub
later
they're
not
going
to
get
your
name
change,
this
alesis
shows
you
how
you
can
go
about
doing
multiple
request
types.
B
B
So
we'll
go
over
that
shortly
as
part
of
chapter
7,
we'll
walk
through
that
code,
but
quickly
we're
going
to
talk
your
about
subnets.
So
we
have
our
chat
protocol.
We
want
to
chat
with
each
other
say,
there's
30
or
40
of
us
in
this
room.
Now
we
all
go
home
when
we
want
to
chat
with
each
other.
If
we
join
the
public
network,
how
do
we
reliably
get
chapped
one
another?
B
B
So
we
can
actually
go
back
to
the
DHT.
In
addition
to
being
able
to
find
peers
and
storing
peer
information,
PhD
also
stores
concept,
provider,
information,
we
store
provider
records.
So
in
approach
to
this,
not
the
only
approach
by
any
mean
but
approach
to
solving
this
subnet
problem
is.
We
can
use
the
DHT
this
similar
concept
to
the
random
walk
to
store
a
provider
record
so,
instead
of
randomly
querying
for
an
ID,
what
we
could
do
is
take
our
chat
topic,
Limpy
TV
chat,
100.
B
We
could
turn
that
into
a
DHT
key
and
do
a
query
to
find
the
closest
peers
to
or
DHCP
so
we
go
up.
We
do
that
random,
walk,
that's
no
longer
random.
We
find
the
closest
20
peers
on
the
network
to
our
topic,
and
then
we
tell
them
that
we're
a
provider
of
that
topic.
So
when
we
subscribe,
we
can
broadcast
that
we
can
set
it.
We
can
also
query
to
find
other
people
who
are
providers
of
that
chat
topic.
So
we
could
go
Cory
out
to
the
network
find
that
information.
B
Now
we
can
tile
each
other.
What
this
gives
us
the
ability
to
do
is
we
can
create
a
mesh
overlay
to
chat
overlay
network,
in
addition
to
being
connected
with
the
broader
network,
and
this
is
going
to
be
an
important
part
of
distributed
systems,
because
if
you
just
blindly
connect
to
the
network
and
broadcast
information,
you're-
probably
not
going
to
be
able
to
reliably
exchange
the
information
that
you
want.
Ultimately,
in
the
distributed
network,
we
need
to
be
able
to
create
areas
of
concern
or
things
that
I
care
about.
I
want
that
information.
B
So
we
want
to
create
overlay
networks.
This
is
a
possible
way
of
doing
that.
So
we
can
take
our
chat,
topic,
register,
unsubscribe
and
query
on
subscribe
and
then
create
overlay.
Network,
there's
not
any
code
currently
in
the
p2p
that
manages
overlays,
but
that
is
something
that
we
probably
want
to
look
at
and
I
think
we're
doing
a
deep
dive
on
connection
management
later
today.
So
if
anybody
is
interested
in
that
come
join-
and
we
can
talk
about
that-
so
that's
n!
Here
we
have
nine
all
right.
B
E
E
B
F
F
F
B
D
B
B
We
have
this
series
of
adverts
this
year,
so
we're
going
to
advertise
those
addresses
to
all
the
peers
and
ultimately,
what
we
do
is
when
we
take
those
addresses
with
p2p
is
going
to
go
through
them
and
find
it's
going
to
filter
for
transport
status
importance
and
then
it's
just
going
to
dial
over
those,
so
you
automatically
will
get.
This
is
why
bringing
multiple
transports
is
is
valuable
because
even
if
you're
just
dialing
over
them
W
go
through
and
say:
okay.
B
B
B
So
if
we
went-
and
we
look
at-
let's
look
at
pops
up
so
when
we
switched
over
to
pops
up,
we
created
a
basic
pub/sub
chat
topic.
Our
pub
sub
chat
object
and
we
changed
over
when
we
got
our
message.
Rather
than
doing
a
protocol
sent
me
now,
you
have
a
pub
sub
chat
set.
So
if
we
go
look
at
our
new
public
sub
chat
type,
we've
got
our
motive
up
here.
B
We'll
see
here
we're
doing
an
encoding
of
protobuf
with
our
mess
of
data,
and
then
we
just
do
with
P
to
be
published
on
pub
side
and
we're
doing
it
to
our
chat
topic.
You
send
the
message
and
that's
it
I
mean
on
any
earth
and
then,
as
must
just
come
in
we
go
in.
We
decode
the
requests.
We
get
the
request
type
and
then
based
on
the
request
type
for
our
profile.
B
So
what
we'll
be
doing
as
a
follow-up
to
this,
because
it
is
a
lot
of
content
that
Jam
into
75
minutes
we're
gonna,
be
putting
together
some
videos
of
each
of
the
chapter
and
just
kind
of
creating
a
video
series.
All
of
the
slides
will
be
posted,
there's
a
bunch
of
speakers.
So
it's
in
the
slides
that
walk
through
everything
as
well
and
then
you
can
check
out
the
reviews
so
we'll
go
through
and
actually
walk
through
the
code.
So
you
guys
can.