How is a validator pubkey related to nominator pool address ? For example I have the following list of pubkeys retrieved from an API service:
[
{'public_key': '92a6d8a78afb98bb2c9e6f437e9b4f91bf8fbd1846ea13b135b03a5803449167'},
{'public_key': '976275284468adc04ee96dfa6c148840984f35d436223e0634721942bef8e7c4'},
{'public_key': '8df51bf9b1ba2826d96d5a7344eb463e19c3221ed7952d8bda9d081381750f12’}
]
How can I now map them to a nominator/validtor pool on TON ?
Oct 15, 2023, 9:20 AM
The question is basically how can i translate these pubkeys to nominator pool addresses ? (screenshot from https://tonapi.io/api-v2)
Oct 15, 2023, 9:31 AM
You need some indexer to do that — probably dton.io/graphql.
Oct 15, 2023, 9:33 AM
Is there no way to simply get the active set of validators on TON using an API ?
I would be very surprised since this is a pretty common query
This query returns “not implemented” 😅
Oct 15, 2023, 9:36 AM
Probably it's possible to query the Elector to get addresses of nominator pools.
This is a highly uncommon query, actually.
Oct 15, 2023, 9:37 AM
That is what I thought too, but get methods only seem to return election information :
https://github.com/ton-blockchain/ton/blob/master/crypto/smartcont/elector-code.fc
https://github.com/ton-blockchain/ton/blob/master/crypto/smartcont/elector-code.fc
https://github.com/ton-blockchain/ton/blob/65d22c46d9955041baad11a5dbd9a2c8c21beaf9/crypto/smartcont/elector-code.fc#L1033
Oct 15, 2023, 9:38 AM
https://github.com/ton-blockchain/ton/blob/65d22c46d9955041baad11a5dbd9a2c8c21beaf9/crypto/smartcont/elector-code.fc#L267
You may also download contract data using toncenter/tonapi/whatever else.
Oct 15, 2023, 9:40 AM
…. 😅
Not sure what you mean by this though ? Would have to back engineer the validatro set’s information in the contract storage ?
Oct 15, 2023, 9:48 AM
How about reading config 34?
Oct 15, 2023, 6:38 PM