Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/example_get_consensus_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def main() -> None:

# Initialize a request and call get consensus info method
req = GetConsensusInfoRequest()
consensus_info = stub.GetConsensusInfo(req)
res = stub.GetConsensusInfo(req)

print(f"Consensus info:\n{consensus_info}")
print(f"Consensus info:\n{res}")


if __name__ == "__main__":
Expand Down
21 changes: 21 additions & 0 deletions examples/example_get_node_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from pactus.rpc.network_pb2_grpc import NetworkStub
from pactus.rpc.network_pb2 import GetNodeInfoRequest
import grpc


def main() -> None:
# Creating a gRPC channel
channel = grpc.insecure_channel("bootstrap1.pactus.org:50051")

# Creating a stub from channel
stub = NetworkStub(channel)

# Initialize a request and call get consensus info method
req = GetNodeInfoRequest()
res = stub.GetNodeInfo(req)

print(f"Node info Response:\n{res.reachability}")


if __name__ == "__main__":
main()