.env automatically.
Create the HCS Topics
1
Run the topics setup script
From the repository root, run:This creates two new HCS topics on Hedera testnet using your seller account credentials and submits the creation transactions to the network.
2
Wait for .env to be updated
Once both transactions reach consensus, the script writes the new topic IDs to your The exact topic IDs will differ — Hedera assigns sequential entity numbers on each network.
.env. You will see output like:3
Confirm the variables in .env
Verify both topic IDs were persisted:Expected output:
HCS topics are public and permissionless by default. Any Hedera account can submit a message to a topic, but the Agora402 registry’s trust model does not rely on topic-level access control. Instead, the buyer agent verifies that the
payTo account in each listing matches the Hedera account that paid for the HCS submission — so spoofed listings from third parties are automatically discarded.Optional: Deploy the TOLL HTS Token
By default, Agora402 settles all payments in native HBAR. If you want to add an on-chain royalty layer to every transfer — enforced automatically by the Hedera Token Service at the protocol level — you can deploy the TOLL token, a custom HTS fungible token with a fixed fee attached to every transfer.1
Run the token setup script
2
Check .env for the token ID
After the script completes, your Once
.env will contain:.env
TOLL_TOKEN_ID is set, the seller’s endpoints advertise TOLL as an accepted payment asset alongside HBAR, and the buyer agent selects the preferred asset at runtime.Running
npm run setup:token is entirely optional. If you leave TOLL_TOKEN_ID empty in .env, Agora402 settles every request in HBAR with no change to any other part of the system. You can add the TOLL token at any time without restarting the seller or re-publishing the registry listing.Verify Your Topics on HashScan
After creating the topics, you can inspect them in the Hedera block explorer. Replace<TOPIC_ID> with the value from your .env:
npm run setup:register, and to audit the receipts topic after running paid requests.