Skip to content

Commit

Permalink
Update indexer4explorer.md (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
bucanero authored Aug 8, 2023
1 parent fc359e7 commit 2ef2ef0
Showing 1 changed file with 4 additions and 12 deletions.
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'
```
```

0 comments on commit 2ef2ef0

Please sign in to comment.