Whistleblower is a light client for monitoring transactions uploaded to Irys, verifying they are finalized on Arweave and seeded to miners.
A transaction is "finalized" once >= 50 Arweave block confirmations have passed. With a block time of ~2 minutes, it takes ~100 minutes before a transaction can be considered final.
A transaction is "seeded" when the data can be fully retrieved from >= 5 miners.
Whistleblower can be easily deployed on most computers, making transaction monitoring both simple and accessible.
With Whistleblower, you can ensure that:
- Transactions are finalized on Arweave by their deadline height (the block number by which the transaction must be finalized on Arweave).
- Transactions have valid formats and signatures.
- Bundles have valid formats and signatures.
- Data uploaded is seeded to Arweave miners.
Whistleblower connects to Irys and then:
- Initializes WebSocket connections to each of the selected nodes for real-time monitoring.
- Connects to an Arweave gateway to retrieve all bundles associated with the nodes being tracked.
- Connects to Arweave miners, making sure it can download the entire bundle.
- Traverses through each transaction within a bundle, ensuring that it can both download and cryptographically verify each one.
- Triggers an alert if a transaction cannot be downloaded or verified prior to reaching its deadline height.
Whistleblower cares that a transaction is in a bundle, that bundle is onchain and the data can be downloaded from miners.
As it tracks the status of each transaction, an alert will be triggered if a transaction is invalid.
A transaction is invalid if and only if:
- The transaction isn't included in a bundle by the deadline height.
- The bundle the transaction resides in isn't seeded to >=5 miners by the deadline height.
- The bundle the transaction resides in has <50 confirmations on Arweave.
Whistleblower then:
- Initializes WebSocket connections to each of the selected nodes for real-time monitoring.
- Connects to an Arweave gateway to retrieve all bundles associated with the nodes being tracked.
- Connects to Arweave miners, making sure it can download the entire bundle.
- Traverses through each transaction within a bundle, ensuring that it can both download and cryptographically verify each one.
- Triggers an alert if a transaction cannot be downloaded or verified prior to reaching its deadline height.
By default, Whistleblower sends alerts via the CLI if a transaction isn't finalized by its deadline height. To create a custom alert, write a class implementing this interface, and include your custom behavior in the alert function shown below. There's also an example implementation demonstrating how to set up an alert using PagerDuty.
export default async function alert(alert: Alert): Promise<void> {
// Add your custom alert code here
}
Whistleblower requires no configuration by default. If you need to customize its behavior, rename example.config.ts file to config.ts
and modify as needed. A heavily commented example implementation can be found here.
Clone this repository and then install Whistleblower via:
yarn
yarn build
npm install
npm run build
You can run Whistleblower using either yarn or npm. Start by initializing it with the address(es) of the nodes you want to monitor, then start the application.
yarn whistleblower init --nodes https://node1.irys.xyz https://node2.irys.xyz
yarn start
npm run whistleblower init -- --nodes https://node1.irys.xyz https://node2.irys.xyz
npm run start