Building an app using the WORM
This page goes over how you can develop an application that leverages outputs from the worms brain that have been stored and verified on-chain.
Worm outputs as well as other metadata are stored in logs within Hyperliquid Testnet. Transactions containing worm outputs will store left and right muscle movements which can be parsed and translated into physical or non-physical movements.
Querying the On-Chain Worm
The Hyperliquid Testnet can be queried like any other Ethereum based chain. To query for blocks on the chain that contain Worm logs you need the following:
hypeAPI = "https://api.hyperliquid-testnet.xyz/evm"
contractAddress = "<WORM Brain State Address>"
ABI
WORM Brain State Address
can be found in the Contracts & IP Addresses section under the heading "WORM Brain State".
With the above you can use the the testnet RPC endpoint to query blocks and transactions that contain worm logs. For example using Go we can query blocks and logs like so:
Once the values are parsed from the logs they can be utilized to influence whatever your application needs.
Storing State
It's recommended that if the worms left and right muscle movements are influencing some external entity or object that the state of the object and potentially it's history be stored. This will prevent the need to parse through the entire chains history across service restarts.
Last updated