6 मिनट
GraphTally Guide
Learn about The Graph’s new payment system, GraphTally (previously Timeline Aggregation Protocol). This system provides fast, efficient microtransactions with minimized trust.
Overview
GraphTally is a drop-in replacement to the Scalar payment system currently in place. It provides the following key features:
- सूक्ष्म भुगतानों को कुशलता से संभालता है।
- ऑनचेन लेनदेन और लागतों में समेकन की एक परत जोड़ता है।
- प्राप्तियों और भुगतान पर Indexers को नियंत्रण की अनुमति देता है, प्रश्नों के लिए भुगतान की गारंटी देता है।
- यह विकेन्द्रीकृत, विश्वास रहित गेटवे को सक्षम बनाता है और कई भेजने वालों के लिए indexer-service के प्रदर्शन में सुधार करता है।
विशिष्टताएँ
GraphTally allows a sender to make multiple payments to a receiver, Receipts, which aggregates these payments into a single payment, a Receipt Aggregate Voucher, also known as a RAV. This aggregated payment can then be verified on the blockchain, reducing the number of transactions and simplifying the payment process.
प्रत्येक क्वेरी के लिए, गेटवे आपको एक साइन किए गए रिसिप्ट भेजेगा जिसे आपके डेटाबेस में संग्रहीत किया जाएगा। फिर, इन क्वेरियों को एक अनुरोध के माध्यम से एक टेप-एजेंट द्वारा समेकित किया जाएगा। इसके बाद, आपको एक RAV प्राप्त होगा। आप नए रिसिप्ट्स के साथ इसे भेजकर RAV को अपडेट कर सकते हैं और इससे एक नया RAV उत्पन्न होगा जिसमें बढ़ी हुई राशि होगी।
RAV विवरण
-
यह वह पैसा है जो ब्लॉकचेन पर भेजे जाने का इंतजार कर रहा है।
-
यह जारी रखेगा अनुरोध भेजना ताकि यह सुनिश्चित किया जा सके कि गैर-एकत्रित रसीदों का कुल मूल्य ‘amount willing to lose’ से अधिक न हो।
-
प्रत्येक RAV को अनुबंधों में एक बार भुनाया जा सकता है, यही कारण है कि इन्हें आवंटन बंद होने के बाद भेजा जाता है।
RAV का उपयोग करना
जब तक आप tap-agent और indexer-agent को चलाते हैं, सब कुछ स्वचालित रूप से निष्पादित होगा। निम्नलिखित प्रक्रिया का विस्तृत विवरण प्रदान करता है:
-
एक Indexer आवंटन बंद करता है।
-
<recently-closed-allocation-buffer> period, tap-agent
सभी लंबित प्राप्तियों को उस विशेष आवंटन के लिए लेता है और एक RAV में समेकन के लिए अनुरोध करता है, इसे ‘last’ के रूप में चिह्नित करता है। -
indexer-agent सभी पिछले RAVS लेता है और ब्लॉकचेन को रिडीम अनुरोध भेजता है, जो redeem_at के मान को अपडेट करेगा।
-
<finality-time>
अवधि के दौरान,indexer-agent
यह देखता है कि क्या ब्लॉकचेन में कोई पुनर्गठन है जो लेनदेन को पूर्ववत करता है।- यदि इसे रिवर्ट किया गया, तो RAV को फिर से ब्लॉकचेन पर भेजा जाता है। यदि इसे रिवर्ट नहीं किया गया, तो इसे final के रूप में चिह्नित किया जाता है।
ब्लॉकचेन पते(Addresses)
contract
Contract | Arbitrum Mainnet (42161) | Arbitrum Sepolia (421614) |
---|---|---|
TAP Verifier | 0x33f9E93266ce0E108fc85DdE2f71dab555A0F05a | 0xfC24cE7a4428A6B89B52645243662A02BA734ECF |
AllocationIDTracker | 0x5B2F33d7Ca6Ec88f5586f2528f58c20843D9FE7c | 0xAaC28a10d707bbc6e02029f1bfDAEB5084b2aD11 |
Escrow | 0x8f477709eF277d4A880801D01A140a9CF88bA0d3 | 0x1e4dC4f9F95E102635D8F7ED71c5CdbFa20e2d02 |
गेटवे
घटक | Edge and Node Mainnet (Arbitrum Mainnet) | Edge and Node Testnet (Arbitrum Sepolia) |
---|---|---|
प्रेषक | 0xDDE4cfFd3D9052A9cb618fC05a1Cd02be1f2F467 | 0xC3dDf37906724732FfD748057FEBe23379b0710D |
हस्ताक्षरकर्ता | 0xfF4B7A5EfD00Ff2EC3518D4F250A27e4c29A2211 | 0xFb142dE83E261e43a81e9ACEADd1c66A0DB121FE |
संकेन्द्रीयकर्ता | https://tap-aggregator.network.thegraph.com | https://tap-aggregator.testnet.thegraph.com |
आवश्यक शर्तें
In addition to the typical requirements to run an indexer, you’ll need a tap-escrow-subgraph
endpoint to query updates. You can use The Graph Network to query or host yourself on your graph-node
.
- Graph TAP Arbitrum Sepolia Subgraph (The Graph टेस्टनेट के लिए)
- Graph TAP Arbitrum One Subgraph (The Graph mainnet के लिए)
indexer-agent
वर्तमान में इस सबग्राफ की Indexing उसी तरह नहीं करता जैसे वह नेटवर्क सबग्राफ डिप्लॉयमेंट के लिए करता है। इसलिए, आपको इसे मैन्युअल रूप से इंडेक्स करना होगा।
माइग्रेशन गाइड
सॉफ़्टवेयर संस्करण
आवश्यक सॉफ़्टवेयर संस्करण here पाया जा सकता है।
कदम
-
Indexer एजेंट
- उसी प्रक्रिया का पालन करें’(https://github.com/graphprotocol/indexer/pkgs/container/indexer-agent#graph-protocol-indexer-components).
- Give the new argument
--tap-subgraph-endpoint
to activate the new GraphTally codepaths and enable redeeming of RAVs.
-
Indexer सेवा
- अपने वर्तमान कॉन्फ़िगरेशन को पूरी तरह से new Indexer Service rs (https://github.com/graphprotocol/indexer-rs). से बदलें। यह सुझाव दिया गया है कि आप container image (https://github.com/orgs/graphprotocol/packages?repo_name=indexer-rs). का उपयोग करें।
- पुरानी संस्करण की तरह, आप Indexer Service को आसानी से क्षैतिज रूप से स्केल कर सकते हैं। यह अभी भी stateless है।
-
TAP एजेंट
- हमेशा एक ही उदाहरण चलाएँ TAP Agent (https://github.com/graphprotocol/indexer-rs)। यह सिफारिश की जाती है कि आप container image (https://github.com/orgs/graphprotocol/packages?repo_name=indexer-rs). का उपयोग करें।
-
इंडेक्सर सेवा और TAP एजेंट कॉन्फ़िगर करें
कॉन्फ़िगरेशन एक TOML फ़ाइल है जो indexer-service और tap-agent के बीच साझा की जाती है, जो —config /path/to/config.toml तर्क के साथ प्रदान की जाती है।
पूरा configuration (https://github.com/graphprotocol/indexer-rs/blob/main/config/maximal-config-example.toml)और default values (https://github.com/graphprotocol/indexer-rs/blob/main/config/default_values.toml) देखें।
“कम से कम कॉन्फ़िगरेशन के लिए, निम्नलिखित टेम्पलेट का उपयोग करें:”
1#आपको नीचे दिए गए सभी मानों को अपने सेटअप के अनुसार बदलना होगा।2#3#कुछ कॉन्फ़िगरेशन नीचे वैश्विक ग्राफ नेटवर्क मान हैं, जिन्हें आप यहां देख सकते हैं:4#<https://github.com/graphprotocol/indexer/tree/main/docs/networks>5#प्रो टिप: यदि आपको इस कॉन्फ़िगरेशन में कुछ मान वातावरण से लोड करने की आवश्यकता है, तो आप...6#पर्यावरणीय वेरिएबल्स के साथ अधिलेखित किया जा सकता है। उदाहरण के लिए, निम्नलिखित को7#[PREFIX]_DATABASE_POSTGRESURL से बदला जा सकता है, जहां PREFIX `INDEXER_SERVICE` या `TAP_AGENT` हो सकता है:8#9#[database]10#postgres_url="postgresql://indexer:${POSTGRES_PASSWORD}11@postgres:5432/indexer_components_0"1213[indexer]14indexer_address = "0x1111111111111111111111111111111111111111"15operator_mnemonic = "celery smart tip orange scare van steel radio dragon joy alarm crane"1617[database]18# Indexer घटकों के लिए उपयोग किए जाने वाले Postgres डेटाबेस का URL। वही डेटाबेस19# जिसका उपयोग `indexer-agent` द्वारा किया जाता है। यह अपेक्षित है कि `indexer-agent`20#आवश्यक तालिकाएँ बनाएगा।21postgres_url = "postgres://postgres@postgres:5432/postgres"2223[graph_node]24# आपके graph-node के क्वेरी एंडपॉइंट का URL25query_url = "<http://graph-node:8000>"26# आपके graph-node के स्टेटस एंडपॉइंट का URL27status_url = "<http://graph-node:8000/graphql>"2829[subgraphs.network]30# Graph Network सबग्राफ के लिए क्वेरी URL।31query_url = "<http://example.com/network-subgraph>"32# वैकल्पिक, स्थानीय `graph-node` में खोजने के लिए deployment, यदि स्थानीय रूप से इंडेक्स किया गया हो।33# सबग्राफ को स्थानीय रूप से इंडेक्स करना अनुशंसित है।34# नोट: केवल `query_url` या `deployment_id` का उपयोग करें35deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"3637[subgraphs.escrow]38#Escrow Subgraph के लिए क्वेरी URL।39query_url = "<http://example.com/network-subgraph>"40#वैकल्पिक, स्थानीय `graph-node` में मौजूद deployment, यदि इसे स्थानीय रूप से index किया गया हो।41#स्थानीय रूप से सबग्राफ को index करना अनुशंसित है।42#नोट: केवल query_url या deployment_id में से किसी एक का उपयोग करें43deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"4445[blockchain]46#उस नेटवर्क का chain ID जिस पर The Graph नेटवर्क चल रहा है47chain_id = 133748#TAP की receipt aggregate voucher (RAV) verifier का कॉन्ट्रैक्ट पता।49receipts_verifier_address = "0x2222222222222222222222222222222222222222"5051########################################52#tap-agent के लिए विशिष्ट कॉन्फ़िगरेशन53########################################54[tap]55#यह वह राशि है जिसे आप किसी भी समय जोखिम में डालने के लिए तैयार हैं। उदाहरण के लिए,56#यदि प्रेषक (sender) RAVs को लंबे समय तक प्रदान करना बंद कर देता है और शुल्क इस57#राशि से अधिक हो जाता है, तो indexer-service प्रेषक से क्वेरी स्वीकार करना बंद कर देगा58#जब तक कि शुल्क एकत्रित नहीं हो जाते।59#नोट: राउंडिंग त्रुटियों को रोकने के लिए दशमलव मूल्यों के लिए स्ट्रिंग्स का उपयोग करें60#जैसे:61#max_amount_willing_to_lose_grt = "0.1"62max_amount_willing_to_lose_grt = 206364[tap.sender_aggregator_endpoints]65#सभी प्रेषकों और उनके aggregator endpoints की Key-Value66#नीचे दिया गया उदाहरण E&N testnet gateway के लिए है।670xDDE4cfFd3D9052A9cb618fC05a1Cd02be1f2F467 = "https://tap-aggregator.network.thegraph.com"
टिप्पणियाँ:
- tap.sender_aggregator_endpoints के लिए मान gateway section(/indexing/tap/#gateway) में पाए जा सकते हैं।
- Blockchain.receipts_verifier_address के लिए मानों का उपयोग ब्लॉकचेन एड्रेस सेक्शन(/indexing/tap/#contracts) के अनुसार सही चेन आईडी का उपयोग करते हुए किया जाना चाहिए।
लॉग स्तर
- आप लॉग स्तर को RUST_LOG एनवायरनमेंट वेरिएबल का उपयोग करके सेट कर सकते हैं।
- यह अनुशंसा की जाती है कि आप इसे RUST_LOG=indexer_tap_agent=debug,info पर सेट करें।
निगरानी
मेट्रिक्स
सभी घटक पोर्ट 7300 को प्रदर्शित करते हैं जिसे prometheus द्वारा क्वेरी किया जा सकता है।
Grafana डैशबोर्ड
आप Grafana Dashboard (https://github.com/graphprotocol/indexer-rs/blob/main/docs/dashboard.json) डाउनलोड कर सकते हैं और इम्पोर्ट कर सकते हैं।
लॉन्चपैड
वर्तमान में, indexer-rs और tap-agent का एक WIP संस्करण है जो यहाँ पाया जा सकता है यहां (https://github.com/graphops/launchpad-charts/tree/main/charts/graph-network-indexer)