Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit ff123cf

Browse files
Topic about sources of information available to developers and dApps (#313)
* Topic about sources of information available to developers and dApps * Can get current balance
1 parent 135c901 commit ff123cf

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

Diff for: docs/developing/information.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Getting information about the blockchain
3+
authors: Tim McMackin
4+
last_update:
5+
date: 8 February 2024
6+
---
7+
8+
Developers and dApps can get information about the Tezos blockchain, such as account balances, from these sources:
9+
10+
## The Octez client
11+
12+
The [The Octez client](./octez-client) provides information about accounts, addresses, and many other things.
13+
For example, you can get the balance of an account with this command:
14+
15+
```bash
16+
octez-client get balance for tz1QCVQinE8iVj1H2fckqx6oiM85CNJSK9Sx
17+
```
18+
19+
## The RPC protocol
20+
21+
The [RPC](../architecture/rpc) protocol provides information about the blockchain that nodes use to communicate with each other.
22+
This data is not always in the format that developers and dApps need.
23+
For example, the RPC interface does not provide a way to get information about a specific operation by its hash.
24+
25+
You can get some information about accounts, contracts, and other things from RPC requests.
26+
For example, this RPC request gets the current balance of an account:
27+
28+
```bash
29+
curl -X GET https://rpc.ghostnet.teztnets.com/chains/main/blocks/head/context/contracts/tz1QCVQinE8iVj1H2fckqx6oiM85CNJSK9Sx/balance
30+
```
31+
32+
## Indexers
33+
34+
Indexers are off-chain applications that retrieve blockchain data, process it, and store it in a way that makes it easier to search and use.
35+
For example, you can use the [TZKT API](https://api.tzkt.io/) to get the recent operations an account made with this request:
36+
37+
```bash
38+
curl -X GET https://api.ghostnet.tzkt.io/v1/accounts/tz1QCVQinE8iVj1H2fckqx6oiM85CNJSK9Sx/operations
39+
```
40+
41+
For more information, see [Indexers](./information/indexers).
42+
43+
## Block explorers
44+
45+
Block explorers use data from indexers to show information in a human-friendly interface.
46+
For example, this link shows information about a contract, including its current storage, entrypoints, and transaction history: https://better-call.dev/ghostnet/KT1R4i4qEaxF7v3zg1M8nTeyrqk8JFmdGLuu/operations
47+
48+
For more information about block explorers, see [Block explorers](./information/block-explorers).

Diff for: sidebars.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ const sidebars = {
8888
{
8989
type: 'category',
9090
label: 'Getting information about the blockchain',
91-
// link: { // TODO
92-
// id: 'developing/information',
93-
// type: 'doc',
94-
// },
91+
link: {
92+
id: 'developing/information',
93+
type: 'doc',
94+
},
9595
items: [
9696
{
9797
type: 'category',

0 commit comments

Comments
 (0)