This package was initialized via substreams init
, using the evm-minimal
template.
This substream monitors blockchain transactions in real-time, specifically designed to track incoming transactions to specified addresses. It supports both native ETH transfers and ERC20 token transfers.
from
and to
addressesFor live monitoring of incoming transactions:
# Make the script executable (first time only)
chmod +x run_live.sh
# Start live monitoring
./run_live.sh
Note: When no start block is specified, the substream automatically starts from the current head of the blockchain and continues monitoring new blocks as they arrive. This ensures you're always monitoring the latest transactions without processing historical data.
# Build the project
cargo build --target wasm32-unknown-unknown --release
# Authenticate with Substreams
substreams auth
# Run in live mode (starts from current head and continues monitoring new blocks)
substreams run substreams.yaml filter_transactions --log-level=info
To process historical blocks:
# Process from a specific block number
substreams run substreams.yaml filter_transactions --start-block 1000000
# Process a range of blocks
substreams run substreams.yaml filter_transactions --start-block 1000000 --stop-block 1000100
Configure the addresses to monitor in substreams.yaml
:
params:
filter_transactions: 'to=0xcccd218a58b53c67fc17d8c87cb90d83614e35fd'
You can also filter by multiple addresses:
params:
filter_transactions: 'to=0xcccd218a58b53c67fc17d8c87cb90d83614e35fd&from=0x1234567890123456789012345678901234567890'
to
: Monitor incoming transactions to this address (supports both direct transfers and ERC20 transfers)from
: Monitor outgoing transactions from this addressThe substream outputs transaction data in the following format:
{
"transactions": [
{
"from": "0x...",
"to": "0x...",
"hash": "0x...",
"value": "1000000000000000000",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
}
]
}
token_id
will be 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
token_id
will be the contract address of the tokenThe substream provides comprehensive logging:
INFO: Processing block 12345678 with 150 transactions
INFO: Monitoring for incoming transactions to address: 0xcccd218a58b53c67fc17d8c87cb90d83614e35fd
INFO: MATCHED TRANSACTION: Block 12345678 | Hash: 0x... | From: 0x... | To: 0x... | Value: 1000000000000000000 | Token: 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Optionally, you can publish your Substreams to the Substreams Registry.
substreams registry login # Login to substreams.dev
substreams registry publish # Publish your Substreams to substreams.dev
filter_transactions
This module filters and processes blockchain transactions based on specified address filters. It:
cargo build --target wasm32-unknown-unknown --release
cargo test
Key dependencies:
substreams
: Core Substreams frameworksubstreams-ethereum
: Ethereum-specific functionalitynum-bigint
: Big integer arithmetic for token amountsserde
: Serialization/deserializationanyhow
: Error handlingfilter_transactions
returns full transaction data from the block with comprehensive logging.
This module continuously processes all blocks to monitor for incoming transactions to specified addresses.
substreams gui cypher-substreams@v0.1.1 filter_transactions
message
Request
message
Response
message
BlockUndoSignal
message
BlockScopedData
message
SessionInit
message
InitialSnapshotComplete
message
InitialSnapshotData
message
MapModuleOutput
message
StoreModuleOutput
message
OutputDebugInfo
message
ModulesProgress
message
ModuleProgress
message
BlockRange
message
StoreDelta
message
DeployRequest
message
Parameter
message
DeployResponse
message
UpdateRequest
message
UpdateResponse
message
InfoRequest
message
InfoResponse
message
SinkProgress
message
PackageInfo
message
ListRequest
message
ListResponse
message
DeploymentWithStatus
message
RemoveRequest
message
RemoveResponse
message
PauseRequest
message
PauseResponse
message
StopRequest
message
StopResponse
message
ResumeRequest
message
ResumeResponse
enum
DeploymentStatus
message
Modules
message
Binary
message
Module
message
Package
message
PackageMetadata
message
ModuleMetadata
message
Clock
message
BlockRef
message
FileDescriptorSet
message
FileDescriptorProto
message
DescriptorProto
message
ExtensionRangeOptions
message
FieldDescriptorProto
message
OneofDescriptorProto
message
EnumDescriptorProto
message
EnumValueDescriptorProto
message
ServiceDescriptorProto
message
MethodDescriptorProto
message
FileOptions
message
MessageOptions
message
FieldOptions
message
OneofOptions
message
EnumOptions
message
EnumValueOptions
message
ServiceOptions
message
MethodOptions
message
UninterpretedOption
message
SourceCodeInfo
message
GeneratedCodeInfo
message
Any
message
Timestamp
message
Block
message
BlockHeader
message
Uint64NestedArray
message
Uint64Array
message
BigInt
message
TransactionTrace
message
AccessTuple
message
TransactionReceipt
message
Log
message
Call
message
StorageChange
message
BalanceChange
message
NonceChange
message
AccountCreation
message
CodeChange
message
GasChange
message
HeaderOnlyBlock
message
BlockWithRefs
message
TransactionTraceWithBlockRef
message
TransactionRefs
message
BlockRef
enum
TransactionTraceStatus
enum
CallType
message
RpcCalls
message
RpcCall
message
RpcResponses
message
RpcResponse