Ethereum and EVM networks
@
@@@
.@@@@@@
@@@@@@@@@
@@@@@@@@@@@.
.@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.
@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@((@@@@@@@@@@@
@@@@@@@@@@((((((((@@@@@@@@@.
@@@@@@@@((((((((((((((@@@@@@@@
@@@@@@(((((((((((((((((((((@@@@@@
@@@((((((((((((((((((((((((((((@@@@
(((((((((((((((((((((((((((((((((((((,
(((((((((((((((((((((((((((((((^
*((((((((((((((((((((((((
(((((((((((((((((
@@@. (((((((((* .@@^
@@@@. *(( .@@@@@
@@@@@@@ ..@@@@@@
@@@@@@@@@. .@@@@@@@@@
^@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@
@@@@@@@@@@^
@@@@@@@
@@@@^
@
Apibara provides preview streams for Ethereum. Streaming Ethereum data is still in preview and is subject to breaking changes as we finalize the DNA v2 protocol based on early users feedback. No authentication is required.
Ethereum Sepolia testnet (partial)
sepolia.ethereum.a5a.ch
Testing DNA v2
At the moment, we don't provide precompiled binaries for DNA v2. If you'd like to test DNA v2 and its EVM integration, you must compile binaries from the source.
- Clone the repository and switch
to the
dna-v2
branch. - Install a Rust toolchain, either using nix (
nix develop
) or with rustup. - Compile the binary you want to use. For example to test the MongoDB
integration:
cargo build --release -p apibara-sink-mongo
.
Getting started with EVM data
- Learn how to filter EVM data.
- Learn what data is streamed from the server to the indexer.
- Use any integration to sync onchain data to the rest of your application.
Example indexer
The following indexer listens for all ERC-20 Transfer
events on Sepolia and
prints them to stdout.
Change the sinkType
to:
- sync data to PostgreSQL.
- sync data to MongoDB.
- create Parquet datasets.
- send data to a webhook, for example to ingest data into Tinybird.
indexer.js
import {
decodeEventLog,
encodeEventTopics,
parseAbi,
} from "https://esm.sh/viem";
const abi = parseAbi([
"event Transfer(address indexed from, address indexed to, uint256 value)",
]);
export const config = {
streamUrl: "https://sepolia.ethereum.a5a.ch",
startingBlock: 5_000_000,
network: "evm",
filter: {
header: {},
logs: [
{
strict: true,
topics: encodeEventTopics({
abi,
eventName: "Transfer",
args: [null, null],
}),
},
],
},
sinkType: "console",
sinkOptions: {},
};
export default function transform({ header, logs }) {
return (logs ?? []).flatMap(({ address, topics, data, transactionHash }) => {
const decoded = decodeEventLog({ abi, topics, data });
return {
tokenAddress: address,
eventName: decoded.eventName,
from: decoded.args.from,
to: decoded.args.to,
value: decoded.args.value.toString(10),
transactionHash,
blockNumber: header.number.toString(10),
blockHash: header.hash,
blockTimestamp: header.timestamp,
};
});
}
Run with apibara-sink-console run indexer.js
.