> ## Documentation Index
> Fetch the complete documentation index at: https://sequence-0fb8d9e6-shop-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Node Gateway

La infraestructura Node gateway de Sequence permite tener endpoints RPC resistentes a fallos que pueden escalar junto con la aplicación.

Al usar nuestra infraestructura, ahorra dinero al no tener que desplegar su propio stack, y además se beneficia de la función de agregar varios proveedores públicos de RPC en un solo endpoint.

## Pruébelo usted mismo

Instale `ethers` con `pnpm install ethers` o `yarn add ethers`

Asegúrese de elegir un identificador de red de nuestras [opciones de red](https://status.sequence.info)

Y obtenga una [clave de acceso de Sequence Builder](https://sequence.build) para autenticar su conexión y añadirla al endpoint

```js
// Import the ethers library
import { ethers } from "ethers";

// Function to create a provider and fetch the latest block
async function getLatestBlock() {
  // Replace the following URL with your actual RPC endpoint
  const rpcUrl =
    "https://nodes.sequence.app/<chain_handle>/<project_access_key>";

  // Create a provider using the RPC URL
  const provider = new ethers.providers.JsonRpcProvider(rpcUrl);

  // Fetch the latest block
  const latestBlock = await provider.getBlock("latest");

  console.log("Latest Block:", latestBlock);
}

// Call the function to get the latest block
getLatestBlock().catch(console.error);
```
