@synthetixio/ipns-deploy

1.0.1 • Public • Published

@synthetixio/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 @synthetixio/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

# Publish a CID to an IPNS key
# Usage: ipns-deploy KEY CID

# Example: Publish the CID obtained from ipfs-deploy to the 'staking.synthetix.eth' IPNS key
ipns-deploy "staking.synthetix.eth" QmAbCdEf1234567890

# Publish a CID obtained from an `ipfs-deploy` execution to the 'staking.synthetix.eth' IPNS key
export IPFS_CID=$(ipfs-deploy ./public)
ipns-deploy "staking.synthetix.eth" "$IPFS_CID"

# DEBUG mode to view additional information
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

  1. Generate new key

    ipfs key gen --type=rsa --size=2048 staking.synthetix.eth
    # This returns the key ID (IPNS name)
    # k2k4r8jvf8qlg4ytq7y3ta749vkjzms0hisd9i92ohk0lsp0yestbhy3
  2. Check all the keys added

    ipfs key list -l
    # ...
    # k2k4r8jvf8qlg4ytq7y3ta749vkjzms0hisd9i92ohk0lsp0yestbhy3       staking.synthetix.eth
  3. Check the IPNS URL can be resolved

    curl http://k2k4r8jvf8qlg4ytq7y3ta749vkjzms0hisd9i92ohk0lsp0yestbhy3.ipns.localhost:8080/

Readme

Keywords

none

Package Sidebar

Install

npm i @synthetixio/ipns-deploy

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

5.57 kB

Total Files

7

Last publish

Collaborators

  • noisekit
  • joey-synthetix
  • justinjmoses
  • synthetixio-team
  • ajsantander
  • drptbl
  • klbyte