@cryptotaxi247 / kubo / commits / 31d35d8d1

Add swarm key initialization to README.md

License: MIT Signed-off-by: Caian Benedicto <caianbene@gmail.com>

Caian committed Aug 3, 2019 at 08:19 UTC 31d35d8d11ab477d5c5e35e07e578539ea8469b9
1 file changed +9
README.md
+9
@@ -338,6 +338,15 @@ When starting a container running ipfs for the first time with an empty data dir
338
339 docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
340
341 +It is possible to initialize the container with a swarm key file (`/data/ipfs/swarm.key`) using the variables `IPFS_SWARM_KEY` and `IPFS_SWARM_KEY_FILE`. The `IPFS_SWARM_KEY` creates `swarm.key` with the contents of the variable itself, whilst `IPFS_SWARM_KEY_FILE` copies the key from a path stored in the variable. The `IPFS_SWARM_KEY_FILE` **overwrites** the key generated by `IPFS_SWARM_KEY`.
342 +
343 + docker run -d --name ipfs_host -e IPFS_SWARM_KEY=<your swarm key> -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
344 +
345 +The swarm key initialization can also be done using docker secrets **(requires docker swarm or docker-compose)**:
346 +
347 + cat your_swarm.key | docker secret create swarm_key_secret -
348 + docker run -d --name ipfs_host --secret swarm_key_secret -e IPFS_SWARM_KEY_FILE=/run/secrets/swarm_key_secret -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
349 +
350 ### Troubleshooting
351
352 If you have previously installed IPFS before and you are running into problems getting a newer version to work, try deleting (or backing up somewhere else) your IPFS config directory (~/.ipfs by default) and rerunning `ipfs init`. This will reinitialize the config file to its defaults and clear out the local datastore of any bad entries.