> For the complete documentation index, see [llms.txt](/llms.txt).

# Quickstart

This quickstart guide will help you set up and make calls on the Solana network using the Infura endpoints.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

Ensure you have an [API key](/developer-tools/dashboard/get-started/create-api/) with the Solana network enabled.

## Make calls[​](#make-calls "Direct link to Make calls")

### curl[​](#curl "Direct link to curl")

Run the following command in your terminal, replacing `<YOUR-API-KEY>` with your actual Infura API key:

```
curl https://solana-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "getSlot", "params": [], "id": 1}'

```

### JavaScript[​](#javascript "Direct link to JavaScript")

1. Create a project directory, and inside the directory initialize the project:  
```  
npm init -y  
```
2. In your project directory, [install the latest version of the JavaScript SDK](https://www.npmjs.com/package/@solana/kit).
3. Create your JavaScript file (`index.js` in this example) and copy the following code:  
Replace `<YOUR-API-KEY>` with your actual Infura API key.  
index.js  
```  
import { createSolanaRpc } from '@solana/kit'  
const rpc = createSolanaRpc('https://solana-mainnet.infura.io/v3/<YOUR-API-KEY>')  
async function fetchCurrentSlot() {  
  try {  
    const slot = await rpc.getSlot().send()  
    console.log('Current slot:', slot)  
  } catch (error) {  
    console.error('Error fetching slot:', error)  
  }  
}  
fetchCurrentSlot()  
```
4. Run the code using the following command:  
```  
node index.js  
```

### Rust[​](#rust "Direct link to Rust")

1. Create a project directory, and inside the directory initialize the project:  
```  
cargo init  
```
2. In your project directory, [install the Rust dependencies](https://www.npmjs.com/package/@solana/kit).  
```  
cargo add solana-sdk solana-client  
```
3. In the `src/main.rs` paste the following code:  
Replace `<YOUR-API-KEY>` with your actual Infura API key.  
main.rs  
```  
use solana_client::rpc_client::RpcClient;  
fn main() {  
  let url = "https://solana-mainnet.infura.io/v3/<YOUR-API-KEY>";  
  let client = RpcClient::new(url.to_string());  
  match client.get_slot() {  
    Ok(slot) => println!("Current slot: {}", slot),  
    Err(err) => eprintln!("Error fetching slot: {}", err),  
  }  
}  
```
4. Run the code using the following command:  
```  
cargo run  
```

## Next steps[​](#next-steps "Direct link to Next steps")

Now that you have successfully made a call to the Solana network, you can explore more functionalities and APIs provided by Infura. Here are some suggestions:

- **Explore other Solana APIs**: Infura supports a wide range of APIs. You can find more information in the [JSON-RPC API method documentation](/services/reference/solana/json-rpc-methods/).
- **Try out different networks**: Infura supports multiple networks including Ethereum, Linea, Polygon, Optimism, and more.
- **Monitor your usage**: Monitor your usage on the [Infura dashboard](/developer-tools/dashboard/how-to/dashboard-stats/) to ensure you're not hitting your rate limits.

Remember, the MetaMask community is here to help. If you have any questions or run into any issues, check out the [MetaMask community](https://community.metamask.io/) for help and answers to common questions.
