基礎篇基epaper.gotop.com.tw/pdf/acd020400.pdf4 第1 章 認識章章 認識ipfsppfs &ðið(0...

12
1.1 IPFS 概述 3 Filecoin IPFS FIL IPFS Filecoin Filecoin IPFS Filecoin IPFS Filecoin IPFS 1.1.2 IPFS 的起源 BitTorrent Kazaa Napster BitTorrent BitTorrent 1000 HTTP HTTP

Upload: others

Post on 03-Feb-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

  • 1.1 IPFS概述 3 基礎篇

    基礎篇Filecoin IPFS

    FIL

    IPFS

    Filecoin Filecoin

    IPFS Filecoin

    IPFS Filecoin

    IPFS

    1.1.2 IPFS的起源

    BitTorrent Kazaa Napster

    BitTorrent BitTorrent

    1000

    HTTP

    HTTP

  • 第 1章 認識 IPFS4 第第 認章 P識第4 第 章  PFS

    HTTP HTTP

    1 Web

    HTTP

    HTTP

    2

    2011 0.7ZB 1ZB

    1 GB 2015 8.6ZB 2016

    16.1ZB 2025 163ZB 2016

    16.1ZB 10 4000GB 4TB

    AWS S3 1 TB GB 0.03

    49TB GB 0.0295

    118.5

    -

    3

    2018 5

    3.3 2017 11

    2009 18 2016 LinkedIn

    1.67 2015 2300

  • 1.1 IPFS概述 5 基礎篇

    基礎篇

    4 HTTP

    PB

    HTTP

    IPFS

    1 1-2 HTTP

    HTTP IPFS

    IPFS BitTorrent IPFS

    60%

    2 IPFS

    3 IPFS

    Filecoin

    4 Web 100

    IPFS

    Git

  • 第 1章 認識 IPFS6 第第 認章 P識第6 第 章  PFS

    1-2 - -

    IPFS

    DHT Kademlia Git

    Self-Certifying File System

    IPFS DHT Distributed

    Hash Table DHT

    DHT BitComet DHT

    Tracker Tracker

    IPFS Kademlia Kademlia

    key Kademlia value

    value

    IPFS IPFS BitTorrent

    BitTorrent

  • 第 1章 認識 IPFS24 第第 認章 P識第2 第 章  PFS

    1.4 IPFS

    IPFS 1-11

    1-11 IPFS

    IPFS

    IPFS

    IPFS

    YouTube

    ISP

    YouTube

  • 第 2章 IPFS底層基礎46 第第 IP章 底F 基第4 第 章 底層基礎

    2

    Centralized Version Control Systems, CVCS

    2-3 CVS Subversion Perforce

    Computer A

    Computer B

    Central VCS Server

    Checkout

    Checkout

    Version Database

    file

    file

    version 3

    version 2

    version 1

    2-3

    VCS

    CVCS

  • 第 2章 IPFS底層基礎52 第第 IP章 底F 基第5 第 章 底層基礎

    Git

    Git blob

    $ git add README test.rb LICENSE$ git commit -m 'initial commit of my project'

    git commit Git

    Git tree

    Git

    Git 5 3 blob 1

    blob tree 1

    tree commit

    2-7

    committree

    blob

    blob

    blob

    98ca9..

    92ec2..

    5b1d3..

    911e7..

    tree

    author

    committer

    92ec2

    Scott

    Scott

    size

    size

    size

    size

    size

    blob

    blob

    blob

    5b1d3

    911e7

    cba0a

    README

    LICENSE

    test.rb

    cba0a..

    requlre ’ruby ’requlre ’pp ’module Test

    module Tester

    2-7

  • 2.3 版本控制(Git) 53 原理篇

    原理篇

    2-8

    Git commit Git

    master

    2-9

    98ca9.. 34ca2.. f30ab..

    size size sizecommit commit committree tree tree

    author

    committer

    92ec2

    Scott

    Scott

    parent parent

    author

    committer

    184ca 0de24

    98ca9

    Scott

    Scott

    author

    committer

    34ac2

    Scott

    Scott

    Snapshot A Snapshot B Snapshot C

    2-8

    98ca9 34ac2 f30ab

    master

    Snapshot A Snapshot B Snapshot C

    2-9

  • 第 3章 IPFS協定堆疊70 第第 IP章 協F 堆第7 第 章 協定堆疊

    ICE NAT

    IPFS

    HMAC

    IPFS IP

    IPFS multiaddr

    # an SCTP/IPv4 connection/ip4/10.20.30.40/sctp/1234/# an SCTP/IPv4 connection proxied over TCP/IPv4/ip4/5.6.7.8/tcp/5678/ip4/1.2.3.4/sctp/1234/

    IPFS Overlay Network

    3-2

    Overlay Network IP

    10.0.9.3 Host

    Host IP

    10.0.9.3

    10.0.9.2

    10.0.9.5

    10.0.9.4

    Gw

    Gw

    B

    A

    eth1

    192.1

    68.5

    9.1

    01

    eth1

    192.1

    68.5

    9.1

    00

    veth1

    veth1

    veth1

    veth1

    3-2

  • 第 3章 IPFS協定堆疊74 第第 IP章 協F 堆第7 第 章 協定堆疊

    type Peer struct { nodeid NodeId ledger Ledger //對等節點之間的分類帳單 last_seen Timestamp //最後收到訊息的時間戳 want_list []Multihash //需要的所有區塊校驗}//協定介面 :interface Peer { open (nodeid : NodeId, ledger : Ledger); send_want_list (want_list : WantList);

    close(final: Bool);}

    Bitswap API

    register wantsand unwants

    send block to other nodesby adding them to theirbuckets

    Decision Engine

    yields thereceivedblocks

    Ledger

    receive a block

    Network

    Transform

    /ipfs/bitswap/1.0.0

    /ipfs/bitswap/1.1.0

    Want Manager

    my want listupdate wantlistmessages

    MessageQueue/peer

    MessageQueue/peer

    3-3 BitSwap

  • 第 3章 IPFS協定堆疊84 第第 IP章 協F 堆第8 第 章 協定堆疊

    "name": "ttt333-name" },

    "name": "ttt333-name/lll111-name"},

    "name": "ttt333-name/lll111-name/bbb222-name" },

    "name": "bbb222-name" } ]}

    ccc111

    ttt111

    ttt333

    111111

    ttt222

    bbb111

    bbb333 bbb444 bbb555

    bbb222

    3-4

    3.7 Naming

    3.7.1 IPNS:命名以及易變狀態

    IPFS DAG IPFS

    IPFS

    IPNS

  • 第 4章 IPFS模組解析108 第第 IP章 模F 解第1 第 章 模組解析

    5 swarm

    swarm libp2p 4-8

    swarm

    swarm stream

    transport transport

    dialer

    upgrader stream

    new relay conn

    relay listener

    relay conn

    relay stream upgrader

    tcp conn listener

    new tcp conn

    relay conn 1

    relay conn 2

    conn connA B C

    A B C

    4-6 libp2p