Difference between revisions of "InterPlanetary File System"
(→References) |
(→Troubleshooting) |
||
Line 64: | Line 64: | ||
API server listening on /ip4/0.0.0.0/tcp/5001 | API server listening on /ip4/0.0.0.0/tcp/5001 | ||
Is your IPFS API configured to allow cross-origin (CORS) requests? If not, run these commands and then start your daemon from the terminal: | Is your IPFS API configured to allow cross-origin (CORS) requests? If not, run these commands and then start your daemon from the terminal: | ||
− | + | WINDOWS POWERSHELL - WINDOWS CMD | |
+ | PS C:\Users\rp_to> $a = '[\"http://localhost:3000\", \"https://webui.ipfs.io\", \"http://127.0.0.1:5001\"]' | ||
+ | PS C:\Users\rp_to> $a | ||
+ | [\"http://localhost:3000\", \"https://webui.ipfs.io\", \"http://127.0.0.1:5001\"] | ||
+ | PS C:\Users\rp_to> ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin $a | ||
+ | |||
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://192.168.254.24:5001", "http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io"]' | $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://192.168.254.24:5001", "http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io"]' | ||
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]' | $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]' |
Revision as of 16:40, 5 November 2020
Contents
Full Title
The InterPlanetary File System (IPFS) is a protocol and peer-to-peer network for storing and sharing data in a distributed file system. IPFS uses content-addressing to uniquely identify each file in a Global Namespace connecting all computing devices.[1]
Context
- IPFS was first deployed in 2015 and grew by word-of-mouth as a replacement to HTTP for static content.
- It allows users to host content as well as to search for it.
- If users do not wish to host content, they can access IPFS by a public gateway.
Windows
The context of this wiki page is windows, but the typical context of go is GNU so some helpful translations are
- ~ tilde is the same as $HOME which in Powershell is $env:USERPROFILE
- ~/ipfs is the default directory for all things ispf include the config file
- the most significant part of the config that might want to be changed are here - note in particular "API": "/ip4/127.0.0.1/tcp/5001", which may need to be changed to 0.0.0.0 if you need to access ipfs from any devices other than localhost.
"Addresses": { "Swarm": [ "/ip4/0.0.0.0/tcp/4001", "/ip6/::/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic", "/ip6/::/udp/4001/quic" ], "Announce": [], "NoAnnounce": [], "API": "/ip4/127.0.0.1/tcp/5001", "Gateway": "/ip4/127.0.0.1/tcp/8080" }, "Mounts": { "IPFS": "/ipfs", "IPNS": "/ipns", "FuseAllowOther": false }
Installing
- go ipfs installation instructions
- go ipfs on Github from Google has installation and test advice using the command line interpreter (CLI) instructions.
For Windows using chocolatey.
> choco install go-ipfs > ipfs init > ipfs daemon
By default the client looks for a daemon at http://localhost:5001. This can be overridden by either setting the environment variable IpfsHttpUrl or initializing the client with an URL.
// js-ipfs likes this address static readonly IpfsClient ipfs = new IpfsClient("http://127.0.0.1:5002");
Test to see if the daemon is running by typing this in your browser.
http://localhost:5001/ipfs/bafybeianwe4vy7sprht5sm3hshvxjeqhwcmvbzq73u55sdhqngmohkjgs4/#/
Using
IPFS can run in either online or offline mode. Online mode is when when you have IPFS running separately as a daemon process. If you do not have an IPFS daemon running, you are in offline mode. Some commands, like ipfs swarm peers, are only supported when online.
- The WebUI instructions at the place where CORS headers are addressed for enabling access between computers.
Solutions
- the Sidetree protocol uses IPFS to insure that Identifiers are unique.
- A nice view of the CLI interface to ipfs from infura.
Troubleshooting
Check out the installation guide in the IPFS Docs, or try these common fixes:
Is your IPFS daemon running? Try starting or restarting it from your terminal:
ANY SHELL $ ipfs daemon Initializing daemon... API server listening on /ip4/127.0.0.1/tcp/5001 or if you are running on multiple computers API server listening on /ip4/0.0.0.0/tcp/5001
Is your IPFS API configured to allow cross-origin (CORS) requests? If not, run these commands and then start your daemon from the terminal:
WINDOWS POWERSHELL - WINDOWS CMD PS C:\Users\rp_to> $a = '[\"http://localhost:3000\", \"https://webui.ipfs.io\", \"http://127.0.0.1:5001\"]' PS C:\Users\rp_to> $a [\"http://localhost:3000\", \"https://webui.ipfs.io\", \"http://127.0.0.1:5001\"] PS C:\Users\rp_to> ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin $a
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://192.168.254.24:5001", "http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io"]' $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
References
- ↑ Klint Finley, The Inventors of the Internet Are Trying to Build a Truly Permanent Web (2016-06-20) Wired (magazine) https://www.wired.com/2016/06/inventors-internet-trying-build-truly-permanent-web/
Other Material
- IPFS Shipyard - Incubated projects by the IPFS Community.