Python

1

In your project folder, install the requests library:

pip install requests
2

Create a Python file called index.py:

import json
import requests

url = "https://rpc.testnet.radiustech.xyz/<YOUR-RPC-ENDPOINT>"

payload = {
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
}

headers = {'content-type': 'application/json'}

response = requests.post(url, data=json.dumps(payload), headers=headers).json()

print(response)
3

Run the code using the following command:

python index.py

Last updated

Was this helpful?