Skip to content
Open
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
156 changes: 145 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ authors = ["Your Name <your.email@example.com>"]
license = "MIT OR Apache-2.0"

[dependencies]
celestia-rpc = { git = "https://github.com/celestiaorg/lumina.git", rev = "e114c6f" }
celestia-types = { git = "https://github.com/celestiaorg/lumina.git", rev = "e114c6f" }
celestia-rpc = { git = "https://github.com/celestiaorg/lumina.git", rev = "6bf264d" }
celestia-types = { git = "https://github.com/celestiaorg/lumina.git", rev = "6bf264d" }
celestia-proto = { git = "https://github.com/celestiaorg/lumina.git", rev = "6bf264d", features = ["tonic", "tonic-server"] }
tonic = { version = "0.13", default-features = false, features = ["codegen", "prost", "transport", "router"] }
prost = "0.13"
tendermint-proto = "0.40.3"
tendermint = "0.40.3"
ed25519-consensus = "2.1.0"
rand = "0.8.5"
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Defaults if unset:

- `REDIS_URL=redis://127.0.0.1:6379`
- `LISTEN_ADDR=127.0.0.1:26658`
- `GRPC_ADDR=0.0.0.0:9090`

Localestia clears the Redis database on startup.

Expand All @@ -52,6 +53,29 @@ LOCALESTIA_REDIS_MODE=docker cargo test

You can also use `LOCALESTIA_REDIS_MODE=auto` to prefer a local `REDIS_URL` if set and fall back to Docker when available.

### gRPC integration tests

The `grpc` test suite starts a real localestia process on ephemeral ports and exercises all five gRPC services via generated tonic client stubs:

```bash
# With a local Redis already running:
LOCALESTIA_REDIS_MODE=local cargo test --test grpc -- --test-threads=1

# Or let the test harness spin up a Redis container:
LOCALESTIA_REDIS_MODE=docker cargo test --test grpc -- --test-threads=1
```

`--test-threads=1` is required because each test acquires a global lock (one localestia process at a time). The tests cover:

| Test | gRPC service | What is verified |
|---|---|---|
| `test_get_node_info` | `cosmos.base.tendermint.v1beta1.Service` | moniker=`localestia`, network=`private` |
| `test_account` | `cosmos.auth.v1beta1.Query` | account_number=1, sequence=0 |
| `test_broadcast_tx_empty` | `cosmos.tx.v1beta1.Service` | code=0, height=0 for an empty tx |
| `test_tx_status_unknown_returns_committed` | `celestia.core.v1.tx.Tx` | status=`COMMITTED`, height=1 for unknown tx |
| `test_estimate_gas_price` | `celestia.core.v1.gas_estimation.GasEstimator` | price=0.002 |
| `test_estimate_gas_price_and_usage` | `celestia.core.v1.gas_estimation.GasEstimator` | price=0.002, gas_used=500 000 |

## Supported RPC Methods

Localestia implements the following JSON-RPC methods:
Expand Down
Loading