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
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,3 @@ If you prefer not to use Docker, you can follow the instructions below to set up
## REST API
The API endpoints are described in the `swagger.yml` file located in the project root. A hosted HTML version of the API documentation is available at [Namada Interface Indexer REST API](https://namada-net.github.io/namada-indexer).

## Populating the Database for Testing

Instead of fetching data from a running network, you can populate the database with random data for testing purposes. Build the project using the following command.

```sh
cargo build
# Run the seeder script to populate the database
cd seeder && cargo run -- --database-url postgres://postgres:password@0.0.0.0:5433/namada-indexer
```

After populating the database, you can run the webserver to access the data via the API. To query your PostgreSQL database, ensure the PostgreSQL client is installed.

```sh
apt-get install -y postgresql-client
```
2 changes: 2 additions & 0 deletions webserver/src/response/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ pub struct WrapperTransactionResponse {
pub gas_limit: String,
pub gas_used: Option<u64>,
pub amount_per_gas_unit: Option<f64>,
pub masp_fee_payment: Option<String>,
pub block_height: u64,
pub inner_transactions: Vec<ShortInnerTransactionResponse>,
pub exit_code: TransactionResultResponse,
Expand All @@ -121,6 +122,7 @@ impl WrapperTransactionResponse {
gas_limit: wrapper.gas_limit.to_string(),
gas_used: wrapper.gas_used,
amount_per_gas_unit: wrapper.amount_per_gas_unit,
masp_fee_payment: wrapper.masp_fee_payment,
block_height: wrapper.block_height,
inner_transactions: inners
.into_iter()
Expand Down