►
Description
Short look at how
A
Hi
I'm
Lido
part
of
ipf
stewards
group
working
for
protocol
labs
for
a
while,
and
this
is
kind
of
like
a
lightning
talk.
I
wanted
to
give
one
to
revive
a
library
which
we
had
we've
been
using
internally
for
a
long
long
time
and
also
like
show.
It
makes
a
very
nice
small
example
how
to
do
data
structures,
Beyond,
just
files,
ipfs
FS
file
system,
sure,
but
you
can
do
more.
Now.
We
are
investing
more
in
a
simpler
format
for
representing
arbitrary
data
structures,
namely
daxibor.
A
If
you
need
anything
beyond
files
and
directories,
it's
way
simpler
to
do
the
XC
board,
because
it's
regular
cboard
and
that
stock
will
be
about
ipfs
jyp
at
the
centralized
search
index
built
with
dark
seabor.
So
it's
kind
of
like
a
case
study.
So
first,
what
is
ipfs
goip?
It's
a
library
we
use
in
multiple
places,
ipfs
desktop
web
UI,
a
Gateway
Checker.
Even
so,
if
you
install
IPS,
desktop
and
go
to
peer
screen,
you
will
see
a
map
and
at
the
bottom
you'll
see
a
list
of
the
peers.
A
On
the
connection
column,
you
will
see
the
connection
type
if
it's
like
ipv4,
and
that
means
we
have
a
IP
address
of
that
beer
and
we
use
ipfs
to
do
a
lookup
which
city
which
country
that
IP
belongs
to
IPS,
are
migrated
and
sold.
It's
like
a
scale
resource
now,
so
you
need
to
update
the
database
periodically.
If
you
see
connections
being
faster
than
light
between
Europe
and
us,
it
means
we
are
not
that
fast.
A
It's
just
like
the
data
set
is
out
of
date,
so
the
library
is
very
simple:
it's
a
single
function,
lookup
you
pass
ipfs
provider
and
the
IPA
that
you
want
to
look
up
and
you
get
an
object
which
tells
you,
oh,
which
country,
City
and
coordinates
on
the
map
for
that
IP
and
it's
a
ESN
module.
So
you
could
have
a
very
simple
HTML
page.
You
could
use
a
Gateway,
a
public
Gateway.
Now,
thanks
to
trustless
variable
responses,
namely
the
block
one.
A
A
So
how
does
it
work
beyond
that
function?
So
the
jip
data
set?
We
use
is
from
geolite
it's
publicly
available.
The
problem
is
it's
in
a
comma
separated
value
format.
So
what
we
do?
We
read
all
the
data.
It's
format
is
simple.
You
have
a
network
definition,
so
it's
like
a
range
of
ips
and
the
location
for
that
range.
So
it
could
be
a
single
IP.
It
could
be
entire
network.
A
So
we
convert
this
format
to
a
b
tree
and
we
represent
that
as
an
ipfs
dog
and
maybe
like
I,
don't
want
to
go
too
deep,
but
if
you
represent
the
data
set
as
a
dag
at
the
very
top
you
got
as
a
dag
of
ranges
of
ips
like
IP.
Can
it's
just
a
number?
It's
sure
it's
like
four
octets,
but
you
could
convert
it
to
a
single
number
and
then
you
have
just
a
range
of
numbers.
Then
you
range
into
small
buckets.
A
You
build
a
tree
based
on
that,
so
you
have
a
root
and
that
route
points
at
some
children
buckets
and
those
buckets
are
identified
by
like
the
the
cutoff
number
so
like
the
ranges
of
ips.
If
my
the
ipu
are
looking
for
is
in
that
range,
you
follow
that
branch
of
the
tree
and
if
you
like,
go
once
twice
deep
enough,
you
will
end
up
on
a
final
Leaf
node,
which
has
the
information
for
this
IP
or
this
range.
A
If
it's
a
bigger
Network,
yes,
a
network
mask,
you
will
get
this
information,
and
this
is
currently
indexable,
but
it
was
not
like
that
before,
but
general
idea
applies
even
to
the
older
version
and
it's
it's.
The
representing
data
set
like
the
jyp.
A
This
way
is
very
useful
because
it's
something
you
can
write
by
hand,
you
don't
need
dedicated
Library,
especially
if
you
have
knowledge
about
how
what
is
the
most
optimal
way
to
represent
your
data,
how
big
average
networks
are
there's
a
room
for
optimization,
but
even
if
you
do
a
very
naive
implementation
like
this
one,
you
get
a
nice
properties.
So
not
all
IP
ranges,
not
all
IP
networks
are
utilized
equally
they're
like
hot
spots
in
the
data
set,
so
entire
data
sets
it's
like
400,
megabytes
or
200.
A
Your
clients
don't
need
to
have
entire
data
set.
Probably
people
who
are
running
in
Chromecast
Network,
they
will
hit
only
a
few
Network
ranges
for
different
locations,
so
it
the
nice
property,
is
that
if
you
have
this
representation,
your
data
set
kind
of
like
Auto
scales
to
provide
more
replicas
for
the
most
popular
parts
of
the
data
set.
You
get
another
nice
property
for
this
specific
use
case
is
that
when
IPS
get
sold
and
we
have
a
new
version
of
the
data
set,
we
regenerate
it,
but
like
most
of
ips
do
not
move.
A
Most
of
ranges
will
be
the
same.
Only
few
parts
change,
so
we
have
like
data
duplication
across
data
sets.
So
clear
clients
like
ipfs
desktop,
has
a
new
version.
It
still
leverages
the
all
the
blogs
that
are
cached
from
the
old
version.
Those
are
like
immutable
ipfs
blocks
identified
by
CID,
so
you
they're
like
highly
cachable,
especially
if
you
fetch
them
from
a
public
gate
way.
You
Leverage,
The,
HTTP,
cdns,
cache
control
and
all
that
jazz.
A
So
I
mentioned
this
about
Doug
sibor,
and
what
prompted
this
lightning
talk
was
the
fact
that
this
library
is
very
useful.
We
had
it
for
a
long
long
time.
It
shows
how
you
build
the
centralized
search
index
for
something
very
simple,
but
it
was
using
the
all
the
data
formats,
so
it
was
created
in
a
time
when
in
ipfis
we
did
not
have
a
cidb1.
A
Everything
was
multi-hash.
That
meant
every
block
had
to
be
parsed
the
same
way,
and
that
meant
every
block
was
dagdb,
so
the
duck
PB
is
a
format
we
use
for
representing
files
and
directors
right
now.
It
has
a
data
and
licks
Fields,
but
for
this
specific
use
case,
when
we
don't
have
files
and
directories,
but
we
want
to
store
arbitrary
data
structure
B3
like
search
index,
we
abuse
that
format
sort
of
by
storing
Json
in
a
data
field
of
a
node
which
kind
of
was
also
a
directory,
and
that
was
fine.
A
It
still
works
today
if
you
use
like
other
version
of
the
library,
but
it
did
not
work
out
of
the
box
with
a
bunch
of
modern
tooling,
which,
after
CID
V1,
assumes
that
that
PB
is
for
files
and
directories
and
for
everything
else.
You
got
a
better
formats
like
like
siber,
so
the
main
problem.
It
requires
special
reader.
The
jipa
Library
had
a
decision
additional
complexity
because
you
had
to
have
also
like
Proto,
buff
parser,
and
so
it
over
time
it
become
anti-pattern.
A
We
deprecated
object
API,
because
it's
only
about
that
PB
and
we
now
have
like
we
have
dark
seabor
and
we
have
new,
dag
API
in
Kubo,
specifically
for
adding
the
data
structures
which
are
converted
to
taxable
natively.
So
overall,
even
if
it's
fine
and
even
if
you
don't
feel
it's
anti-pattern,
there's
a
performance
hit,
you
put
Json
or
zipper
inside
of
protobuf.
You
always
have
this
overhead.
Let's
use
sieber
directly,
so
the
new
format,
it's
kind
of
like
future
proof,
there's
no
additional
product
of
a
wrapper.
A
It's
every
dark,
Seaboard
object
is
also
a
valid
c
Bar.
Following
the
RFC
from
ietf,
we
have
registered
cboard
tag
42,
which
means
it's
future
proof,
because
any
software
that
will
be
created
in
decades
follow.
They
will
know
the
cboard
attack.
42
means
CID
link,
and
that
gives
you
one
decreases.
The
complexity
of
your
stack
and
another
gives
you
the
Future
Property,
and
it
also
collapses
the
complexity
to
the
point
when
you
don't
need
to
run
ipfs
node
to
utilize.
A
A
We
just
fetch
a
raw
block
from
a
public
Gateway,
just
a
blob,
and
we
parse
that
in
JavaScript
running
on
a
page
using
a
very
small
Library
which
passes
the
seabor
and
traverses
the
links,
so
verifiable,
retrieval
enabled
like
collapses
the
complexity
by
a
lot-
and
this
is
like
a
very
nice
small
demonstration
of
that-
and
you
get
the
size
of
the
reduction
for
free,
mostly
because
we
you
change
Json
to
cboard,
that's
around
22
percent
or
usually,
but
the
remainder
is,
you
know
we
removed
the
unnecessary
fields.
We
you
also.
A
We
also
removed
the
protobuf
wrapper.
So
overall,
the
data
set
of
entire
jop
database
for
the
resolution
of
cities
was
around
400
megabytes
and
after
the
rewrite
it's
270.
But
that's
not
nowhere
close
what
your
client
will
do.
Only
a
few
bytes
will
be
fetched
for
specific
IPS
that
you
have
and
usually
like
on
the
period
screen.
It's
usually
most
of
the
appears
are
stable
enough
or
from
similar
networks.
So
you
won't
be
it's
it's
good
enough
to
use
on
mobile.
You
won't
be
like
training.
A
A
We
could
cut
down
a
resolution
Times
by
optimizing
stuff
around
how
IP
networks
are
shaped
today,
but
it's
a
nice
demonstration
how
to
build
simple
stuff
with
just
dark
siber
and
have
decentralized
Auto
scaling
search
index
for
free
taxi
Prospect
is
on
ipld
website
and
you
can
install
ipfs
desktop
or
go
to
public
Gateway
Checker,
which
I
forgot
to
include
as
a
screenshot
to
see
flags
of
public
gateways
and
those
are
also
resolved.
We
use
DNS
over
https
to
get
IP
of
a
domain
name,
and
then
we
do
the
lookup
over
ipfs
go
IP
jyp.