|
11 | 11 | # GRPC_VERBOSITY=debug GRPC_TRACE=tcp,http python test/queryall.py |
12 | 12 |
|
13 | 13 | # NEVER SHARE YOUR SECRET! |
14 | | -secret = "abdc efgh 1234 5678" |
| 14 | +secret = input("your secret: ") |
15 | 15 |
|
16 | 16 | sdk = SDKInstance(grpcaddr="grpc.sentinel.co", grpcport=9090, secret=secret) |
17 | 17 |
|
18 | 18 | # The address can be founded in every modules because is inherited |
19 | 19 | # For example: sdk.sessions._account.address |
20 | 20 | print(sdk.nodes._account.address) |
21 | 21 |
|
22 | | -node_address = "sentnode1234abcd" |
| 22 | +node_address = input("give a node address: ") |
23 | 23 | node = sdk.nodes.QueryNode(node_address) |
24 | 24 | node_status = json.loads(sdk.nodes.QueryNodeStatus(node)) |
25 | 25 | assert node.address == node_address == node_status["result"]["address"] |
26 | 26 |
|
27 | | - |
28 | 27 | try: |
29 | 28 | # tx = sdk.transactor.subscribe_to_gigabytes(node_address=node_address, gigabytes=1) |
30 | 29 | tx = sdk.nodes.SubscribeToNode( |
|
40 | 39 | print(rpc_error.details()) # pylint: disable=no-member |
41 | 40 | print(rpc_error.debug_error_string()) # pylint: disable=no-member |
42 | 41 |
|
43 | | -# The wait_transaction can be founded in every modules because is inherited |
44 | | -# For example: tx_response = sdk.sessions.wait_transaction(tx["hash"]) |
45 | | -tx_response = sdk.nodes.wait_transaction(tx["hash"]) |
| 42 | +# The wait_for_tx can be founded in every modules because is inherited |
| 43 | +# For example: tx_response = sdk.sessions.wait_for_tx(tx["hash"]) |
| 44 | +tx_response = sdk.nodes.wait_for_tx(tx["hash"]) |
| 45 | + |
46 | 46 | subscription_id = search_attribute( |
47 | 47 | tx_response, "sentinel.node.v2.EventCreateSubscription", "id" |
48 | 48 | ) |
|
81 | 81 | # TODO: Currently doesn't work, we should call self.__client.load_account_data, before each tx |
82 | 82 | try: |
83 | 83 | tx = sdk.transactor.transaction(messages, tx_params=TxParams()) |
84 | | - tx_response = sdk.transactor.wait_transaction(tx["hash"]) |
| 84 | + tx_response = sdk.transactor.wait_for_tx(tx["hash"]) |
85 | 85 | except grpc.RpcError as rpc_error: |
86 | 86 | # TODO: this should be handled on skd side |
87 | 87 | print(rpc_error.code()) # pylint: disable=no-member |
|
92 | 92 | for session in sessions: |
93 | 93 | if session.status == Status.ACTIVE.value: |
94 | 94 | tx = sdk.sessions.EndSession(session_id=session.id, rating=0) |
95 | | - print(sdk.sessions.wait_transaction(tx["hash"])) |
| 95 | + print(sdk.sessions.wait_for_tx(tx["hash"])) |
96 | 96 |
|
97 | 97 | tx = sdk.sessions.StartSession(subscription_id=int(subscription_id), address=node_address) |
98 | | -tx_response = sdk.sessions.wait_transaction(tx["hash"]) |
| 98 | +tx_response = sdk.sessions.wait_for_tx(tx["hash"]) |
99 | 99 |
|
100 | 100 | session_id = search_attribute( |
101 | 101 | tx_response, "sentinel.session.v2.EventStart", "id" |
|
0 commit comments