This project demonstrates how to connect to the Polygon blockchain using reliable, high-performance RPC endpoints provided by OnFinality.
OnFinality is a leading blockchain infrastructure platform offering scalable, production-ready RPC and API services across multiple Web3 networks. With a few lines of code, developers can access fast and secure endpoints — without the need to maintain or sync their own nodes.
- ✅ Easy connection to Polygon via OnFinality RPC
- 🌐 Global edge network for low-latency requests
- 📊 Scalable API usage for both testing and production
- 🔒 Secure, always-on infrastructure with high availability
-
Clone this repo:
git clone https://github.com/leoonf/Onfinality.git cd Onfinality -
Install dependencies:
npm install
-
Run the script (example with Web3.js):
node index.js
The script fetches the latest block number using OnFinality’s public Polygon RPC:
https://polygon.api.onfinality.io/public
To explore more RPC services or launch your own infrastructure-free dApp, visit OnFinality's official website.
💡 Looking for reliable RPC for Ethereum, Polkadot, Avalanche, or Polygon? OnFinality has you covered.