Node.js Interactive

Preview:

Citation preview

Stellar Module Management

David Dias, Protocol Labs

Stellar Module ManagementPackageRepoTarballContainer

• Module Management

• npm

• The Web

• IPFS, the InterPlanetary Filesystem

• Module Management

• npm

• The Web

• IPFS, the InterPlanetary Filesystem

• 🌠

Modules Management

• What interfaces are available

• Language biased

• Reusable code, library or project all together

Scope

• Share it

• Make a webpage for the project

• Register it in a public listing

Discover a module

• Use a tool

• Download from a webpage

• Sneaker net

• Email

Transport

• How to deal with constant new

• Notify users

• Avoid breaking compatibility

• Cope with demand

• Security patches

Update

• How to store these modules

• Storage space and bandwidth concerns

Structure

• Check what I’m running

Integrity

• Who owns it

• Who is allowed to change it

• Where can it run

• Where can it be accessible

Ownership

• Scope • Discovery • Transport • Update

• Activity • Structure • Integrity • Ownership

• Storage is cheap

• Bandwidth is virtually “free”

Location Addressing

http://10.20.30.40/foo/bar/baz.png

location path

http://example.com/foo/bar/baz.png

http://10.20.30.40/foo/bar/baz.png

you

http://10.20.30.40/foo/bar/baz.png

10.20.30.40

you

http://10.20.30.40/foo/bar/baz.png

10.20.30.40

you

Permanence Security

IoT

Control

Offline

Bandwidth

Disconnected

a protocol to upgrade the web

PermanentDistributed Safer

SmarterOffline

Faster

SFS

web

DHT+

web

DHT

SFS

routing

network

exchange

merkledag

naming

applications

The Stack

routing

network

exchange

merkledag

naming

applicationsThe Stack

Defining the Data

Moving the Data

Using the Data

IPLD - IP Linked Data

libp2p

IPNS - IP Naming System

{name: ‘martian’…

}

{user: ???

}

{name: ‘martian’…

}

{user: ???

}

hash( ) -> KQsXSobGtbNhF

{name: ‘martian’age: 9001…

}

{user: KQsXSobGtbNhF…

}

hash( ) -> KQsXSobGtbNhF

MERKLE LINK

cvs/svn

cvs/svn

cvs/svn

MerkleDAG

in IPFS data forms a dag

it’s called the merkle dagbecause the links are hashes

blob, tree, commit

unix files and dirs

any data structures are represented as dags

blocks, txns, wallets

kv-stores

http://10.20.30.40/foo/bar/baz.pnglocation path

http://example.com/foo/bar/baz.png

http://10.20.30.40/foo/bar/baz.pnglocation path

http://example.com/foo/bar/baz.png

/ipns/example.com/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.pngcontent path

10.20.30.40

you

HTTP

http://10.20.30.40/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.png

http://10.20.30.40/foo/bar/baz.png

10.20.30.40

you

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.png

IPFS

/ipns/example.com/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.pngcontent path

MUTABILITYIPNS - InterPlanetary Naming System

/ipns/QmYJPtosPTfoC/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.pngcontent path

/ipns/example.com/foo/bar/baz.png

IPNS - InterPlanetary Naming System

MUTABILITY

/ipns/QmYJPtosPTfoC/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.png

QmW98pJrc6FZ6

/ipns/QmYJPtosPTfoC/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.png

QmYJPtosPTfoC

publickey

secretkey

QmW98pJrc6FZ6

publickey

QmW98pJrc6FZ6

secretkey

/ipns/QmYJPtosPTfoC/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.png

QmYJPtosPTfoC

QmW98pJrc6FZ6

publickey

QmW98pJrc6FZ6

secretkey

/ipns/QmYJPtosPTfoC/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.png

QmYJPtosPTfoC

signed by QmYJPtosPTfoC

QmW98pJrc6FZ6

publickey

QmW98pJrc6FZ6

secretkey

/ipns/QmYJPtosPTfoC/foo/bar/baz.png

/ipfs/QmW98pJrc6FZ6/foo/bar/baz.png

QmYJPtosPTfoC

signed by QmYJPtosPTfoC

QmW98pJrc6FZ6

DHT - Distributed Hash Table

DHT are the Holy Grail of P2P Networks

15

610

50

55

1 10 12 20 30 50 54 58 70 88 81 83 88 90 92 95 97 99 101105 300411 500

1 10 12 20 30 50 54 58 70 88 81 83 88 90 92 95 97 99 101105 300411 500

1 10 12 20 30 50 54 58 70 88 81 83 88 90 92 95 97 99 101105 300411 500

hash( ) = 91

1 10 12 20 30 50 54 58 70 88 81 83 88 90 92 95 97 99 101105 300411 500

hash( ) = 91

1 10 12 20 30 50 54 58 70 88 81 83 88 90 92 95 97 99 101105 300411 500

Who has fim , which hash( ) = 91?

What you get

✓ Discovery (through IPNS)

✓ Integrity (through cryptographic hashing)

✓ Activity (the more downloads, the merrier)

✓ Structure (download things at most once)

✓ Transport (stream from every peer that has the module)

✓ Update (just sync the parts that are changed)

✓ Ownership (private clusters, IPNS records signed,

registry-mirror

npm i <insert-module-name> –-registry=<IPFS bridge>

registry-mirrordemo

LXJS 2013 - http://yearbook.lxjs.org

Thank you!David Dias - http://daviddias.me IPFS http://ipfs.io Protocol Labs http://ipn.io