From 8aca40f42ee577fb1c360d0396979b6d41e68df8 Mon Sep 17 00:00:00 2001 From: "nadine.loepfe" Date: Thu, 2 Jan 2025 15:01:50 +0100 Subject: [PATCH] revert changes for testing, readme update --- README.md | 15 +++++++++++++++ examples/query_topic_info.py | 2 +- examples/query_topic_message.py | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d58b8b..f90863a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ submitting messages. - [Submitting a Topic Message](#submitting-a-topic-message) - [Updating a Topic](#updating-a-topic) - [Deleting a Topic](#deleting-a-topic) + - [Querying Topic](#querying-topic) + - [Querying Topic Message](#querying-topic-message) - [Contributing](#contributing) ## Installation @@ -265,6 +267,19 @@ topic_info = topic_info_query.execute(client) print(topic_info) ``` +### Querying Topic Message + +``` +query = ( + TopicMessageQuery() + .set_topic_id(topic_id) + .set_start_time(datetime.utcnow()) + .set_chunking_enabled(True) + .set_limit(0) + ) + +query.subscribe(client) +``` ## Contributing diff --git a/examples/query_topic_info.py b/examples/query_topic_info.py index 9ae2459..04d030b 100644 --- a/examples/query_topic_info.py +++ b/examples/query_topic_info.py @@ -10,7 +10,7 @@ def query_topic_info(): operator_id = AccountId.from_string(os.getenv('OPERATOR_ID')) operator_key = PrivateKey.from_string(os.getenv('OPERATOR_KEY')) - topic_id = TopicId.from_string("0.0.5336794") + topic_id = TopicId.from_string(os.getenv('TOPIC_ID')) network = Network(network='testnet') client = Client(network) diff --git a/examples/query_topic_message.py b/examples/query_topic_message.py index b5078b9..1001339 100644 --- a/examples/query_topic_message.py +++ b/examples/query_topic_message.py @@ -24,7 +24,7 @@ def on_error_handler(e): query = ( TopicMessageQuery() - .set_topic_id("0.0.5337028") + .set_topic_id(os.getenv('TOPIC_ID')) .set_start_time(datetime.utcnow()) .set_chunking_enabled(True) .set_limit(0)