Kaynağa Gözat

Change default local test-validator address from localhost to 127.0.0.1 (#2725)

chalda 1 yıl önce
ebeveyn
işleme
61244a86dc
3 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 1 0
      CHANGELOG.md
  2. 1 1
      cli/src/lib.rs
  3. 1 1
      ts/packages/anchor/src/provider.ts

+ 1 - 0
CHANGELOG.md

@@ -25,6 +25,7 @@ The minor version will be incremented upon a breaking change and the patch versi
 - cli: Display errors if toolchain override restoration fails ([#2700](https://github.com/coral-xyz/anchor/pull/2700)).
 - cli: Fix commit based `anchor_version` override ([#2704](https://github.com/coral-xyz/anchor/pull/2704)).
 - spl: Fix compilation with `shmem` feature enabled ([#2722](https://github.com/coral-xyz/anchor/pull/2722)).
+- cli: Localhost default test validator address changes from `localhost` to `127.0.0.1`, NodeJS 17 IP resolution changes for IPv6 ([#2725](https://github.com/coral-xyz/anchor/pull/2725)).
 
 ### Breaking
 

+ 1 - 1
cli/src/lib.rs

@@ -3514,7 +3514,7 @@ fn test_validator_rpc_url(test_validator: &Option<TestValidator>) -> String {
             validator: Some(validator),
             ..
         }) => format!("http://{}:{}", validator.bind_address, validator.rpc_port),
-        _ => "http://localhost:8899".to_string(),
+        _ => "http://127.0.0.1:8899".to_string(),
     }
 }
 

+ 1 - 1
ts/packages/anchor/src/provider.ts

@@ -89,7 +89,7 @@ export class AnchorProvider implements Provider {
     }
     opts = opts ?? AnchorProvider.defaultOptions();
     const connection = new Connection(
-      url ?? "http://localhost:8899",
+      url ?? "http://127.0.0.1:8899",
       opts.preflightCommitment
     );
     const NodeWallet = require("./nodewallet.js").default;