a[x]
k
, retrieve value val(k)
scheme: //[userName
[:password@]] serverMachineName [:port]/ [path] [/resource]
[?parm1=parma &parm2=parmb]
http
, the port defaults to 80,
and the path given is ~pmateti/
.
QmZpfhN5rucQC4kx7Gu5udS8FXxsxMddiDCvG8WFjG8SMv
Qm
correspond to SHA-256 and 32 byte
length.
bytes
. The Qm...
should be stored as a string
.
/ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg
http://localhost:8080/ipfs/QmR96iiRBEroYAe955my8cdHkK4kAu6SApGC2eS5kSzHwt/
struct Multihash { bytes32 hash uint8 hash_function uint8 size }
$ ipfs add -w example.txt added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH example.txt added QmVFDXxAEC5iQ9ptb36dxzpNsQjVatvxhG44wK7PpRzsDE
Figure 1: Client-Server v P2P
Figure 2: Centralized Decentralized Distributed
ipfs:/.../...
.
mount
-ed.
ipfs init
Figure 3: IPFS Layers (the left half names pre-existing systems)
Figure 4: IPFS stack, divided
Figure 5: InterPlanetary Linked Data
Figure 6: libp2p included protocols
Figure 7: libp2p routing
type IPFSRouting interface { FindPeer(node NodeId) // gets a particular peer’s network address SetValue(key []bytes, value []bytes) // stores a small metadata value in DHT GetValue(key []bytes) // retrieves small metadata value from DHT ProvideValue(key Multihash) // announces this node can serve a large value FindValuePeers(key Multihash, min int) // gets a number of peers serving a large value }
ipfs name publish QmNUhKfcGJyQJnZu3AKn8NoiomDwDCRBicgqPt1YRqJBCz Published to QmYmmfn68vkcFDeZz1NTZyEXTixjjUnUS6UaPdMSsUBWxs: /ipfs/QmNUhKfcGJyQJnZu3AKn8NoiomDwDCRBicgqPt1YRqJBCz
QmYmmfn68vkcFDeZz1NTZyEXTixjjUnUS6UaPdMSsUBWxs
was
the peer ID.
Figure 10: A Merkle Bin Tree of Four Blocks
##
Figure 12: Observer Pattern
Figure 13: PubSub Pattern
https : //ipfs.io/ipfs/
QmdPtC3T7Kcu9iJg6hYzLBWR5XCDcYMY7HV685E3kH3EcS/ 2015/09/15/ hosting-a-website-on-ipfs/
[Blanks inserted for readability]
Figure 14: Orbit P2P Chat on IPFS