Permanently store files on Arweave using Irys' Command Line Interface (CLI).
To install our CLI, you will need to install a current version of node (opens in a new tab) first.
Install our CLI globally using the
-g flag. Depending on your setup, you may or may not need to use
npm i -g @irys/sdk sudo npm i -g @irys/sdk
When executing CLI commands involving funding nodes or signing transactions, you must provide a private key.
-w flag to specify a private key along with the
-c flag to indicate the token you'll use.
irys -w <wallet-file-name> -t <token>
The methods for supplying private keys differ for Ethereum and Solana compared to Arweave.
For Ethereum and Solana, specify the private key directly in the command line every time you execute a CLI command. Note that the CLI does not store the private key, it needs to be included with each command.
irys fund 1000000000000000 -t matic -w bf20......c9885307 -h https://node1.irys.xyz
When using Arweave, the private key is typically stored in a file (commonly named
wallet.json). This file is then referenced in the CLI command, instead of specifying the private key directly.
irys fund 1000000000000000 -t arweave -w wallet.json -h https://node1.irys.xyz
Fund the Node you plan to upload to, balances are not shared between Nodes. You can connect to Nodes 1 and 2 directly.
irys -h https://node1.irys.xyz
When connecting to Devnet, you must supply the additional
irys -h https://devnet.irys.xyz --provider-url https://rpc-mumbai.maticvigil.com
Devnet RPC URLs change often, use a recent one from https://chainlist.org/chain/80001 (opens in a new tab)
fund command to fund a node.
irys fund 1000000000000000 -h https://node1.irys.xyz -t matic -w bf20......c9885307
withdraw command to withdraw funds from a node.
irys withdraw 1000000000000000 -h https://node1.irys.xyz -t matic -w bf20......c9885307
upload command to upload a file.
irys upload myImage.png -h https://node1.irys.xyz -t matic -w bf20......c9885307
upload-dir command to upload a folder.
irys upload-dir ./myImages -h https://node1.irys.xyz -t matic -w bf20......c9885307
-t option, followed by a series of name / value pairs to append metadata tags to your upload.
irys upload myImage.png -t tagName1 tagValue1 tagName2 tagValue2 -h https://node1.irys.xyz -t matic -w bf20......c9885307
price command, followed by a number of bytes to get the cost to upload that number of bytes. You must also provide a token (
-t) and a node URL (
irys price 1000000 -t matic -h https://node1.irys.xyz