Skip to content

Commit

Permalink
Add --host-postgres-host flag to CLI for localnet
Browse files Browse the repository at this point in the history
  • Loading branch information
banool committed Nov 6, 2024
1 parent 021032c commit 0cea0fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/aptos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to the Aptos CLI will be captured in this file. This project
## Unreleased
- Fix typos in `aptos move compile` help text.
- Update the default version of `movefmt` to be installed from 1.0.5 to 1.0.6
- Add `--host-postgres-host` flag: https://github.com/aptos-labs/aptos-core/pull/15216.

## [4.3.0] - 2024/10/30
- Allow for setting large-packages module for chunking publish mode with `--large-packages-module-address`
Expand Down
7 changes: 6 additions & 1 deletion crates/aptos/src/node/local_testnet/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ pub struct PostgresArgs {
#[clap(long, requires = "with_indexer_api")]
pub use_host_postgres: bool,

/// If --use-host-postgres is set, you can use this to change the host we try to
/// connect to.
#[clap(long, default_value = "127.0.0.1")]
pub host_postgres_host: String,

/// When --use-host-postgres is set, this is the port to connect to.
#[clap(long, default_value_t = 5432)]
pub host_postgres_port: u16,
Expand Down Expand Up @@ -98,7 +103,7 @@ impl PostgresArgs {
None => &self.postgres_database,
};
let host = match self.use_host_postgres {
true => "127.0.0.1",
true => &self.host_postgres_host,
false => match external {
true => "127.0.0.1",
false => POSTGRES_CONTAINER_NAME,
Expand Down

0 comments on commit 0cea0fd

Please sign in to comment.