Hi brothers
I am currently in aens transfer through intelligent contract, now can be successful transfer, but found that after I transfer aens, I don’t know whether or not and confirm that the domain name to a new account, I also query node API, but could not find, if through the middleware data query data is wrong. How can I confirm a domain name on the ownership of the person who is he? If you want to solve this problem, do you want to open up more name apis for nodes?
There are three things in this question I think.
-
Yes, you do know - if the call to
AENS.transfer
is successful it means the transfer “transaction” was successfully applied. But as you say, this knowledge is limited to within that contract call. -
No there is currently no functionality from inside a contract to lookup the owner of a name, you can resolve the pointers of the name. However, there is a new AENS function,
AENS.lookup
being added in the next version of the VM and the next version of Sophia. This will become available after the next protocol upgrade/hard-fork (See here). Usingevents
could perhaps be a temporary workaround? -
The Node API is only able to lookup the pointers of a name as far as I know, the
names/<name>
endpoint could perhaps also return the owner of a name. And for the middleware I’m not sure, it is being rewritten, maybe @karol.chain has a better answer? But there has been discussions on how to track “chain transactions” inside contracts.
Whether you can add an interface to the node to find the owner of the node, because getting data from the middleware is not particularly trusted
Yesterday I
Owner of 888888888888.chain
ak_idkx6m3bgRr7WiKXuB8EBYBoRqVsaSc6qo4dsd23HKgj3qiCF
Sent to the
ak_QyFYYpgJ1vUGk1Lnk8d79WJEVcAtcfuNHqquuP2ADfxsL6yKx
But right now I don’t have any way to look up the domain name 88888888.chain. If possible, I think this is the best way to add an API to a node’s API
name transfer tx has account_id
which can help, correct?
curl -s "http://localhost:4000/txs/backward/or?type=name_transfer&limit=1" | jq '.'
{
"data": [
{
"block_hash": "mh_JAZtav3Dv9djWcbnuJH4PMwEmtMyo7qrehxxMNdPpsCs2PrSu",
"block_height": 258480,
"hash": "th_QicFJhNW8B2cijzZtvvCEJKfSK4MekLWZtGvZKr26d6PZ5P9P",
"micro_index": 45,
"micro_time": 1590057910212,
"signatures": [
"sg_WGrTcqwma7Ywx9ZSGTpRXuDyMPKSxY3TyqybPweum12bLSc2U29R3QFfHPXPPdjJcmrsGhWUtRBodi49ySR7wyqCLEp2X"
],
"tx": {
"account_id": "ak_fCCw1JEkvXdztZxk8FRGNAkvmArhVeow89e64yX4AxbCPrVh5",
"fee": 17400000000000,
"name_id": "nm_T9nEFC8wHnFVDVQCjEes5avGc73b9F2RvX9SdDVKW2R35r9Xx",
"nonce": 2852,
"recipient_id": "ak_CdCnkxwJg472TgzHgFUhvNazoraGqLLBWH6wABgHbYPmxfHeh",
"ttl": 258980,
"type": "NameTransferTx",
"version": 1
},
"tx_index": 11411756
}
],
"next": "txs/backward/or?limit=1&page=2&type=name_transfer"
}
(note: the endpoint will change (slightly) next week)
Well, the transfer took place inside a contract
Ok, I’ve missed this part.
Is there any method in the contract?
Is there any method in the contract? , my suggestion is to develop a node API to query through name_id or name to its owner
About in a Sophia contract, see 2.) above
About the node: Let names/<name> endpoint return name owner by hanssv · Pull Request #3276 · aeternity/aeternity · GitHub
Ok, thank you