Comment obtenez-vous la valeur d'une clé dans une grande carte à l'aide de Tezos-Client?
1 réponses
- votes
Leproblème avec l'ancienitinéraireest qu'il utilisait POSTpour simplifier lefait qu'ilenvoyait un corps JSON,mais la sémantitudepostale étaitincorrecte carellene changeait rien. La version actuellenécessite la clé de Script_Expr. Lagrandeidentification de la carteest unentier. Lorsque vousprovenez un contrat,il vous donnera les ID de sesgrandes cartes. Lorsque vousinterrogez lemagasin d'un contrat,au lieu de revenir []pour lagrande carte comme celle-ci,il renvoiemaintenant lagrande carte de carte. Vouspouvez également voir cethread: Comment obtenir unegrande valeur de carte sur Babylon
En ce qui concerne la deuxième question: Si celane vous dérangepas d'utiliser une API Autre,lenœud RPC Vouspouvez letrouver dans lanouvelle version de l'indexeur Tzstats (Get/Explorer/contrat/{HASH} renvoie un objet avec unetouche BIGMAP_IDS quiest unematrice) voir < Un href="https://api.babylonnet.tzststats.com/explorer/contract/kt1e5tojralhvpukphwtbrvjgevwwwr98svkj" rel="NOFOollow NOREFERRER"> https://api.babylonnet.tzststats.com/explorer/contract/kt1e5tojralhvpukphwtbrvjgevwwr98svkj Pour unexemple,l'IDfait égalementpartie dupoint d'extrémité de stockage décodé/décodé à HTTPS ://aPi.babylonnet.tzstats.com/explorer/contract/kt1e5tojralhvpukphwtbrvjgevwwr98svkj/storage
The problem with the old route is that it used POST to simplify the fact it was sending a JSON body, but semantically POST was incorrect because it was not changing anything. The current version requires the key to be in script_expr form. The big map id is an integer. When you originate a contract it will give you the ids of its big maps. When you query the store of a contract, instead of returning [] for the big map like it did before, now it returns the big map id. You can also view this thread: How to get big map value on Babylon
regarding the second question: If you don't mind using an API other then the node RPC you can find this in the new version of the tzstats indexer (GET /explorer/contract/{hash} returns an object with a key bigmap_ids which is an array) see https://api.babylonnet.tzstats.com/explorer/contract/KT1E5toJrALhVPuKpHWTbRVjgEvWWR98sVKj for an example, the id is also part of the decoded/unboxed storage endpoint at https://api.babylonnet.tzstats.com/explorer/contract/KT1E5toJrALhVPuKpHWTbRVjgEvWWR98sVKj/storage
Comment obtenez-vous la valeur d'une clé dans unegrande carte à l'aide de Tezos-Client?Jene reçoispas leparamètre «Identifiant de Big_Map» de «Obtenir l'élément de Big Map ou commenttrouver cetidentifiant.La valeur «Obtenir unegrande valeur de carte»estplus simple à comprendremais obsolète.
Et comment découvrez-vous lesindex desgrandes cartes d'un contrat?Il semble que vous devriezinspecter le stockageet se corréler avec letype de stockageet choisir lesnuméros correspondant àbig_maps.