Gangmax Blog

自由之思想,独立之精神

IPFS

| Comments

From here.

  1. Download package file from here.

  2. Extract the package file to a directory which in your “$PATH”.

  3. Run “ipfs init” to init IPFS.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 1. Start daemon.
> ipfs daemon

# 2. List peers.
> ipfs swarm peers

# 3. Get file from the network.
> ipfs cat /ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg > cat.jpg

# 4. Add fils into IPFS.
> cd /media/image
> ipfs add -r .
added QmfW9rrxQWJuxptk8pZiXj9XQKRN5PiY5J3CrmwujGjgfv image/r1.jpg
added QmR2MYSvtHRt3BhEgRZBd2mwe4bLLiGi3J6yLZDqFqJ81t image/r2.jpg
added QmWPoGtPvcq8A6YQEcfm6xRBVpzzitBo7EMitYmudbFnZU image/r3.jpg
added QmXbw3PfctgGujBbigD1pv7tguVy1UzZC6yrsDAPWFjMpE image/r4.jpg
added QmSQUioHCEaWcFsvi3QhU5Gr6ALvgFNnQk1L3ZpL6XiVqQ image/r5.jpg
added QmReZmTM1GuYfCT2UzocUTBZf5aTjVBSkvUmWkyWPtspKx image/r6.jpg
added QmfZERtpVs6iygRUXxgvRnKtEiDJRuwE2kvuTW43Fzg9A5 image
> ipfs ls QmfZERtpVs6iygRUXxgvRnKtEiDJRuwE2kvuTW43Fzg9A5
QmfW9rrxQWJuxptk8pZiXj9XQKRN5PiY5J3CrmwujGjgfv 492223 r1.jpg
QmR2MYSvtHRt3BhEgRZBd2mwe4bLLiGi3J6yLZDqFqJ81t 99409  r2.jpg
QmWPoGtPvcq8A6YQEcfm6xRBVpzzitBo7EMitYmudbFnZU 151825 r3.jpg
QmXbw3PfctgGujBbigD1pv7tguVy1UzZC6yrsDAPWFjMpE 65918  r4.jpg
QmSQUioHCEaWcFsvi3QhU5Gr6ALvgFNnQk1L3ZpL6XiVqQ 176620 r5.jpg
QmReZmTM1GuYfCT2UzocUTBZf5aTjVBSkvUmWkyWPtspKx 189091 r6.jpg

# 5. Open the IPFS web UI in browser.
http://localhost:5001/webui

# 6. Open the file in IPFS.
http://localhost:8080/ipfs/QmR2MYSvtHRt3BhEgRZBd2mwe4bLLiGi3J6yLZDqFqJ81t

Comments