Tasks
Chapter 56: Hands-on Task Scenarios
Section titled “Chapter 56: Hands-on Task Scenarios”Overview
Section titled “Overview”This chapter provides hands-on practice scenarios that are commonly given in blockchain infrastructure interviews. You’ll be asked to complete these tasks within time limits (typically 2-3 hours).
56.1 Task 1: Set Up Ethereum Node (Time: 2-3 hours)
Section titled “56.1 Task 1: Set Up Ethereum Node (Time: 2-3 hours)”Scenario
Section titled “Scenario”You have been given a server and asked to set up an Ethereum node that:
- Fully syncs with the mainnet
- Exposes RPC API for external applications
- Is accessible via HTTP on port 8545
Step-by-Step Solution
Section titled “Step-by-Step Solution”Step 1: SSH into the Server
Section titled “Step 1: SSH into the Server”ssh user@your-server-ipStep 2: Check System Resources
Section titled “Step 2: Check System Resources”# Check CPUnproc
# Check Memoryfree -h
# Check Diskdf -h
# Check disk type (should be SSD)lsblk -o NAME,TYPE,SIZE,MODELStep 3: Install Dependencies
Section titled “Step 3: Install Dependencies”# Update systemsudo apt-get update && sudo apt-get upgrade -y
# Install required packagessudo apt-get install -y curl wget git build-essentialStep 4: Download and Install Geth
Section titled “Step 4: Download and Install Geth”# Download latest Gethcd /tmpwget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.13.14-8ab7ff97.tar.gz
# Extracttar -xzf geth-linux-amd64-1.13.14-8ab7ff97.tar.gz
# Installsudo mv geth-linux-amd64-1.13.14-8ab7ff97/geth /usr/local/bin/
# Verifygeth versionExpected output:
GethVersion: 1.13.14-8ab7ff97...Step 5: Create Data Directory
Section titled “Step 5: Create Data Directory”sudo mkdir -p /data/ethereumsudo chown $USER:$USER /data/ethereumStep 6: Start the Node with Snap Sync
Section titled “Step 6: Start the Node with Snap Sync”# Run in screen or as servicegeth \ --syncmode snap \ --http \ --http.addr 0.0.0.0 \ --http.port 8545 \ --http.api eth,net,web3,debug,txpool \ --http.corsdomain "*" \ --datadir /data/ethereum \ --port 30303 \ --maxpeers 50Step 7: Check Sync Progress (in a new terminal)
Section titled “Step 7: Check Sync Progress (in a new terminal)”# Check if node is runningcurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# Check sync statuscurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'Step 8: Verify Complete Sync
Section titled “Step 8: Verify Complete Sync”Wait for eth_syncing to return false. Then:
# Get latest block numbercurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# Verify against block explorer# Visit https://etherscan.io and compare block numbersExpected Completion Time
Section titled “Expected Completion Time”- Initial sync: 2-4 hours for snap sync
- Full verification: 1-2 weeks for full sync
56.2 Task 2: Set Up RPC Node with Rate Limiting (Time: 1-2 hours)
Section titled “56.2 Task 2: Set Up RPC Node with Rate Limiting (Time: 1-2 hours)”Scenario
Section titled “Scenario”Set up a production-grade RPC node with:
- Rate limiting enabled
- Authentication
- Load balancing ready
Solution
Section titled “Solution”Step 1: Configure Geth
Section titled “Step 1: Configure Geth”geth \ --syncmode snap \ --http \ --http.addr 127.0.0.1 \ --http.port 8545 \ --http.api eth,net,web3,debug,txpool \ --http.vhosts "localhost,yourdomain.com" \ --http.ratelimit 1000 \ --http.ratelimitburst 2000 \ --ws \ --ws.addr 127.0.0.1 \ --ws.port 8546 \ --ws.api eth,net,web3 \ --ws.ratelimit 500 \ --datadir /data/ethereum \ --metrics \ --metrics.port 6060 \ --pprof \ --pprof.port 6061Step 2: Set Up Nginx with Rate Limiting
Section titled “Step 2: Set Up Nginx with Rate Limiting”sudo apt-get install nginx
sudo nano /etc/nginx/nginx.confAdd rate limiting configuration:
http { limit_req_zone $binary_remote_addr zone=eth_rpc:10m rate=100r/s; limit_req_zone $binary_remote_addr zone=eth_call:10m rate=50r/s;
server { listen 443 ssl http2; server_name rpc.yourdomain.com;
ssl_certificate /etc/ssl/certs/your-cert.crt; ssl_certificate_key /etc/ssl/private/your-key.key;
# Rate limiting limit_req zone=eth_rpc burst=200 nodelay;
location / { proxy_pass http://127.0.0.1:8545; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Timeouts proxy_connect_timeout 60s; proxy_send_timeout 60s; proxy_read_timeout 60s; } }}56.3 Task 3: Connect to Testnet and Get Test ETH (Time: 30 minutes)
Section titled “56.3 Task 3: Connect to Testnet and Get Test ETH (Time: 30 minutes)”Scenario
Section titled “Scenario”Set up a node on Sepolia testnet and get test ETH from a faucet.
Solution
Section titled “Solution”# Start on Sepolia testnetgeth \ --sepolia \ --syncmode snap \ --http \ --http.port 8545 \ --datadir /data/ethereum-sepoliaGet test ETH from faucet:
56.4 Task 4: Debug Sync Issues (Time: 30 minutes)
Section titled “56.4 Task 4: Debug Sync Issues (Time: 30 minutes)”Scenario
Section titled “Scenario”Your node is stuck and not syncing. Diagnose and fix.
Solution
Section titled “Solution”Check 1: Peer Connection
Section titled “Check 1: Peer Connection”# Check peer countcurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}'If 0 peers: Check network/firewall
Check 2: Network Version
Section titled “Check 2: Network Version”# Check chain ID (should be 1 for mainnet)curl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'Check 3: Logs
Section titled “Check 3: Logs”# Check Geth logsjournalctl -fu geth -n 100
# Or if running in terminal, check outputCheck 4: Restart Fresh
Section titled “Check 4: Restart Fresh”# Stop nodesystemctl stop geth
# Remove chaindata (keep keystore if needed)rm -rf /data/ethereum/geth/chaindata
# Restartsystemctl start geth56.5 Task 5: Set Up Monitoring (Time: 1 hour)
Section titled “56.5 Task 5: Set Up Monitoring (Time: 1 hour)”Scenario
Section titled “Scenario”Add Prometheus metrics and Grafana dashboard to monitor your node.
Solution
Section titled “Solution”Enable Geth Metrics
Section titled “Enable Geth Metrics”geth \ --syncmode snap \ --http \ --http.port 8545 \ --metrics \ --metrics.addr 0.0.0.0 \ --metrics.port 6060 \ --datadir /data/ethereumSet Up Prometheus
Section titled “Set Up Prometheus”# Install Prometheussudo apt-get install prometheus
# Configure prometheus.ymlcat > /etc/prometheus/prometheus.yml << 'EOF'global: scrape_interval: 15s
scrape_configs: - job_name: 'geth' static_configs: - targets: ['localhost:6060']EOF
# Restart Prometheussudo systemctl restart prometheusImport Grafana Dashboard
Section titled “Import Grafana Dashboard”- Install Grafana
- Add Prometheus as data source
- Import dashboard ID:
14611(Ethereum)
56.6 Task 6: Set Up Cosmovisor for Auto-Upgrades (Time: 30 minutes)
Section titled “56.6 Task 6: Set Up Cosmovisor for Auto-Upgrades (Time: 30 minutes)”Scenario
Section titled “Scenario”Set up Cosmovisor for automatic node upgrades.
Solution
Section titled “Solution”# Install Cosmovisorcd /tmpwget https://github.com/cosmos/cosmovisor/releases/download/v1.5.0/cosmovisor-v1.5.0-linux-amd64.tar.gztar -xzf cosmovisor-v1.5.0-linux-amd64.tar.gzsudo mv cosmovisor /usr/local/bin/
# Create directoriesmkdir -p ~/.govmdd/cosmovisor/genesis/binmkdir -p ~/.govmdd/cosmovisor/upgrades/
# Move current binary to genesissudo mv $(which gaiad) ~/.govmdd/cosmovisor/genesis/bin/
# Create systemd servicecat > /etc/systemd/system/cosmovisor.service << 'EOF'[Unit]Description=CosmovisorAfter=network.target
[Service]User=ubuntuExecStart=/usr/local/bin/cosmovisor run startEnvironment="DAEMON_HOME=/home/ubuntu/.govmdd"Environment="DAEMON_NAME=gaiad"Restart=alwaysRestartSec=10
[Install]WantedBy=multi-user.targetEOF
sudo systemctl daemon-reloadsudo systemctl enable cosmovisorsudo systemctl start cosmovisor56.7 Quick Command Reference
Section titled “56.7 Quick Command Reference”Common Commands During Interview Tasks
Section titled “Common Commands During Interview Tasks”# Check if Geth is runningps aux | grep geth
# Check logsjournalctl -fu gethtail -f /var/log/geth.log
# Check sync statuscurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'
# Get current blockcurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# Check peer countcurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}'
# Get account balancecurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x...", "latest"],"id":1}'
# Stop node gracefullysudo systemctl stop geth
# Restart nodesudo systemctl restart gethCommon Interview Task Checklist
Section titled “Common Interview Task Checklist”[ ] SSH into server[ ] Check system resources (CPU, RAM, Storage)[ ] Install Geth or other client[ ] Create data directory[ ] Start node with appropriate flags[ ] Verify sync is progressing[ ] Wait for full sync (or show progress)[ ] Test RPC endpoints[ ] Demonstrate common queries[ ] Clean up / answer questionsSummary
Section titled “Summary”These hands-on tasks simulate real interview scenarios:
- Set up Ethereum node - Most common task
- Configure RPC with security - Production focus
- Testnet setup - Basic verification
- Debug sync issues - Troubleshooting skills
- Add monitoring - DevOps skills
- Cosmos setup - If Cosmos is the focus
Practice these tasks to be ready for your interview!
Next Chapter
Section titled “Next Chapter”In Chapter 57: Quick Reference Cheat Sheet, you’ll find a printable quick reference.
Last Updated: 2026-02-20