Public IPFS Gateways

Docker usage

$ export ipfs_staging=</absolute/path/to/somewhere/>
$ export ipfs_data=</absolute/path/to/somewhere_else/>
$ docker run -d --name ipfs_host -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p -p ipfs/go-ipfs:latest

Watch log and Wait for ipfs to start:

$ docker logs -f ipfs_host

The ipfs is running when you see this on the log:

Gateway (readonly) server
listening on /ip4/

Connect to peers:

$ docker exec ipfs_host ipfs swarm peers

Add files:

$ cp -r <something> $ipfs_staging
$ docker exec ipfs_host ipfs add -r /export/<something>

Python usage

$ pip install ipfsapi
import ipfsapi

api = ipfsapi.connect('', 5001)
res = api.add('test.txt')

{'Hash': 'QmWxS5aNTFEc9XbMX1ASvLET1zrqEaTssqt33rVZQCQb22', 'Name': 'test.txt'}['Hash'])
{'Addresses': ['/ip4/',
 'AgentVersion': 'go-ipfs/0.4.10',
 'ID': 'QmS2C4MjZsv2iP1UDMMLCYqJ4WeJw8n3vXx1VKxW1UbqHS',
 'ProtocolVersion': 'ipfs/0.1.0',
 'PublicKey': 'CAASpgIwgg ... 3FcjAgMBAAE='}