Challenge - 5 Problems
Master of Monitoring Deployed Contracts
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this command monitoring a deployed contract event?
You run the command to listen for Transfer events on an ERC-20 token contract:
What will this command output when a transfer happens?
web3.eth.subscribe('logs', {address: '0xTokenAddress', topics: [web3.utils.sha3('Transfer(address,address,uint256)')]})What will this command output when a transfer happens?
Blockchain / Solidity
web3.eth.subscribe('logs', {address: '0xTokenAddress', topics: [web3.utils.sha3('Transfer(address,address,uint256)')]})
Attempts:
2 left
💡 Hint
Think about what 'subscribe' does in web3.js for event logs.
✗ Incorrect
The subscribe method listens for new events matching the filter and outputs event log objects as they occur. It does not return past events or just a boolean.
❓ Configuration
intermediate2:00remaining
Which configuration correctly sets up a Prometheus exporter for Ethereum node metrics?
You want to monitor your Ethereum node using Prometheus. Which Prometheus scrape config snippet correctly scrapes metrics from a node exposing metrics at http://localhost:9545/metrics?
Attempts:
2 left
💡 Hint
Prometheus targets should be host:port without protocol, and metrics_path is set separately.
✗ Incorrect
Option A correctly sets the metrics_path and target host:port without protocol. Option A misses metrics_path, B includes protocol which is invalid, C misses port.
❓ Troubleshoot
advanced2:00remaining
Why does your contract event listener miss some events?
You wrote a script to listen to contract events using web3.js subscription, but it misses some events when the node restarts. What is the most likely cause?
Attempts:
2 left
💡 Hint
Think about what happens to event subscriptions when the connection drops.
✗ Incorrect
Subscriptions listen only to new events after connection. Events emitted during downtime are not received unless you query past logs.
🔀 Workflow
advanced2:00remaining
What is the correct workflow to monitor contract state changes reliably?
You want to monitor a deployed smart contract's state changes and ensure no events are missed even if your monitoring service restarts. Which workflow is best?
Attempts:
2 left
💡 Hint
Consider how to handle downtime and missed events.
✗ Incorrect
Combining past event queries with live subscriptions ensures no events are missed during downtime.
✅ Best Practice
expert3:00remaining
Which practice best improves monitoring scalability for many deployed contracts?
You manage monitoring for hundreds of deployed contracts on Ethereum. What is the best practice to scale event monitoring efficiently?
Attempts:
2 left
💡 Hint
Think about reducing load and complexity on your own infrastructure.
✗ Incorrect
Centralized indexing services efficiently index and provide event data for many contracts, reducing node load and complexity.