Catalogue1. IPFs Introduction 2. IPFs Local Environment Installation 2.1 Download IPFs Compression Pack 2.2 installation 3. Project configuration 3.1 Create IPFs node 3.2 Modify node default storage 3.3 View Node ID 3.4 Start node Server 3.5 cross-domain resource share cors configuration 3.6 authentication 4. Next trailer
1. IPFs Introduction
IPFs (interplanetary file system) is a point-to-point distributed hypermedia Distribution protocol that consolidates the best distributed system ideas of the past few years, providing a globally unified addressable space for everyone, including git, self-supporting file system SFS, BitTorrent and DHT are also considered to be the next generation of Internet protocols that are most likely to replace HTTP.
IPFs replaces traditional domain-based addressing with content-based addressing, where the user does not need to be concerned about the location of the server, regardless of the name and path of the file store. We put a file into the IPFs node and we get a unique cryptographic hash based on its content. The hash value directly reflects the contents of the file, even if only 1 bits are modified, and the hash value is completely different. When IPFs is asked for a file hash, it uses a distributed hash table to locate the node where the file is located, retrieve the file, and verify the file data.
IPFs is a common-purpose infrastructure with little storage limitations. Large files are cut into small chunks that can be downloaded from multiple servers at the same time. IPFs network is not fixed, fine-grained, distributed network, can be well adapted to the requirements of the content distribution network. This design can be used to share all kinds of data, including image, video stream, distributed database, whole operating system, module chain, backup of 8-inch floppy disk, and static website.
IPFs provides a friendly Web Access interface that allows users to get content from the IPFs network through Http://ipfs.io/hash, and perhaps in the near future, the IPFS protocol will completely replace the traditional HTTP protocol. 2. IPFs Local Environment installation 2.1 Download IPFs compression pack
2.2 Installation
Liyuechun:downloads yuechunli$ pwd
/users/liyuechun/downloads
liyuechun:downloads yuechunli$ ls
go-ipfs_v0.4.10_darwin-amd64.tar.gz
liyuechun:downloads yuechunli$ tar xvfz go-ipfs_v0.4.10_ darwin-amd64.tar.gz
x go-ipfs/build-log
x go-ipfs/install.sh
x GO-IPFS/IPFS
x go-ipfs/license
X go-ipfs/readme.md
liyuechun:downloads yuechunli$ ls
go-ipfs go-ipfs_v0.4.10_darwin-amd64.tar.gz
liyuechun:downloads yuechunli$ cd go-ipfs
liyuechun:go-ipfs yuechunli$ ls
LICENSE readme.md build-log install.sh IPFs
liyuechun:go-ipfs yuechunli$ mv Ipfs/usr/local/bin/ipfs
Tar xvfz go-ipfs_v0.4.10_darwin-amd64.tar.gz file extract.
MV Ipfs/usr/local/bin/ipfs, move the IPFs file in the Unpacked folder to the/usr/local/bin/folder. 3. Project configuration 3.1 Creating a IPFs node
In order to run the project, we need to establish a IPFs node on the local computer through IPFs init.
Localhost:.ipfs yuechunli$ cd ~/.ipfs
-BASH:CD:/users/liyuechun/.ipfs:no such file or directory
localhost:. IPFs yuechunli$ IPFs init
initializing IPFs node At/users/liyuechun/.ipfs
generating 2048-bit RSA keypair ... Done