Email Notification Guide for Proof Submission

This guide describes how to configure and use the email notification feature in EthStorage's mining process. This feature is useful for storage providers or es-node operators who want to receive timely notifications about proof submissions and their results.


How It Works

If enabled, storage providers will receive email notifications for the following mining events:

  1. When the es-node is started and each of the local data shards is ready to mine. Note that on first startup, the node's local storage must synchronize via P2P to catch up with the network.

  2. When a storage proof is generated and submitted to the smart contract as a mining transaction.

SMTP Service Preparation

You must have access to a working SMTP service to use the email notification feature. If you do not already have an SMTP account, you need to apply for one yourself. Below are two common options:

Gmail

Mailjet

For other providers, refer to their documentation for SMTP host, port, and credential setup.


Email Configuration

You can configure email notifications via CLI flags or environment variables. The most common way is to pass parameters to your node startup scripts where storage mining is enabled (e.g., run.sh or run-l2.sh):

  ...
  --miner.email-enabled \
  --email.username [email protected] \
  --email.host smtp.gmail.com \
  --email.port 587 \
  --email.from [email protected] \
  --email.to [email protected],[email protected] \
  ...

Then execute the script with the SMTP password, miner address, and private key as environment variables:

env ES_NODE_STORAGE_MINER=0xabc... \
ES_NODE_SIGNER_PRIVATE_KEY=0123... \
ES_NODE_EMAIL_PASSWORD="abcd  efgh  ijkl  mnop" \
./run.sh

Quick Test for Your Email Configuration

You can run the es-node email command with your email configuration to quickly verify your email settings, as shown in the following example:

ES_NODE_EMAIL_PASSWORD="abcd  efgh  ijkl  mnop" \
./build/bin/es-node email \
  --email.username [email protected] \
  --email.host smtp.gmail.com \
  --email.port 587 \
  --email.from [email protected] \
  --email.to [email protected]

You will receive an email like the following if everything is correct:

This is a test email sent from the EthStorage node CLI.

Sent at: Fri, 18 Jul 2025 11:14:25 +0800

Parameter Reference

CLI Flag
Environment Variable Name
Description

--miner.email-enabled

ES_NODE_MINER_EMAIL_ENABLED

Enable email notification for miner (default: false)

--email.username

ES_NODE_EMAIL_USERNAME

SMTP username or API key

--email.password

ES_NODE_EMAIL_PASSWORD

SMTP password or API secret

--email.host

ES_NODE_EMAIL_HOST

SMTP server host (default: smtp.gmail.com)

--email.port

ES_NODE_EMAIL_PORT

SMTP server port (default: 587)

--email.from

ES_NODE_EMAIL_FROM

Sender email address

--email.to

ES_NODE_EMAIL_TO

Recipient(s), repeated flags supported


Notes:

  • Keep your SMTP credentials secure.

  • It is recommended to use the environment variable (ES_NODE_EMAIL_PASSWORD) for the password.

  • If your password contains spaces, enclose it in double quotes.

  • To specify multiple recipients, separate addresses with commas for the value of --email.to.

  • To disable email notifications, either remove the flag --miner.email-enabled, or set --miner.email-enabled=false.

  • The --email.from value must be a valid email address (no display name or angle brackets).


Example Email Contents

Start Mining Notification

Subject: EthStorage Mining Task Started: Shard 1

A new mining task has been initiated for shard 1 on the es-node at 10.20.30.40.

Miner: 0xabc123... Threads per shard: 12 Minimum profit: 0

Sent at: Fri, 18 Jul 2025 11:14:25 +0800

Transaction Confirmed and Success

Subject: EthStorage Proof Submission: ✅ Success

A storage proof was generated by the es-node at 10.20.30.40 for shard 1 at block 12345.

Miner: 0xabc123...
Transaction hash: 0xdef456...

Transaction status: success!
Gas used: 360000
Effective gas price: 1000000000
Reward: 1.000000000
Cost: 0.000360000
Profit: 0.999640000

Sent at: Fri, 18 Jul 2025 11:14:25 +0800

Proof Dropped Due to Low Profit

Subject: EthStorage Proof Submission: ❌ Failure

A storage proof was generated by es-node for shard 1 at block 12345.

Miner: 0xabc123...

However, it was dropped due to insufficient profit.

Sent at: Fri, 18 Jul 2025 11:14:25 +0800

Transaction Submission Failed

Subject: EthStorage Proof Submission: ❌ Failure

A storage proof was generated by es-node for shard 1 at block 12345.

Miner: 0xabc123...

However, the mining transaction could not be submitted due to <error message>

Sent at: Fri, 18 Jul 2025 11:14:25 +0800

Transaction Submitted but Hash is Empty

Subject: EthStorage Proof Submission: ❌ Failure

A storage proof was generated by es-node for shard 1 at block 12345.

Miner: 0xabc123...

However, the mining transaction failed to submit for unclear reasons.

Sent at: Fri, 18 Jul 2025 11:14:25 +0800

Transaction Confirmed but Failed

Subject: EthStorage Proof Submission: ❌ Failure

A storage proof was generated by es-node for shard 1 at block 12345.

Miner: 0xabc123...
Transaction hash: 0xdef456...

Transaction status: failed!
You can check the detailed error message on the block explorer. 

Sent at: Fri, 18 Jul 2025 11:14:25 +0800

Transaction Confirmation Timeout

Subject: EthStorage Proof Submission: ⚠️ Timeout

A storage proof was generated by es-node for shard 1 at block 12345.

Miner: 0xabc123...
Transaction hash: 0xdef456...

However, waiting for the transaction confirmation timed out. You can check the transaction status on the block explorer.

Sent at: Fri, 18 Jul 2025 11:14:25 +0800

Transaction Receipt Not Found

Subject: EthStorage Proof Submission: ❌ Failure

A storage proof was generated by es-node for shard 1 at block 12345.

Miner: 0xabc123...
Transaction hash: 0xdef456...

Unfortunately, the mining transaction receipt was not found.

Sent at: Fri, 18 Jul 2025 11:14:25 +0800