Read chain data
Use this guide when your application needs Blurt Layer 1 data: accounts, content, blocks, witnesses, proposals, chain properties or account history.
Layer 1 queries ask a Blurt RPC node for consensus data. They do not require private keys, and they do not broadcast operations. That makes them the safest place to start before adding signing or broadcast workflows.
When to use Layer 1 reads
Use Layer 1 helpers when you need data that comes directly from the Blurt blockchain:
| Need | Start with | Why |
|---|---|---|
| Current head block, irreversible block or chain time | client.condenser.getDynamicGlobalProperties() | Smallest useful connectivity and chain-state query. |
| Account balances, authorities or vesting state | client.condenser.getAccounts() | Account state is Layer 1 data. |
| Content object by author/permlink | client.condenser.getContent() | Retrieves the chain content object. |
| Active votes on content | client.condenser.getActiveVotes() | Reads vote records for one content item. |
| Witness information | client.condenser.getWitnessByAccount() | Reads witness state by account name. |
| Block headers, blocks or operation streams | client.blockchain helpers | Higher-level iteration around block ranges. |
| Virtual/account operation history | client.accountHistory or condenser history helpers | Reads account operation history and virtual operation envelopes. |
| Appbase methods without a helper | client.call(api, method, params) | Generic JSON-RPC escape hatch. |
If you are choosing between Layer 1 and Nexus, read Layer 1 and Nexus Layer 2 first.
Create a client
import { Client } from '@beblurt/dblurt';
const client = new Client([
'https://rpc.blurt.blog',
'https://rpc.beblurt.com',
'https://blurt-rpc.saboin.com'
], {
timeout: 15_000,
failoverThreshold: 3
});Use more than one endpoint when your application should tolerate temporary node failures. Endpoint behavior is covered in RPC endpoints and failover.
Read current chain state
const props = await client.condenser.getDynamicGlobalProperties();
console.log({
head: props.head_block_number,
irreversible: props.last_irreversible_block_num,
time: props.time
});Use last_irreversible_block_num when a workflow needs a more stable reference point than the latest head block.
Load account state
const [account] = await client.condenser.getAccounts(['beblurt']);
if (!account) {
throw new Error('account not found');
}
console.log({
name: account.name,
balance: account.balance,
vesting: account.vesting_shares,
postingAuthorities: account.posting.key_auths.length
});Account data includes balances, authorities and chain fields returned by the RPC API. If you need an application-ready account summary, use Read models or the Read account summary recipe.
Read content and votes
const post = await client.condenser.getContent('megadrive', 'a-declaration-is-more-than-a-post-it-is-a-public-commitment');
const votes = await client.condenser.getActiveVotes(post.author, post.permlink);
console.log({
title: post.title,
votes: votes.length
});This reads the Layer 1 content object and its active vote records. For discovery flows such as ranked feeds or community pages, use Nexus first, then fetch Layer 1 content only when your workflow needs the chain object.
Iterate blocks deliberately
Use client.blockchain for bounded block or operation iteration. For parser/indexer workflows, continue with Parse blockchain history.
import { BlockchainMode } from '@beblurt/dblurt';
const latest = await client.blockchain.getCurrentBlockNum(BlockchainMode.Irreversible);
const blockNumbers = await client.blockchain.getBlockNumbers({
from: latest - 2,
to: latest,
mode: BlockchainMode.Irreversible
});
console.log(blockNumbers);Keep iteration bounded in examples, dashboards and background jobs. Large scans should have explicit limits, retry behavior and persistence outside the SDK.
Use generic RPC calls only when needed
When a method is not wrapped by a helper, use client.call(api, method, params) instead of inventing a helper name.
const version = await client.call('database_api', 'get_version', []);
console.log(version.blockchain_version);The generic call surface is useful, but it does not replace the typed helper families. Prefer helpers when they exist.
Safety and correctness notes
- Layer 1 reads do not require private keys.
- Do not ask for keys in a page or example that only queries blockchain data.
- Use Nexus for indexed social discovery; use Layer 1 helpers for canonical chain objects.
- Prefer irreversible block mode for examples and replay-style tools.
- Use bounded ranges for block and operation iteration.
- Treat RPC endpoints as network dependencies; configure timeouts and endpoint lists intentionally.
Validated examples
examples/node/read-head-block.cjsexamples/node/read-account.cjsexamples/node/read-post.cjsexamples/node/read-active-votes.cjsexamples/node/read-block-operations.cjs- Read account history recipe
examples/node/stream-block-numbers.cjs
API details
Use the API reference for exact method signatures, options and return types:
