Wetez
  • Hello
  • Invite Wetez
  • User
    • Staking
      • Polygon
      • Cosmos
      • Oasis
      • Mina
      • Evmos
      • Tezos
      • Solana
      • Kava
      • Akash
      • Juno
      • IRISnet
      • Ethereum
      • IoTex
      • Wanchain
      • Gravity Bridge
      • Meter
      • ChainX
      • Edgeware
      • Debio Network
      • Myriad
      • IOST
      • Rebus
      • Teritori
      • Carbon
      • Canto
      • OmniFlix(Coming soon)
      • Projects inactive
        • Polkadot
        • Nym Mixnode
        • Polkadex
        • Findora
        • Sifchain
        • Alaya
        • NFTmart
        • Umee
    • Metamask RPCs
    • IPFS Pinning
  • Developer
    • Appchain
      • Cosmos SDK Chain
      • Substrate Independent Chain
      • Polkadot Parachain
      • Polygon Edge Chain
      • Ethereum Rollups
      • Avalanche Subnet
      • Oasis Paratime
      • BNB Sidechain
    • APIs
      • Ethereum Mainnet
      • Solana Mainnet
      • Polygon Mainnet
      • Arbitrum Mainnet
      • Tendermint Mainnet
      • Error
    • Storage
      • IPFS
      • HTTP API methods
      • add
      • block_get
      • block_put
      • block_stat
      • cat
      • dag_get
      • dag_put
      • dag_resolve
      • get
      • pin_add
      • pin_ls
      • pin_rm
      • pin_update
      • version
Powered by GitBook
On this page
  • /api/v0/add
  • REQUEST
  • RESPONSE
  1. Developer
  2. Storage

add

Add a file or directory to IPFS.

/api/v0/add

Add a file or directory to IPFS.

REQUEST

curl "https://mainnet-rpc.wetez.io/ipfs/$AdminKey/api/v0/add?recursive=false&quiet=<value>&quieter=<value>&silent=<value>&progress=<value>&trickle=<value>&only-hash=<value>&wrap-with-directory=<value>&hidden=<value>&chunker=<value>&pin=true&raw-leaves=<value>&nocopy=<value>&fscache=<value>&cid-version=0&hash=sha2-256" \
    -X POST \
    -H "Content-Type: multipart/form-data" \
    -F file=@"<file>"
curl "https://mainnet-rpc.wetez.io/ipfs/$AdminKey/api/v0/add?pin=false" \
    -X POST \
    -H "Content-Type: multipart/form-data" \
    -F file=@"/sample-result.json"

REQUEST PARAMS

  • file [Required] - The path to a file to be added to IPFS.

  • quiet [Optional] - Write minimal output.

  • quieter [Optional] - Write only final hash.

  • silent [Optional] - Write no output.

  • progress [Optional] - Stream progress data.

  • trickle [Optional] - Use trickle-dag format for dag generation.

  • only-hash [Optional] - Only chunk and hash - do not write to disk.

  • wrap-with-directory [Optional] - Wrap files with a directory object.

  • pin [Optional] - Pin this object when adding. The default is true.

  • raw-leaves [Optional] - Use raw blocks for leaf nodes. (Experimental)

  • nocopy [Optional] - Add the file using filestore. (Experimental)

  • fscache [Optional] - Check the filestore for pre-existing blocks. (Experimental)

  • cid-version [Optional]: Cid version. Non-zero value changes the default of raw-leaves to true. The default is 0. (Experimental)

  • hash [Optional]: Hash function to use. Sets cid-version to 1 if used. The default is sha2-256. (Experimental)

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

BODY

{
    "Name": "wetez-ipfs",
    "Hash": "QmZACwaaaKQpYTFuaaxCC3z8cyJRAkk1bSfVSSViLQPAGu",
    "Size": "12"
}

RESULT FIELDS

  • Name - Name of the object.

  • Hash - Hash of the uploaded object.

  • Size - Integer indication size in bytes.

PreviousHTTP API methodsNextblock_get

Last updated 2 years ago