Go implementation of ipfs Azure datastore. Using it as a plugin for ipfs allows you to host ipfs files on Azure blob storage. This is a concrete implementation of the interface https://github.com/ipfs/go-datastore. And the instructions for ipfs plugin modules can be found here https://github.com/ipfs/go-ipfs/blob/master/plugin/loader/preload_list
- Golang https://golang.org/dl/
- Make https://www.gnu.org/software/make/
- This build process only work on Linux/Mac. To run on Windows, Windows Linux subsystem is required: https://docs.microsoft.com/en-us/windows/wsl/install-win10
- download go-ipfs source code from https://github.com/ipfs/go-ipfs
- cd into go-ipfs
- use command
go get github.com/decentralized-identity/go-ipfs-ds-azure@latest
- add
azureds github.com/decentralized-identity/go-ipfs-ds-azure/plugin 0
to the following file "go-ipfs/plugin/loader/preload_list" - cd back to go-ipfs
- use command
make install
- ipfs should have the azureds plugin now
Once ipfs is successfully built, use the following configurations
-
add the following to store_spec in ipfs
{"mounts":[{"accountName":"INSERT_ACCOUNT_NAME","containerName":"INSERT_CONTAINER_NAME","folderName":"INSERT_FOLDER_NAME","mountpoint":"/blocks"},{"mountpoint":"/","path":"datastore","type":"levelds"}],"type":"mount"}
-
replace the default block mount point with the following in config for ipfs under Spec.mounts
{ "child": { "accountName": "INSERT_ACCOUNT_NAME", "accountKey": "INSERT_ACCOUNT_KEY", "containerName": "INSERT_CONTAINER_NAME", "folderName": "INSERT_FOLDER_NAME", "type": "azure-data-store" }, "mountpoint": "/blocks", "prefix": "azure.datastore", "type": "measure" },
-
(optional) it is also possible to switch the root mount point from levelds to Azure, but block is the bare minimum for data to be persistent.
-
now you can run ipfs with the config file and it will connect to Azure
ipfs init CONFIG_FILE_NAME