Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update indexer4explorer.md #1461

Merged
merged 1 commit into from
Aug 8, 2023
Merged
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
16 changes: 4 additions & 12 deletions docs/4.tools/indexer4explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You can find the source code on [this GitHub repository](https://github.com/near

:::warning
The database could go down or take time to reflect the most current blockchain info. Do not use it in production.
For a reliable source of real time and past information, please run your own [indexer](https://near-indexers.io/).
For a reliable source of real-time and past information, please run your own [indexer](https://near-indexers.io/).
:::

---
Expand Down Expand Up @@ -56,19 +56,11 @@ You can use any database manager compatible with PostgreSQL. If you don't know a
</TabItem>
</Tabs>


---

## Database Structure
Please bear in mind that the structure might evolve or change with time.

[![structure_img](https://raw.githubusercontent.com/near/near-indexer-for-explorer/master/docs/near-indexer-for-explorer-db.png)](https://raw.githubusercontent.com/near/near-indexer-for-explorer/master/docs/near-indexer-for-explorer-db.png)

---

## Example Queries
### Transactions Calling a Method
Query for all transaction that called `contribute` in the `v1.faucet.nonofficial.testnet` testnet account.
Query for all transactions that called `contribute` in the `v1.faucet.nonofficial.testnet` testnet account.

```sql
select r.predecessor_account_id, t.transaction_hash
Expand All @@ -82,7 +74,7 @@ where r.receiver_account_id ='v1.faucet.nonofficial.testnet'

<hr class="subsection" />

### Users, Status and Attached Money
### Users, Status, and Attached Money
Query for all users that called `contribute` in `v1.faucet.nonofficial.testnet`, how much they attached to the call, and the transaction status.

```sql
Expand All @@ -105,4 +97,4 @@ select r.receiver_account_id, ara.args -> 'deposit' as deposit
from receipts r, action_receipt_actions ara
where r.predecessor_account_id ='v1.faucet.nonofficial.testnet'
and ara.receipt_id = r.receipt_id and ara.action_kind = 'TRANSFER'
```
```
Loading