Ethereum developers typically rely on Infura or Alchemy for easy access to Ethereum nodes. GetBlock is an attractive alternative that provides multi-chain support, a generous free tier, and excellent stability. In this tutorial, you'll discover how to migrate a Truffle + web3.js backend from Infura/Alchemy to GetBlock. I'll quickly cover why you should switch providers and then detail each step: signing up for GetBlock, obtaining an RPC endpoint, re-configuring Truffle, testing web3 connectivity, running deployments, and comparing rate limit and monitoring differences.Prerequisites: You need an existing Ethereum DApp project with Truffle, and Node.js installed. I assume you've been using Infura or Alchemy (with a project ID or API key) and have a mnemonic or private key available for deployment. Let's get started!Why Switch from Infura or Alchemy to GetBlock?==Multi-chain support.== GetBlock allows you to connect to not just Ethereum but 55+ blockchain networks using JSON-RPC, REST, and WebSocket APIs. This allows you to use Ethereum, Bitcoin, BNB Smart Chain, Polygon, Solana, and a lot of others with one platform. Infura and Alchemy, meanwhile, have a shorter list of networks supported (Infura supports Ethereum primarily and some networks like IPFS or certain L2s, and Alchemy supports Ethereum and some chains but not BSC specifically). If your DApp can be more than Ethereum, the broad multi-chain support of GetBlock is a huge plus.\==Generous free tier.== Each of these providers has free plans, but their limitations and models are different. Infura's free plan conventionally provided around 50,000 requests per day (now measured as 3 million daily credits with some rate limiting). Alchemy's free tier offers up to 100 million compute units a month (Alchemy measures different RPC calls as different "compute units"). GetBlock's free tier is very developer-friendly: it offers 50,000 requests a day (reset daily) with a limit of 5 requests a second. Practically, 50k daily calls are sufficient for development and small DApps, and you can always upgrade in case you need more. The free plan is indeed free ("zero fees") and still allows access to all supported chains. The key takeaway here is that GetBlock's free plan should be more than sufficient for typical dev and testing demands.\==Stability and uptime.== GetBlock offers a 99.9% uptime guarantee with a stable 24/7 connection to blockchain networks. That is, you can expect a highly stable service for your DApp backend. Stability is also what Infura and Alchemy are famous for, but GetBlock's infrastructure is built to be rock-solid and scalable. Many developers appreciate the fact that GetBlock provides both shared nodes (with usage limits) and dedicated nodes for heavier workloads, so you have a way to scale up. The correct answer is that the platform is highly reliable, so you won't see variations in network uptime when you switch over – possibly except for better performance in certain instances.Lastly, GetBlock's dashboard has some great monitoring and analytics capabilities, which we'll get to shortly. Now we have the why, let's proceed with the how.Step 1: Register for a GetBlock AccountThe initial step is to register for a free GetBlock account:Navigate to the GetBlock website and click on "Sign Up" (or directly visit the GetBlock dashboard sign-up page). You have a few sign-up options:Email/Password. Sign up using email and choose a password.Social Login. Use Google or GitHub to sign up immediately.Web3 Wallet. You can even sign up by connecting a MetaMask wallet (no email required). This is a great option for developers who are already set up on MetaMask.Choose your preferred method and proceed with the instructions (e.g., verify your email if you chose email sign-up). You ought to have your GetBlock account in a minute or two. Once you've logged in, you'll be taken to the GetBlock Dashboard.==Note. The GetBlock dashboard is where you'll be handling your API endpoints, monitoring usage, and adjusting settings. Go ahead and look around once you've signed up. You'll see your user ID on the account settings (useful if you ever need support), but more importantly, you'll be configuring project endpoints next.==Step 2: Get Your GetBlock RPC Endpoint (API Key and URL)Account created, you'll now need to create an RPC endpoint for the Ethereum network (or whatever network you need). This will provide you with an HTTP URL (and corresponding WebSocket URL if needed) that you'll use in place of Infura/Alchemy.Create a new endpoint:In the GetBlock Dashboard, find the "Create Endpoint" or "Add New Endpoint" button. Click on it to start creating a new connection.Select the blockchain network. As in our case, choose Ethereum from the list of available protocols. Then select the network type:For Ethereum Mainnet, choose Mainnet.For a testnet, choose the specific test network (GetBlock now supports Ethereum Sepolia).Optionally provide a name/label for this endpoint (e.g., "MyDApp Ethereum Mainnet") to make it easier for you to keep track in case you configure more than one endpoint.Click Create or Confirm. The dashboard will generate your endpoint details.After creation, you should see an RPC URL for your endpoint. It should look something like:Copy this URL; you'll be passing it into your Truffle config. GetBlock can show you a WebSocket URL (beginning with wss://) for the same endpoint, and when your application requires WebSockets (for subscriptions or live events), you can utilize that. In our tutorial, we'll use the HTTP endpoint.==Important.== Store your GetBlock API key safely. Don't commit it into public repos or client-side code. Best practice is to store it as an environment variable or config file outside source control. I'll demonstrate with environment variables in the next step.You now have a GetBlock endpoint URL and API key, ready to use. Now, let's insert that into Truffle.Step 3: Change Truffle Configuration to use GetBlockYour truffle-config.js (or truffle.js in older versions) is where you configure network settings. If using Infura or Alchemy, your config could have looked something like this for a network:require('dotenv').config();const HDWalletProvider = require('@truffle/hdwallet-provider');const INFURA_PROJECT_ID = process.env.INFURA_PROJECT_ID;const MNEMONIC = process.env.MNEMONIC; // or a private keymodule.exports = { networks: { ropsten: { provider: () => new HDWalletProvider(MNEMONIC, `https://ropsten.infura.io/v3/${INFURA_PROJECT_ID}`), network_id: 3, gas: 5500000, confirmations: 2, timeoutBlocks: 200, skipDryRun: true }, // ... other networks ... }, // ... other Truffle config ...};Our goal is to replace the Infura URL with the GetBlock URL (and similarly for any Alchemy URLs). The good news is that GetBlock’s RPC works the same way – you provide an endpoint URL and your wallet provider.==Install HDWalletProvider.== If your Truffle project isn’t already using @truffle/hdwallet-provider (it likely is, if you deployed via Infura/Alchemy), install it with npm install @truffle/hdwallet-provider. This library allows Truffle to sign transactions with your keys and send them through the remote node.Modify truffle-config.js. Add your GetBlock API key to your environment variables (for example, in a .env file set GETBLOCK_API_KEY=). Also ensure your mnemonic or private key is in an env var (e.g., MNEMONIC or PRIVATE_KEY). Then update the network config. For example, to use Ethereum Sepolia testnet via GetBlock:require('dotenv').config();const HDWalletProvider = require('@truffle/hdwallet-provider');const PRIVATE_KEY = process.env.PRIVATE_KEY; // your wallet private key (hex string, no 0x)const GETBLOCK_KEY = process.env.GETBLOCK_API_KEY; // your GetBlock API keymodule.exports = { networks: { sepolia: { provider: () => new HDWalletProvider( PRIVATE_KEY, `https://eth.getblock.io/sepolia/?api_key=${GETBLOCK_KEY}` ), network_id: 11155111, // Sepolia network ID gas: 5500000, // Gas limit, adjust as needed confirmations: 2, // # of blocks to wait between deployments (optional) timeoutBlocks: 200, // # of blocks before a deployment times out (optional) skipDryRun: true // Skip dry run before migrations (recommended for public nets) }, // ... other networks (mainnet, etc) ... }, // ... rest of config ...};That’s it! The key change is the URL: we used https://eth.getblock.io/... with our ?api_key= query parameter. Now, whenever you run Truffle with the sepolia network, it will route through GetBlock instead of Infura. If you want to configure Mainnet, you can add a similar section: mainnet: { provider: () => new HDWalletProvider( PRIVATE_KEY, `https://eth.getblock.io/mainnet/?api_key=${GETBLOCK_KEY}` ), network_id: 1, gas: 5500000, gasPrice: 20e9, // e.g., 20 Gwei (you may adjust according to network conditions) confirmations: 2, timeoutBlocks: 200, skipDryRun: true }Be sure to replace with the correct network_id for your network (the Ethereum mainnet is 1, Sepolia is 11155111, etc.). Save your changes to your configuration file.==Note.== The https://eth.getblock.io//?api_key=.. is what use here, but GetBlock also supports embedding the key in the path (as you might see in some examples). Both are equivalent. It's more typical to use the query parameter and is easy to deal with string templates.Step 4: Deploy and Test web3.js with GetBlockBefore sending your contracts out, it's a good idea to check that everything is configured properly. You can do this in several ways:Truffle Console. Run truffle console --network sepolia (or the name of the network you specified). This will launch a console with Web3 available interactively. Try running something as a test, such as this: await web3.eth.getBlockNumber(). If everything is properly set up, this should display the current block number on that network via GetBlock. If you get a response, your connection is solid!\Node.js Script. Alternatively, you could test using web3.js in a standalone script. First, make sure you have web3 installed (npm install web3), then create a simple script like below to get the latest block number:// test-getblock.jsconst Web3 = require('web3');const RPC_URL = `https://eth.getblock.io/sepolia/?api_key=${process.env.GETBLOCK_API_KEY}`;const web3 = new Web3(RPC_URL);web3.eth.getBlockNumber() .then(num => console.log("Latest block number:", num)) .catch(err => console.error("Error connecting to GetBlock:", err));Don’t forget to load your environment variables (you could add require('dotenv').config(); at the top and define GETBLOCKAPIKEY in your .env). Run this script with node test-getblock.js. If it prints a block number, you have successfully connected to GetBlock via web3.js.The above test uses a simple read call (eth_getBlockNumber). You can try more, such as retrieving a block or an account balance, to further confirm things are working. For example:const latestBlock = await web3.eth.getBlock('latest');console.log("Latest block info:", latestBlock);All these requests pass through GetBlock's node. If something is amiss (e.g., you catch an authentication error), check your API key in the URL is correct and the free limit of your account hasn't been exceeded (extremely unlikely with just a few requests).==Pro Tip.== If you have previously used Alchemy's or Infura's web3 provider in code (i.e., Alchemy offers a Web3 client or SDK with custom methods), switching to GetBlock will mean you'll still be using the fundamental Web3 methods. GetBlock is a regular node provider, so web3.js talks to it through the standard Ethereum JSON-RPC calls.Step 5: Run Truffle Migrations and Tests on GetBlockAnd finally, the real test – deploying your contracts and hosting your DApp with GetBlock as your backend provider.==Deploying contracts.== Deploy contracts normally with Truffle, but instruct it to deploy on the network you created for GetBlock. For example:truffle migrate --network sepoliaTruffle will compile your contracts (if they are not already compiled) and then use the HDWalletProvider to broadcast the deployment transactions on the GetBlock RPC. You should be able to view output in the console of transactions sent, confirmations received, etc. The process is the same as it was with Infura/Alchemy – the only difference behind the scenes is the node URL.When deploying to Ethereum mainnet, be sure you have a reasonable amount of ETH available in your deployer account and pay attention to gas prices. The migration command would be truffle migrate --network mainnet (make your mainnet config point to GetBlock). The experience should be the same as Infura's: GetBlock is simply forwarding your signed transactions to the Ethereum network.==Running tests.== If you have Truffle tests or scripts that invoke your contracts, you can test them on the network offered by GetBlock as well:truffle test --network sepoliaThis will run your test suite on the GetBlock endpoint. Testing transactions (e.g., a contract function call on your deployed contracts) will be relayed over GetBlock's node. Again, you shouldn’t see any difference in behavior.==Expected behavior.== With a few exceptions, RPC endpoint switching isn't supposed to impact Ethereum's behavior. If your migrations or tests ran fine on Infura/Alchemy, they should run fine on GetBlock. All default JSON-RPC calls are supported for GetBlock (e.g., deploying contracts, reading state, sending transactions, event queries) – it is a full node service. If a JSON-RPC call is ever removed for any reason, GetBlock's docs will typically indicate it, but simple calls like deploying (eth_sendRawTransaction), calls (eth_call), receiving receipts, etc., are all available.Congratulations! Your DApp's backend is now on GetBlock! Your migration is done. Your web3 calls are utilizing GetBlock's infrastructure and your smart contracts are live.Handling API Keys, Rate Limits, and Monitoring on GetBlockChanging providers is not only a matter of updating URLs – it's also necessary to know if there are differences in how usage is tracked as well as monitoring your DApp's performance on the new provider. There are several points to remember when you switch from Infura/Alchemy to GetBlock.==API Key Setup.== Infura used a project ID in the URL; Alchemy used API keys rather more often in the form embedded in the URL as well (or a custom domain). GetBlock's approach is also the same – you will have an access token (API key) and you add this to the RPC URL. On a functional level, your application doesn't have to make your key do anything unusual other than include it in the endpoint URL. Likewise, as you've secured your Infura Project ID or Alchemy API Key, secure GetBlock's key (store in an environment variable, not client-side code).==Rate limits and throughput.== There are per-provider limits on the free tier:GetBlock Free Tier. 50,000 compute units per day and max 5 requests per second. In practice, 1 simple RPC call ≈ 1 CU (more complex calls like logs could be more counted, as with Alchemy's system). The 5 RPS restriction will make you not burst more than 5 requests in the same second on free tier. If so, subsequent calls may be refused with a rate-limit response. For all but the most busy DApps, 5 RPS is fine while developing – but if your backend scripts are making lots of concurrent calls, you may need to rate-limit them or consider switching to a more expensive plan (the one after this offers 25 RPS).\Infura. Infura's free tier was circa 100k requests/day historically and since their new configuration, it's 6 million credits/day throughput of up to 2,000 credits/sec (which is roughly the equivalent of perhaps ~2000 simple calls/sec). Infura's generous free plan RPS is very kind, but note the fact that not all calls are 1 credit (some big calls are more credits). Either way, if your DApp wasn't hitting Infura's limits, it likely won't hit GetBlock's either, by similar scale.\Alchemy. Alchemy's 100M free tier monthly of compute units is significant as well. They have no hard RPS fee, but intense usage will consume those compute units quickly. Alchemy bills calls (e.g., a simple ETH call might be 0.5 CU, a complex one 10 CUs, etc.). If you weren’t close to 100M units, you should be fine switching to 50k/day (≈1.5M/month) on GetBlock for dev. If 50k/day is not enough (e.g., if you are running a production app on a free plan – not typical), you might have to move to GetBlock's paid plans which offer much higher monthly CUs.==Monitoring Usage.== Another awesome aspect of GetBlock is its dashboard with complete analytics. On the main page of your dashboard, you receive an overview of your current plan, remaining CUs for the day, your current RPS threshold, and cumulative requests taken in the last 24 hours. This lets you immediately know whether you are reaching your daily limit. In addition, in your endpoints' "Statistics" or "Analytics" tab, GetBlock provides charts and breakdowns of:\Number of requests over timeResponse statuses (so you can see if there were any errors)Method call distribution (which RPC methods you’re calling the most)Any rate limit rejections (if you hit the RPS limit)Monitoring these metrics is highly recommended, especially as you transition. For example, if you wrote a script by mistake that floods the network with calls, the dashboard will show an increase in request volume or even some 429 rate-limit responses. This is where you would want to optimize your DApp's backend calls. Infura and Alchemy also offer dashboards, but the advantage with GetBlock is that you can track all your multi-chain usage from a single place.==Handling limits.== In case the free plan isn't sufficient (maybe your app is expanding), GetBlock has easy upgrades – Starter plan (~50M CUs/month, ~1.6M/day, 25 RPS) and Pro plan (600M/month, 200 RPS). You can upgrade directly from the dashboard. But during development, you will not likely need this. Also note that unused daily CUs in free plan aren't carried over (they reset daily), so it isn't worth saving calls – just use what you need.==Multiple endpoints.== GetBlock free plan includes support for up to 2 access tokens (endpoints). That means you can create one for mainnet, one for testnet, i.e. – keep your projects or environments isolated. Every endpoint will have its own API key and usage tracking. This is comparable to Infura's "Project ID per project" approach. It is a good practice to have separate endpoints for dev versus production so that you can track usage independently.Best Practices for Seamless MigrationHere is what I recommend you:Maintain environment variables. Place your API keys and secrets (mnemonic/private key) in an .env file or in your system environment, not in source code. This makes switching endpoints easier and more secure.\Test on a testnet first. While switching providers, attempt to deploy on a test network (Sepolia) with the help of GetBlock before working on mainnet. This makes sure that your setup is right. After confirmation, you can shift your mainnet setup.\Compare behavior. It is a good idea to do some sanity checks after migration – i.e., get a known contract's data via Infura and via GetBlock and compare that the results are identical. They should be, since both are reading from Ethereum, but this can give confidence that GetBlock is in full sync (GetBlock does run full nodes, so it should be).\WebSockets (if required). If your backend relies on WebSocket subscriptions (i.e., listening to events), GetBlock does offer that too. Simply use the wss://go.getblock.io/xxxxxxx URL in a Web3 WebsocketProvider. Ensure that your plan covers the throughput your subscriptions require (the same RPS limits apply to websockets). The majority of developers, however, use WebSockets in the frontend (with a library like MetaMask or Alchemy's subscription API). In purely backend contexts, WebSockets are less common, but it’s good to know GetBlock has the option.\No frontend changes. Since this migration is backend-facing, your frontend (if you have one) doesn't have to change. If you were using MetaMask to connect to a testnet using Infura, you can still do so – MetaMask does not require GetBlock for connecting users (though GetBlock can also provide custom RPC endpoints for MetaMask). The separation of concerns (frontend vs. backend) remains.ConclusionBy following this tutorial, you have now migrated your Ethereum DApp backend from Infura/Alchemy to GetBlock. Your Truffle configuration now points to GetBlock's RPC, and you can deploy contracts and make web3.js calls through GetBlock the same way you could before. Migration will not alter the function of your DApp, yet it positions you to readily add additional blockchains or boost usage without running your own nodes.