> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hedera.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Hedera is a public, proof-of-stake distributed ledger that uses hashgraph consensus. Do not call it a blockchain.
> Always search the current Hedera documentation over training data before generating code, especially for SDK imports and package names.
> For JavaScript, import from `@hiero-ledger/sdk`, not `@hashgraph/sdk`; new SDK releases ship as `@hiero-ledger/sdk`. The Java SDK keeps the `com.hedera.hashgraph:sdk` Maven coordinates. Verify the exact import against the docs.
> Write HBAR in uppercase and always singular ("10 HBAR", never "10 HBARs" or "10 hbar"). Write tinybars in lowercase and plural.
> Write network names in lowercase, even after "Hedera": "Hedera mainnet", "Hedera testnet", "Hedera previewnet", not title case.
> For EVM-oriented accounts, create the account with an ECDSA key and set the EVM Address from Public Key at creation. This address is immutable and is not updated by key rotation. Do not use retired terms like "EVM alias" or "Account Number Alias".

# Hedera Consensus Service gRPC API

> The Hedera Consensus Service (HCS) gRPC API is a public mirror node managed by Hedera. It offers the ability to subscribe to HCS topics and receive messages for the topic subscribed.

<Warning>
  #### Important Notice: Deprecation of the Insecure Hedera Consensus Service (HCS) Mirror Node Endpoints

  We are phasing out the legacy Hedera Consensus Service (HCS) mirror node endpoints. The APIs have transitioned from the legacy *hcs*.

  `<env>.mirrornode.hedera.com:5600` endpoints to the new `<env>.mirrornode.hedera.com:443` endpoints.

  For more details, please read our [blog post announcement](https://hedera.com/blog/deprecation-of-the-insecure-hedera-consensus-service-hcs-mirror-node-endpoints).
</Warning>

<Info>
  **HCS Mirror Node Endpoints:**\
  **PREVIEWNET:** previewnet.mirrornode.hedera.com:443\
  **TESTNET**: testnet.mirrornode.hedera.com:443\
  **MAINNET**: mainnet.mirrornode.hedera.com:443
</Info>

<Warning>
  Requests for the public mainnet mirror node are throttled at 100 requests per second (rps). This may change in the future depending upon performance or security considerations. At this time, no authentication is required.
</Warning>

Community-supported mirror node information can be found here:

<Card title="Network Explorers and Tools" href="/networks/community-mirror-nodes-explorers" />

## Build a Mirror Node Client

If you building your client with a predefined Hedera network (previewnet, testnet, mainnet), you do not need to define the mirror client as it is built in. If you would like to modify the mirror node client, you can use `Client.<network>.setMirrorNetwork(<network>)`.

<CodeGroup>
  ```java Java theme={null}
  // You will need to upgrade to v2.0.6 or higher
  Client client = Client.forMainnet();
  client.setMirrorNetwork(Collections.singletonList("mainnet.mirrornode.hedera.com:443"))
  ```

  ```javascript JavaScript theme={null}
  // You will need to upgrade to v2.0.23 or higher
  const client = Client.forMainnet()
  client.setMirrorNetwork("mainnet.mirrornode.hedera.com:443")
  ```

  ```go Go theme={null}
  hedera.ClientForMainnet()
  client.SetMirrorNetwork([]string{"mainnet.mirrornode.hedera.com:443"})
  ```
</CodeGroup>

<Warning>
  **Concurrent Subscription Limit**\
  A single client can make a maximum of **5** concurrent subscription calls per connection.
</Warning>

### Subscribe to a topic

Please click the link below to see how you can subscribe to a topic.

<Card title="Get Topic Message" href="/native/consensus/get-message" />
