Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default defineConfig({
{ label: "Fundamentals", slug: "start-here/fundamentals" },
{ label: "Installation", slug: "start-here/installation" },
{ label: "Agent Skills", slug: "start-here/agent-skill" },
{ label: "Data Explorer", slug: "start-here/data-explorer" },
],
},
{
Expand Down Expand Up @@ -144,6 +145,104 @@ export default defineConfig({
}
});
});`
}, {
tag: "script",
content: `
(() => {
if (window.__copyAnalyticsBound) return;
window.__copyAnalyticsBound = true;

const nearestSection = (el) => {
const headings = document.querySelectorAll('h2[id], h3[id], h4[id], h5[id], h6[id]');
for (let i = headings.length - 1; i >= 0; i--) {
if (el.compareDocumentPosition(headings[i]) & Node.DOCUMENT_POSITION_PRECEDING) {
return headings[i].id;
}
}
return 'intro';
};

document.addEventListener('click', (e) => {
const target = e.target;
if (!(target instanceof Element)) return;
const btn = target.closest('button[data-code]');
if (!btn) return;

const pre = btn.closest('figure')?.querySelector('pre');
const lang = pre?.getAttribute('data-language') ?? 'unknown';

window.umami?.track('code-copied', {
page: location.pathname,
section: nearestSection(btn),
lang,
});
});
})();
`
}, {
tag: "script",
content: `
(() => {
if (window.__searchAnalyticsBound) return;
window.__searchAnalyticsBound = true;

// Order matters: bearer before jwt before api-key, paths before generic hex.
const PATTERNS = [
{ name: 'email', re: /\\S+@\\S+\\.\\S+/g },
{ name: 'bearer', re: /\\bBearer\\s+\\S+/gi },
{ name: 'jwt', re: /\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\b/g },
{ name: 'api-key', re: /\\b(?:sk|pk|rk)-[A-Za-z0-9_-]{16,}\\b/g },
{ name: 'uuid', re: /\\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\b/g },
{ name: 'unix-path', re: /\\/(?:Users|home)\\/[^\\s/]+/g },
{ name: 'win-path', re: /[A-Za-z]:\\\\Users\\\\[^\\s\\\\]+/g },
{ name: 'ipv4', re: /\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b/g },
{ name: 'hex-address', re: /\\b0x[0-9a-fA-F]{6,}\\b/g },
{ name: 'cc-like', re: /\\b(?:\\d[ -]?){13,19}\\b/g },
];

const sanitize = (raw) => {
const redactions = [];
let out = raw;
for (const { name, re } of PATTERNS) {
if (re.test(out)) {
redactions.push(name);
re.lastIndex = 0;
out = out.replace(re, \`[\${name}]\`);
}
}
return {
query: out.replace(/\\s+/g, ' ').trim().slice(0, 100),
redactions,
};
};

let timer;
let lastSent = '';

document.addEventListener('input', (e) => {
const target = e.target;
if (!(target instanceof HTMLInputElement)) return;
if (!target.classList.contains('pagefind-ui__search-input')) return;

clearTimeout(timer);
timer = setTimeout(() => {
const { query, redactions } = sanitize(target.value ?? '');
if (query.length < 2 || query === lastSent) return;
lastSent = query;

const hasResults =
document.querySelectorAll('.pagefind-ui__result').length > 0;

window.umami?.track('docs-search', {
query,
hasResults,
redacted: redactions.length > 0,
redactionTypes: redactions.join(','),
});
}, 600);
});
})();
`
}]
}),
],
Expand Down
Binary file added src/assets/data-explorer-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Card, CardGrid, LinkCard, LinkButton } from '@astrojs/starlight/compone
<div class="testnet-card">
<div class="testnet-header">
<span class="testnet-name">BRAGA DB-CHAIN</span>
<a href="https://status.braga.hoodi.arkiv.network/" class="testnet-status" target="_blank" rel="noopener">Status Page</a>
<a href="https://status.arkiv.network/" class="testnet-status" target="_blank" rel="noopener">Status Page</a>
</div>
<div class="testnet-grid">
<div class="testnet-field">
Expand All @@ -47,7 +47,8 @@ import { Card, CardGrid, LinkCard, LinkButton } from '@astrojs/starlight/compone
</div>
</div>
<div class="testnet-actions">
<a href="https://explorer.braga.hoodi.arkiv.network/" target="_blank" rel="noopener">Explorer</a>
<a href="https://explorer.braga.hoodi.arkiv.network/" target="_blank" rel="noopener">Block Explorer</a>
<a href="https://data.arkiv.network?utm_source=docs&utm_medium=referral&utm_campaign=data-explorer&utm_content=quickstart-button" target="_blank" rel="noopener">Entity Explorer</a>
<button id="add-braga-btn" type="button" data-umami-event="add-braga-to-wallet">Add Network to Wallet</button>
<a href="https://braga.hoodi.arkiv.network/faucet/" target="_blank" rel="noopener">Get Test Tokens</a>
</div>
Expand Down
38 changes: 38 additions & 0 deletions src/content/docs/start-here/data-explorer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Data Explorer
description: Browse and query Arkiv entities in the browser — without writing any code.
---

import { Aside } from '@astrojs/starlight/components';

The [Arkiv Data Explorer](https://data.arkiv.network?utm_source=docs&utm_medium=referral&utm_campaign=data-explorer&utm_content=docs-page-hero) is a browser-based tool for querying and inspecting entities on Arkiv testnets. Reach for it when you want to verify that your app wrote what you expected, prototype a query before putting it in code, or simply explore what's on a testnet.

![The Arkiv Data Explorer landing screen, with the query editor and example queries.](../../../assets/data-explorer-home.png)

## Query editor

The query editor at the top of the Explorer accepts Arkiv's full query syntax — operators, attribute types, glob matching, and range filters.

For the full reference, see [Query syntax](/json-rpc/querying-data/#query-syntax).

## Searching for entities or owners

Paste a raw value directly into the editor and the Explorer normalises it automatically:

- A 32-byte hex string becomes `$key = "0x…"`
- A 20-byte address becomes `$owner = "0x…"`

No manual quoting or operator selection needed.

## Sharing results

The current query and selected chain are always encoded in the URL. Copy the address bar to share an exact query — anyone who opens the link sees the same query pre-loaded and auto-run.

<Aside type="tip">
This makes Explorer links useful for bug reports: paste the URL and the recipient lands directly on the relevant result.
</Aside>

If you want a quick deep-link to a specific entity or owner from your own app, you can link directly:

- `https://data.arkiv.network/entity/0x123…` — opens the Explorer with that entity key pre-queried
- `https://data.arkiv.network/owner/0x123…` — opens the Explorer filtered by that owner address