How to use Nodies for your Dapp

7V9R...YaGh
22 Jun 2024
40


As Web3 becomes more streamlined and decentralized app development increases, the need for lightning-fast gateway providers to decentralized blockchain data also grows. Nodies addresses this need by offering efficient and reliable access to blockchain data.

How does Nodies archive it?

In a nutshell Nodies is part of an ongoing partnership with the Pocket Network Foundation more you can find here. 

It has implemented public RPC endpoints utilizing the Pocket Network's decentralized infrastructure for relaying RPC requests.

Remote Procedure Call (RPC): A protocol that enables one program to execute a procedure or service in another program on a different machine within a network. In Blockchain it facilitates communication and data exchange between nodes, clients, and servers in the blockchain network.




Integrate Nodies to your NextJS dapp


As a quick setup will create a barebone wallet connect using 'wagmi' package including RPC URL provided by Nodies.

Lets start creating bare 🦴 NextJs app with

npx create-next-app@latest

Then just follow the guide from Family ConnectKit docs here.

const config = createConfig(
  getDefaultConfig({
    chains: [mainnet, polygon, avalanche],
    transports: {
      [mainnet.id]: http(
        `https://lb.nodies.app/v1/5e9daed367d1454fab7c75f0ec8aceff`, //Add here!
      ),
    },

    walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID as string,

    appName: "Get started with Nodie powered by POKT",
    appDescription: "Walllet Connect with Nodie",
    appUrl: "https://family.co",
    appIcon: "https://family.co/logo.png",
  }),
);


From Web3Provider.tsx example add your preffered networks like polygon, avalance etc and inside transport config pass in nodies HTTP link.


The site you can reach here on the left side you just copy endpoint link and paste it. The right side is when you log in with Github can have added features like logs, statisitcs add API keys and even Websockets comming soon! 😉

Note: Be sure to add your .env file and WalletConnect Project ID follow this link to create an account and to generate projectId key.


When all set and done with the short guide referenced above you should see something like this when connected.

If you encountered issues with NextJS(I sure had) bellow I have attached dead simple repo including everything above(excluding .env duhhh)
https://github.com/Mozes721/WalletConnect

Honorable Mentions

If you want something even more flexible and additional features like utilizing your backend to your Dapp you can go up a notch using
https://docs.grove.city/guides/getting-started/welcome-to-grove
As a Go, Rust enthusiast it's tough to ignore the added features at Groove as well powered by POKT but have utilize added features when needed.


There are several free RPC endpoints available, which vary in accessibility, user experience (UX), and performance. 
The setup was quite simple and intuitive, making it relatively easy to build on top of them. This is beneficial for web3, DePIN infrastructure, or any projects that involve working with blockchain data and creating API endpoints.
If you encounter issues or have any questions feel free to contact me dirrectly or ask in discord group here.
For more on POKT Network you can check out bellow link. 👇

https://pokt.network/blog

Get fast shipping, movies & more with Amazon Prime

Start free trial

Enjoy this blog? Subscribe to Mozes711

0 Comments