# JSON-RPC methods

### Solana RPC

At Chainup Cloud, we manage Solana RPC endpoints, handling hundreds of billions of requests each month. To simplify integration for developers, we've created documentation with examples of how to call RPC methods using cURL, JavaScript, Python.  Chainup Cloud supports a wide range of Solana APIs, making development easier and more efficient. 在 Chainup Cloud，我们管理 Solana RPC 端点，每月处理数千亿个请求。为了简化开发人员的集成，我们创建了文档，其中包含如何使用 cURL、JavaScript、Python 调用 RPC 方法的示例。Chainup Cloud 支持各种 Solana API，使开发更轻松、更高效。

<figure><img src="/files/GamJPL7RqMVhVHXs5hSv" alt=""><figcaption></figcaption></figure>

您可以在此处查看[**官方 Solana RPC 文档**](https://solana.com/docs/rpc)

### &#x20;示例 RPC

{% tabs %}
{% tab title="Curl" %}

```
curl   https://api.chainup.net/solana/mainnet/<YOUR_API_KEY>  \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc": "2.0","id": 1,"method": "getAccountInfo","params": ["7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy",{"encoding": "base58"}]}'
```

{% endtab %}

{% tab title="Javascript" %}

<pre class="language-javascript"><code class="lang-javascript"><strong>const axios = require('axios');
</strong>//npm install axios if you don have the module installed`
let options = {
    url: "https://api.chainup.net/solana/mainnet/&#x3C;YOUR_API_KEY>",
    method: "post",
    headers:
    { 
     "content-type": "application/json"
    },
    body: JSON.stringify({"jsonrpc": "2.0","id": 1,"method": "getAccountInfo","params": ["7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy",{"encoding": "base58"}])
};

axios(options)
.then(response => {
console.log('Post successful: response:', response.data);
})
.catch(error => {
console.error('An error has occurred:', error);
});
</code></pre>

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

# Set the headers for the request
headers = {
    "Content-Type": "application/json",
    "CONSISTENT-HASH": "true"
}

# Prepare the payload for the RPC request
payload = json.dumps({
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getAccountInfo",
    "params": [
        "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy",
        {"encoding": "base58"}
    ]
})

# Send the POST request to the Solana RPC endpoint
url = "https://api.chainup.net/solana/mainnet/<YOUR_API_KEY>"

try:
    r = requests.post(url=url, headers=headers, data=payload)
    # Check if the request was successful
    if r.status_code == 200:
        print("Post successful: response: ", r.content)
    else:
        print(f"An error occurred: {r.status_code}")
except requests.exceptions.RequestException as e:
    print(f"Request failed: {e}")

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chainupcloud.com/zhong-wen/qu-kuai-lian-api/solana/json-rpc-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
