horizon local-network

# build
docker compose build

# get local-network up
docker compose up -d

# create new subgraph to query
./scripts/add-subgraph.sh semiotic/tap

# connect cli to agent
ts-node src/run.ts indexer connect <http://localhost:7600> --network=hardhat

# change the indexing rule from offchain sync to always, this will create the allo
ts-node src/run.ts indexer --network hardhat rules set QmShrYnqNoefADzJ1YApdxTpSFWYfkMdUyg24eVkn27rL8 allocationAmount 11234 decisionBasis always

# query the subgraph -- this should get the accumulated fees over the threshold
./scripts/query_gateway.sh 3000 9p1TRzaccKzWBN4P6YEwEUxYwJn6HwPxf5dKXK2NYxgS

# wait 15 seconds, then query one more time to trigger RAV creation
./scripts/query_gateway.sh 1 9p1TRzaccKzWBN4P6YEwEUxYwJn6HwPxf5dKXK2NYxgS

# change the indexing rule back to offchain sync, this will close the allo
ts-node src/run.ts indexer --network hardhat rules prepare QmShrYnqNoefADzJ1YApdxTpSFWYfkMdUyg24eVkn27rL8

horizon phase-3 override

# build
docker compose build

# get local-network up
docker compose up -d

# create new subgraph to query
./scripts/add-subgraph.sh semiotic/tap

# connect cli to agent
ts-node src/run.ts indexer connect <http://localhost:7600> --network=hardhat

# change the indexing rule from offchain sync to always, this will create the allo
ts-node src/run.ts indexer --network hardhat rules set QmQzkWc6hp2EQA7KaD5ZXaABRCWBL9u6MSC8G6NnawVymv allocationAmount 11234 decisionBasis always

# query the subgraph -- this should get the accumulated fees over the threshold
./scripts/query_gateway.sh 3000 9p1TRzaccKzWBN4P6YEwEUxYwJn6HwPxf5dKXK2NYxgS

# wait 15 seconds, then query one more time to trigger RAV creation
./scripts/query_gateway.sh 1 9p1TRzaccKzWBN4P6YEwEUxYwJn6HwPxf5dKXK2NYxgS

# change the indexing rule back to offchain sync, this will close the allo
ts-node src/run.ts indexer --network hardhat rules prepare QmQzkWc6hp2EQA7KaD5ZXaABRCWBL9u6MSC8G6NnawVymv

Relevant logs

tap-agent: When testing threshold upon receiving a new receipt

DEBUG indexer_tap_agent::agent::sender_account: RAV trigger condition analysis, allocation_id: 0x0a067bd57aD79716C2133AE414B8F6BB47aAa22d, total_fee: 75641964232388323, total_fee_outside_buffer: 58311293659154560, buffered_fee: 17330670573233763, trigger_value: 100000000000000000, total_counter_for_allocation: 1573, receipt_limit: 10000, can_trigger_rav: true, counter_greater_receipt_limit: false, in_backoff: false, fee_trigger_condition: false

tap-agent: When sending RAV creation request to tap-aggregator:

INFO indexer_tap_agent::agent::sender_allocation: Sending RAV aggregation request, sender: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, allocation_id: 0x0000000000000000000000000a067bd57ad79716c2133ae414b8f6bb47aaa22d, receipt_count: 10, has_previous_rav: false, signer_recovered: true, agent_domain: Eip712Domain { name: Some("GraphTallyCollector"), version: Some("1"), chain_id: Some(1337), verifying_contract: Some(0xb0d4afd8879ed9f52b28595d31b441d079b2ca07), salt: None }

tap-agent: When an allocation closes, RAV is marked as last. If you advanced clock in the blockchain by mining blocks this could take a while as tap-agent uses blockchain timestamp to trigger:

INFO indexer_tap_agent::agent::sender_allocation: Closing SenderAllocation, triggering last rav, sender: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, allocation_id: 0x000000000000000000000000a0b3d56531892a2acec40aa8d253d8a8b158eeba

indexer-agent: when RAV is redeemed on chain