Hedera Consensus Service gRPC API

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

HCS Mirror Node Endpoints: PREVIEWNET: hcs.previewnet.mirrornode.hedera.com:5600 TESTNET: hcs.testnet.mirrornode.hedera.com:5600 MAINNET[whitelisted]: hcs.mainnet.mirrornode.hedera.com:5600 MAINNET[public]: mainnet-public.mirrornode.hedera.com:443

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.

Community supported mirror node information can be found here:

Build a Mirror Node Client

V2
V1
V2

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 client, you can use Client.<network>.setMirrorNetwork(<network>). Public Mainnet Mirror Node The default mainnet mirror node points to the whitelisted node when using Client.forMainnet(). To establish a connection to the public mainnet mirror node you will need to upgrade to one of the following versions of the SDK that now supports TLS connections.

  • Java: v2.0.6+

  • JavaScript: v2.0.23+

  • Go: v2.1.9+

Java
//You will need to upgrade to v2.0.6 or higher
Client client = Client.forMainnet();
client.setMirrorNetwork(Collections.singletonList("mainnet-public.mirrornode.hedera.com:443"))
JavaScript
//You will need to upgrade to v2.0.23 or higher
const client = Client.forMainnet()
client.setMirrorNetwork("mainnet-public.mirrornode.hedera.com:443")
Go
hedera.ClientForMainnet()
client.SetMirrorNetwork([]string{"mainnet-public.mirrornode.hedera.com:443"})
V1

Constructor

Description

new MirrorClient(<endpoint>)

Initializes the MirrorClient object

Java
final MirrorClient mirrorClient = new MirrorClient(MIRROR_NODE_ADDRESS);
JavaScript
const mirrorClient = new MirrorClient(mirrorNodeAddress);

Concurrent Subscription Limit A single client can make a maximum of 5 concurrent subscription calls per connection.

Subscribe to a topic

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