7 分钟
GraphTally Guide
了解图表的新支付系统,GraphTally (先前的时间线聚合协议)。这个系统提供了快速、高效的微交易,并最大限度地减少了信任。
概述
GraphTally is a drop-in replacement to the Scalar payment system currently in place. It provides the following key features:
- 高效处理小额支付。
- 为链上交易和成本添加一层整合。
- 允许索引人控制收款和付款,保证查询付款。
- 支持去中心化、去信任的网关,并提高了多个发送者的
索引人服务
性能。
详情
TAP允许发送方向接收方进行多次付款,TAP收据将这些付款聚合为一次付款,即收据聚合凭证,也称为RAV。然后可以在区块链上验证这种聚合支付,减少交易数量并简化支付过程。
对于每个查询,网关将向您发送一个存储在数据库中的签名收据
。然后,这些查询将由tap代理
通过请求聚合。之后,您将收到RAV。您可以通过发送带有较新收据的RAV来更新它,这将生成一个价值增加的新RAV。
RAV详情
-
这是等待发送到区块链的钱。
-
它将继续发送汇总请求,并确保非汇总收据的总价值不超过
amount willing to lose
。 -
每个RAV在合约中都可以兑换一次,这就是为什么它们在分配结束后被发送的原因。
兑换RAV
只要您运行tap代理
和索引人代理
,所有操作都将自动执行。以下提供了该过程的详细分解:
-
索引人关闭分配。
-
<recently-closed-allocation-buffer> 在此期间,tap代理
会获取该特定分配的所有待处理收据,并请求将其聚合到RAV中,将其标记为最后一次
。 -
indexer代理
获取所有最后一次的RAVS,并向区块链发送兑换请求,区块链将更新recent_at
的值。 -
在
<finality-time>
期间,索引人代理
监控区块链是否有任何重组来恢复交易。- 如果被回退,RAV将重新发送到区块链。如果它没有被回退,它将被标记为最终版本。
区块链地址
合约
合约 | Arbitrum 主网 (42161) | Arbitrum Sepolia (421614) |
---|---|---|
TAPVerifier | 0x33f9E93266ce0E108fc85DdE2f71dab555A0F05a | 0xfC24cE7a4428A6B89B52645243662A02BA734ECF |
AllocationIDTracker | 0x5B2F33d7Ca6Ec88f5586f2528f58c20843D9FE7c | 0xAaC28a10d707bbc6e02029f1bfDAEB5084b2aD11 |
Escrow | 0x8f477709eF277d4A880801D01A140a9CF88bA0d3 | 0x1e4dC4f9F95E102635D8F7ED71c5CdbFa20e2d02 |
网关
组件 | Edge and Node主网(Arbitrum 主网) | Edge and Node测试网(Arbitrum Sepolia) |
---|---|---|
发送人 | 0xDDE4cfFd3D9052A9cb618fC05a1Cd02be1f2F467 | 0xC3dDf37906724732FfD748057FEBe23379b0710D |
签字人 | 0xfF4B7A5EfD00Ff2EC3518D4F250A27e4c29A2211 | 0xFb142dE83E261e43a81e9ACEADd1c66A0DB121FE |
聚合器 | https://tap-aggregator.network.thegraph.com | https://tap-aggregator.testnet.thegraph.com |
先决条件
除了运行索引人的典型要求外,您还需要一个tap托管子图
端点来查询tap更新。您可以使用Graph网络在graph-节点
上查询或托管自己。
- Graph TAP Arbitrum Sepolia Subgraph (适用The Graph测试网)
- Graph TAP Arbitrum One Subgraph (适用The Graph主网)
注意:“索引人代理”目前不能像网络子图部署那样处理此子图的索引。因此,您必须手动对其进行索引。
迁移指南
软件版本
所需的软件版本可以在此处找到。
步骤
-
索引人代理
- 遵循相同的过程。
- Give the new argument
--tap-subgraph-endpoint
to activate the new GraphTally codepaths and enable redeeming of RAVs.
-
索引人服务
-
TAP代理
-
配置索引人服务和TAP代理
配置是
索引人服务
和tap代理
之间共享的TOML文件,帶上参数--config /path/to/config.toml
。
对于最小配置,请使用以下模板:
1# You will have to change *all* the values below to match your setup.2#3# Some of the config below are global graph network values, which you can find here:4# <https://github.com/graphprotocol/indexer/tree/main/docs/networks>5#6# Pro tip: if you need to load some values from the environment into this config, you7# can overwrite with environment variables. For example, the following can be replaced8# by [PREFIX]_DATABASE_POSTGRESURL, where PREFIX can be `INDEXER_SERVICE` or `TAP_AGENT`:9#10# [database]11# postgres_url = "postgresql://indexer:${POSTGRES_PASSWORD}@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# The URL of the Postgres database used for the indexer components. The same database19# that is used by the `indexer-agent`. It is expected that `indexer-agent` will create20# the necessary tables.21postgres_url = "postgres://postgres@postgres:5432/postgres"2223[graph_node]24# URL to your graph-node's query endpoint25query_url = "<http://graph-node:8000>"26# URL to your graph-node's status endpoint27status_url = "<http://graph-node:8000/graphql>"2829[subgraphs.network]30# Query URL for the Graph Network Subgraph.31query_url = "<http://example.com/network-subgraph>"32# Optional, deployment to look for in the local `graph-node`, if locally indexed.33# Locally indexing the Subgraph is recommended.34# NOTE: Use `query_url` or `deployment_id` only35deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"3637[subgraphs.escrow]38# Query URL for the Escrow Subgraph.39query_url = "<http://example.com/network-subgraph>"40# Optional, deployment to look for in the local `graph-node`, if locally indexed.41# Locally indexing the Subgraph is recommended.42# NOTE: Use `query_url` or `deployment_id` only43deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"4445[blockchain]46# The chain ID of the network that the graph network is running on47chain_id = 133748# Contract address of TAP's receipt aggregate voucher (RAV) verifier.49receipts_verifier_address = "0x2222222222222222222222222222222222222222"5051########################################52# Specific configurations to tap-agent #53########################################54[tap]55# This is the amount of fees you are willing to risk at any given time. For ex.56# if the sender stops supplying RAVs for long enough and the fees exceed this57# amount, the indexer-service will stop accepting queries from the sender58# until the fees are aggregated.59# NOTE: Use strings for decimal values to prevent rounding errors60# e.g:61# max_amount_willing_to_lose_grt = "0.1"62max_amount_willing_to_lose_grt = 206364[tap.sender_aggregator_endpoints]65# Key-Value of all senders and their aggregator endpoints66# This one below is for the E&N testnet gateway for example.670xDDE4cfFd3D9052A9cb618fC05a1Cd02be1f2F467 = "https://tap-aggregator.network.thegraph.com"
注意:
tap.sender_aggregator_endpoints
的值可以在网关部分找到。blockchain.receipts_verider_address
的值必须使用相应的链id与blockchain地址部分 相对应。
日志级别
- 您可以使用
RUST_log
环境变量设置日志级别。 - 建议您将其设置为
RUST_LOG=indexer_tap_agent=debug,info
。
监测
Metrics
所有组件都将端口7300暴露给prometheus进行查询。
Grafana Dashboard
您可以下载Grafana Dashboard 并导入。
Launchpad
目前,有一个WIP版本的 index-rs
和tap-agent
可以在这里找到。