ChainUp Cloud
English
English
  • 👋Welcome to ChainUp Cloud
  • INTRODUCTION
    • 🔎Chainup Cloud API Quickstart
    • đŸ•šī¸Products
      • â›“ī¸Blockchain API
      • âš™ī¸Fullnode Service
      • âš’ī¸Dedicated Node
      • đŸ‘ĨWhite Label Validator
      • ⛲Staking
      • 🍧HashKing Aggregator
      • 💌ChainNova
    • 👷For Developers
      • â›“ī¸Use Blockchain API
      • âš’ī¸Deploy Dedicated Node
      • â˜ī¸Use distributed storage with IPFS API
    • 👾For Investors
      • ⛲How to stake Ethereum?
      • đŸ‘ĨRunning your own validators
  • ChainUpCloud Open API
    • Staking Rewards API
      • Validator Daily Rewards
      • Validator Total Rewards
      • Cloud Validator Settles EL Rewards
    • ETH Staking API
      • Broadcast Staking Tx
      • Create Validators
      • Get Validators
      • Exit Validators by Pubkeys
    • Error Codes
  • đŸˇī¸NFT API
    • Transfer API
    • NFT Metadata Access
    • Ownership & Token Gating
  • Blockchain API
    • 📚Overview
      • Create Blockchain API for your project
      • Dashboard stats
    • 💎Ethereum
      • JSON-RPC methods
      • WebSocket stream
    • Solana
      • JSON-RPC methods
      • Solana Nodes FAQ
      • Websocket Stream
    • TON
      • HTTP API
      • Indexer API
    • 🚔BNB
      • JSON-RPC methods
      • WebSocket stream
    • â›ŊPolygon (Matic)
      • JSON-RPC methods
      • WebSocket stream
    • 🌞Tron
      • JSON-RPC methods
    • đŸĒ™Bitcoin
      • JSON-RPC methods
    • 📂Filecoin
      • JSON-RPC methods
      • Public APIs
    • 🍡Polkadot
      • JSON-RPC methods
      • WebSocket stream
    • âšĒLitecoin
      • JSON-RPC methods
    • 🚃Near
      • JSON-RPC methods
    • 💎Ethereum Beacon
      • JSON-RPC methods
    • đŸĒ¨Ethereum Classic - ETC
      • JSON-RPC methods
    • đŸĨ€Bitcoin Cash - BCH
      • JSON-RPC methods
    • đŸĻƒKusama
      • JSON-RPC methods
      • WebSocket stream
    • 🍆EOS
      • JSON-RPC methods
    • đŸ‘ģFantom
      • JSON-RPC methods
    • ã€°ī¸Aptos
      • HTTP Methods
    • đŸ”ī¸Avalanche
      • JSON-RPC methods
    • 🔑Cosmos
      • HTTP Methods
    • 📚Omni
      • JSON-RPC methods
    • â˜¸ī¸Arbitrum
      • JSON-RPC methods
    • đŸ’¯Dogecoin
      • JSON-RPC methods
    • 🎷Optimism
      • JSON-RPC methods
    • Dash
      • JSON-RPC methods
    • Zcash
      • JSON-RPC methods
    • XRP
      • JSON-RPC methods
    • Base
      • JSON-RPC methods
    • Scroll
      • JSON-RPC methods
    • Qtum
      • JSON-RPC methods
  • Staking
    • 📘Overview
    • 💎Staking on Ethereum
      • 📀Shanghai Upgrade
      • ⛲How to stake Ethereum?
      • 📙How to generate Deposit Data?
    • 📏Staking on Ethereum with SSV
    • đŸ–Œī¸Registering SSV Operator
    • đŸ–Œī¸How to delegate to SSV Cluster?
    • 🌌Staking on Cosmos
      • Staking on Cosmos
      • 在 Cosmos 䏊贍æŠŧ
    • 📱Staking on Mina
    • 🍆Staking on EOS
    • 📂Staking on FIL
    • đŸ•ļī¸Staking on ZILLIQA
  • Validator Node
    • 📗Overview
    • 💎Ethereum
      • Running Validator Node
      • How to create Validator Keys?
  • RESOURCES
    • 📕FAQ Introduction
      • â›“ī¸Blockchain API
      • âš’ī¸Dedicated Node
    • đŸ—ŗī¸Support
    • Api Reference
Powered by GitBook
On this page

Was this helpful?

  1. Blockchain API
  2. Solana

Websocket Stream

PreviousSolana Nodes FAQNextTON

Last updated 7 months ago

Was this helpful?

Unlike HTTP, with WebSockets, you don't need to continuously make requests when you want specific information. WebSockets maintain a network connection for you (if done right) and listen for changes . You may view the

wscat -c wss://api.chainup.net/ws/solana/mainnet/<YOUR_API_KEY>

< {"jsonrpc": "2.0", "id": 0, "method": "accountUnsubscribe", "params": [0]}
<  { "jsonrpc": "2.0", "result": true, "id": 1 }
const Web3 = require('web3');

const web3 = new Web3("wss://api.chainup.net/ws/solana/mainnet/<YOUR_API_KEY>")

web3.solana.getBlockSlot().then(console.log) // -> 1022457
from web3 import Web3

websocket_url='wss://api.chainup.net/ws/solana/mainnet/<YOUR_API_KEY>'
w3 = Web3(Web3.WebsocketProvider(websocket_url))

# You can check if the connection is established using isConnected function.
w3.isConnected()

# Output: True
official Solana Websocket documentation here.