ipns-deploy
ipns-deploy
is a command-line utility for publishing IPFS content identifiers (CIDs) to IPNS keys. It is designed to work in conjunction with ipfs-deploy
, which uploads files and returns the corresponding CID.
By using ipns-deploy
together with ipfs-deploy
, you can publish your uploaded files' CID to an IPNS key, making it easier to manage and share your content on IPFS.
Install
npm install -g @noisekit/ipns-deploy
ENV
Configure the environment variables with your IPFS cluster credentials and settings.
IPFS_HOST=ipfs.synthetix.io
IPFS_PORT=443
IPFS_PROTOCOL=https
IPFS_USER=
IPFS_PASS=
CLI
Usage and examples
ipns-deploy "staking.synthetix.eth" QmAbCdEf1234567890
export IPFS_CID=$(ipfs-deploy ./public)
ipns-deploy "staking.synthetix.eth" "$IPFS_CID"
DEBUG=ipns-deploy ipns-deploy "staking.synthetix.eth" QmXyZaBc1234567890
IPNS Keys management
If the IPNS key was not added to the IPFS server it needs to be added first.
NOTE: This needs to be executed on the remote IPFS Cluster server
-
Generate PEM PKCS8 key
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out staking.synthetix.eth -outform PEM
-
Import the key
ipfs key import staking.synthetix.eth --format=pem-pkcs8-cleartext staking.synthetix.eth
-
Check all the keys added
ipfs key list
-
Check the IPNS URL can be resolved
curl http://k2k4r8jvf8qlg4ytq7y3ta749vkjzms0hisd9i92ohk0lsp0yestbhy3.ipns.localhost:8080/