What is query_id in highload wallets. How can i generate it? I use tonsdk in python to send transaction

May 21, 2023, 12:50 PM
in tonsdk you can just specify 0 and library will generate it automatically
query_id is a timestamp until your message is valid.

in highload wallet you can use it in get method to get “status” of transaction
May 21, 2023, 2:14 PM
I get this error when i broadcast the transaction:
{'ok': False, 'error': 'LITE_SERVER_UNKNOWN: cannot apply external message to current state : External message was not accepted\nCannot run message on account: inbound external message rejected by transaction 463B682553EFE7C864ACD1BD64D2B0E5E278017A4CCEF0262A3A586D91D1AEE5:\nexitcode=0, steps=0, gas_used=0', 'code': 500}

The wallet is new and i just got a faucet for it. Do you know what's wrong?
May 21, 2023, 2:53 PM
have you deployed your highload wallet?
btw you can check the example i've made, it can be useful
May 21, 2023, 2:56 PM
How should i do that?
I sent transactions using v4r2 wallets. The wallet was deployed in the first transaction by tonsdk.
Should i deploy the highload wallet by myself?
May 21, 2023, 2:57 PM
you should deploy it by external message if you didn't do it by internal.

is the state of your highload active on tonscan?
May 21, 2023, 2:59 PM
No.it is not.
In this example i see the base64_boc variable. It is not used
May 21, 2023, 3:01 PM
alright, so first
query = wallet.create_init_external_message()
base64_boc = bytes_to_b64str(query["message"].to_boc(False))
send this base64_boc to the blockchain and your wallet will deployed
May 21, 2023, 3:01 PM
Let me check please. Is it needed to pay fee for deploy the wallet?
May 21, 2023, 3:02 PM
of course, but you said you got faucet
May 21, 2023, 3:03 PM
How can i deploy it using an internal message? Is it possible for highload wallet?
Using create_transfer_message i deployed v4r2 wallets. But i didn't succeed in highload wallet
May 21, 2023, 3:04 PM
state_init = new_wallet.create_state_init()['state_init']

wallet.create_transfer_message(to_addr=new_wallet.address.to_string(), state_init=state_init, ...)

you can check out this video i've explained how to internal deploy contracts
May 21, 2023, 3:08 PM
Thank you so much. I'll check and let you know 🙏
It worked. Thanks a lot
May 21, 2023, 3:20 PM
Hmm… are you sure “query_id” works as “timeout”???
May 21, 2023, 3:52 PM
May 21, 2023, 4:00 PM
query_id in highload wallet isn’t just expiration timestamp. It’s added with hash of the current payload cell
*32 bits part of the hash
May 21, 2023, 4:11 PM
I have a question. There is no seqno for highload wallets. How should i handle this one to not send specific transactions twice or more?
I know that i can set query_id for that. But how can i do double spends or other works we do with nonce in other blockchains?
May 21, 2023, 6:42 PM
your query_id stores in contract until it become invalid, so other messages with existing query_id will be blocked
i think best practice is to remember query_id and run get method processed? to check if query_id processed by contract
so if you send several messages with different query_ids they all will be processed and stored in contract
also every time you send message contract checks if there are expired query_ids and if true, deletes them
May 21, 2023, 6:59 PM
How about python? :))
May 21, 2023, 7:22 PM
create_transfer_message for highloads returns query_id

then you can run get method with pytonlib or tontools
stack should be like
[[“num”, query_id]]
if you use toncenter or pytonlib
May 21, 2023, 7:29 PM
I'll chek and let you know. Thank you👍
May 21, 2023, 7:31 PM

© 2024 Draquery.com All rights reserved.