DEVELOPER DOCS
Using Devnet

Using devnet

Uploads to Irys' devnet are paid for using free faucet tokens and are kept for approximately 60 days. Devnet is for developers who are building projects or learning how to use our SDK.

To connect to devnet, set the network parameter to devnet when instantiating either an Irys or WebIrys object.

RPC / Provider URL

When using devnet with the Irys class and with our CLI, you must specify an RPC address. When using the WebIrys class, the RPC address is only required when using non-EVM chains.

ℹ️

If you encounter this message when using our SDK or CLI, make sure you are supplying the correct RPC URL for the chain you're using.

Using Irys devnet requires a dev/testnet RPC to be configured!

Irys class (server-side)

EVM Chains

const getIrys = async () => {
	const network = "devnet";
	const token = "ethereum";
	// Devnet RPC URLs change often, use a recent one from https://chainlist.org/
	const providerUrl = "";
 
	const irys = new Irys({
		network, // URL of the node you want to connect to
		token, // Token used for payment
		key: process.env.EVM_PRIVATE_KEY, // EVM private key
		config: { providerUrl }, // Provider URL, only required when using devnet
	});
	return irys;
};

Solana

const getIrys = async () => {
	const network = "devnet";
	const token = "solana";
	const providerUrl = "https://api.devnet.solana.com";
 
	const irys = new Irys({
		network, // URL of the node you want to connect to
		token, // Token used for payment
		key: process.env.SOL_PRIVATE_KEY, // SOL private key
		config: { providerUrl }, // Provider URL, only required when using Devnet
	});
	return irys;
};

WebIrys class (browser)

EVM Chains

const getWebIrys = async () => {
	// Ethers5 provider
	await window.ethereum.enable();
	const provider = new providers.Web3Provider(window.ethereum);
 
	const network = "devnet";
	const token = "ethereum";
	// Devnet RPC URLs change often, use a recent one from https://chainlist.org
	const rpcUrl = ""; // Required for devnet
 
	// Create a wallet object
	const wallet = { rpcUrl: rpcUrl, name: "ethersv5", provider: provider };
	// Use the wallet object
	const webIrys = new WebIrys({ network, token, wallet });
	await webIrys.ready();
 
	return webIrys;
};

Solana

const getWebIrys = async () => {
	await window.solana.connect();
	const provider = new PhantomWalletAdapter();
	await provider.connect();
 
	const network = "devnet";
	const token = "solana";
	const rpcUrl = "https://api.devnet.solana.com"; // Required for devnet
 
	// Create a wallet object
	const wallet = { rpcUrl: rpcUrl, name: "ethersv5", provider: provider };
	// Use the wallet object
	const webIrys = new WebIrys({ network, token, wallet });
	await webIrys.ready();
 
	return webIrys;
};

CLI

See CLI documentation for examples of how to use each command with our devnet.

irys upload myImage.png \
  -n devnet \
  -t ethereum \
  -w bf20......c9885307 \
  --tags tagName1 tagValue1 tagName2 tagValue2 \
  --provider-url https://rpc.sepolia.dev
ℹ️

Devnet RPC URLs change often, use a recent one from https://chainlist.org/ (opens in a new tab)