Getting Your Ethereum Project ID with Infura
As a developer working on an Ethereum-based project, you’ll need to interact with various Ethereum services, including the InterPlanetary File System (IPFS) and the Ethereum Virtual Machine (EVM). To connect to these services, you’ll need a valid Ethereum project ID. In this article, we’ll guide you through the process of obtaining your Ethereum project ID using Infura.
Prerequisites
Before you begin, make sure you have:
- A verified Ethereum wallet with an existing public address.
- An account on Infura, which provides a free Ethereum testnet for testing and development purposes.
- Familiarity with Ethereum wallets, blockchain networks, and the Ethereum Virtual Machine (EVM).
Step 1: Create an Ethereum Wallet on Infura
To start the process, you need to create an Ethereum wallet on Infura’s testnet environment. Follow these steps:
- Go to [Infura]( and sign up for a new account.
- Click on “Testnets” in the top menu bar and select the Ethereum testnet (mainnet is not recommended for production use).
- Click on “Create Wallet” and follow the prompts to create an Ethereum wallet.
- Choose a wallet type (e.g., MetaMask or Truffle) and set up your public address.
Step 2: Get Your Ethereum Project ID
To obtain your Ethereum project ID, you need to create a new resolver configuration using Infura’s createAgent
function from @veramo/core
. You’ll also need the ethr-did-resolver
library, which provides a simple way to interact with IPFS and EVM services.
Here’s an example code snippet:
import { createAgent } from '@veramo/core';
import { DIDResolverPlugin } from '@veramo/did-resolver';
import { getResolver as ethrDidResolver } from 'ethr-did-resolver';
const projectID = 'YOUR_PROJECT_ID_HERE'; // Replace with your Ethereum project ID
const agentConfig: CreateAgentConfig = {
projectId: projectID,
networkName: 'mainnet', // You can use the testnet, but this is not recommended for production
};
const resolverConfig = { ...getResolver as IResolver };
resolverConfig.infuraUrl =
const agent = createAgent(agentConfig);
Replace YOUR_PROJECT_ID_HEREwith your actual Ethereum project ID.
Step 3: Use Your Resolver Configuration to Connect to IPFS and EVM Services
With the resolver configuration in place, you can now connect to IPFS and EVM services using theethr-did-resolver. Here's an example code snippet:
import { IResolvers } from 'infura-node';
import { getResolver as ethrDidResolver } from 'ethr-did-resolver';
const projectID = 'YOUR_PROJECT_ID_HERE'; // Replace with your Ethereum project ID
const resolvers: IResolvers = {};
const resolverConfig = { ...ethrDidResolver };
resolverConfig.projectId = projectID;
const resolver = getResolver(resolvers, resolverConfig);
This code sets up an IResolversobject and uses the
getResolver as ethr-did-resolverfunction to create a resolver configuration. Replace
YOUR_PROJECT_ID_HERE` with your actual Ethereum project ID.
Conclusion
By following these steps, you've successfully obtained your Ethereum project ID using Infura. This allows you to connect to IPFS and EVM services for testing and development purposes. Remember to use this configuration in your production-ready codebase. If you have any further questions or need help with integrating your Ethereum project with other blockchain services, feel free to ask!