*: use localhost address instead of 127.0.0.1, fix #2575

This commit is contained in:
Roman Khimov 2022-06-30 16:18:41 +03:00
parent a15a9577f0
commit c26a962b55
13 changed files with 24 additions and 24 deletions

View file

@ -288,8 +288,8 @@ func TestRestoreDB(t *testing.T) {
} }
func TestConfigureAddresses(t *testing.T) { func TestConfigureAddresses(t *testing.T) {
defaultAddress := "http://127.0.0.1:10333" defaultAddress := "http://localhost:10333"
customAddress := "http://127.0.0.1:10334" customAddress := "http://localhost:10334"
t.Run("default addresses", func(t *testing.T) { t.Run("default addresses", func(t *testing.T) {
cfg := &config.ApplicationConfiguration{ cfg := &config.ApplicationConfiguration{

View file

@ -60,7 +60,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/mainnet.bolt" # FilePath: "./chains/mainnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 10333 NodePort: 10333
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3

View file

@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/privnet.bolt" # FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 20336 NodePort: 20336
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3

View file

@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/privnet.bolt" # FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 20333 NodePort: 20333
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3

View file

@ -33,7 +33,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/privnet.bolt" # FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 20333 NodePort: 20333
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3

View file

@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/privnet.bolt" # FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 20335 NodePort: 20335
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3

View file

@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/privnet.bolt" # FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 20334 NodePort: 20334
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3

View file

@ -10,10 +10,10 @@ ProtocolConfiguration:
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62 - 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
ValidatorsCount: 4 ValidatorsCount: 4
SeedList: SeedList:
- 127.0.0.1:20333 - localhost:20333
- 127.0.0.1:20334 - localhost:20334
- 127.0.0.1:20335 - localhost:20335
- 127.0.0.1:20336 - localhost:20336
VerifyBlocks: true VerifyBlocks: true
VerifyTransactions: true VerifyTransactions: true
P2PSigExtensions: false P2PSigExtensions: false
@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/privnet.bolt" # FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 20332 NodePort: 20332
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3

View file

@ -63,7 +63,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/testnet.bolt" # FilePath: "./chains/testnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 20333 NodePort: 20333
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3

View file

@ -34,7 +34,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/unit_testnet.bolt" # FilePath: "./chains/unit_testnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 0 NodePort: 0
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3
@ -53,7 +53,7 @@ ApplicationConfiguration:
Path: "/notary_wallet.json" Path: "/notary_wallet.json"
Password: "pass" Password: "pass"
RPC: RPC:
Address: 127.0.0.1 Address: localhost
MaxGasInvoke: 15 MaxGasInvoke: 15
Enabled: true Enabled: true
EnableCORSWorkaround: false EnableCORSWorkaround: false

View file

@ -12,9 +12,9 @@ ProtocolConfiguration:
- 02c4de32252c50fa171dbe25379e4e2d55cdc12f69e382c39f59a44573ecff2f9d - 02c4de32252c50fa171dbe25379e4e2d55cdc12f69e382c39f59a44573ecff2f9d
ValidatorsCount: 4 ValidatorsCount: 4
SeedList: SeedList:
- 127.0.0.1:20334 - localhost:20334
- 127.0.0.1:20335 - localhost:20335
- 127.0.0.1:20336 - localhost:20336
VerifyBlocks: true VerifyBlocks: true
VerifyTransactions: true VerifyTransactions: true
P2PSigExtensions: true P2PSigExtensions: true
@ -43,7 +43,7 @@ ApplicationConfiguration:
# BoltDBOptions: # BoltDBOptions:
# FilePath: "./chains/unit_testnet.bolt" # FilePath: "./chains/unit_testnet.bolt"
# Uncomment in order to set up custom address for node. # Uncomment in order to set up custom address for node.
# Address: 127.0.0.1 # Address: localhost
NodePort: 20333 NodePort: 20333
Relay: true Relay: true
DialTimeout: 3 DialTimeout: 3
@ -59,7 +59,7 @@ ApplicationConfiguration:
Path: "/notary_wallet.json" Path: "/notary_wallet.json"
Password: "pass" Password: "pass"
RPC: RPC:
Address: 127.0.0.1 Address: localhost
MaxGasInvoke: 15 MaxGasInvoke: 15
Enabled: true Enabled: true
EnableCORSWorkaround: false EnableCORSWorkaround: false

View file

@ -14,7 +14,7 @@ import (
func TestEncodeDecodeAddress(t *testing.T) { func TestEncodeDecodeAddress(t *testing.T) {
var ( var (
e, _ = net.ResolveTCPAddr("tcp", "127.0.0.1:2000") e, _ = net.ResolveTCPAddr("tcp", "localhost:2000")
ts = time.Now() ts = time.Now()
addr = NewAddressAndTime(e, ts, capability.Capabilities{ addr = NewAddressAndTime(e, ts, capability.Capabilities{
{ {
@ -39,7 +39,7 @@ func TestEncodeDecodeAddress(t *testing.T) {
func fillAddressList(al *AddressList) { func fillAddressList(al *AddressList) {
for i := 0; i < len(al.Addrs); i++ { for i := 0; i < len(al.Addrs); i++ {
e, _ := net.ResolveTCPAddr("tcp", fmt.Sprintf("127.0.0.1:20%d", i)) e, _ := net.ResolveTCPAddr("tcp", fmt.Sprintf("localhost:20%d", i))
al.Addrs[i] = NewAddressAndTime(e, time.Now(), capability.Capabilities{ al.Addrs[i] = NewAddressAndTime(e, time.Now(), capability.Capabilities{
{ {
Type: capability.TCPServer, Type: capability.TCPServer,

View file

@ -28,7 +28,7 @@ type (
// The user agent of the server. // The user agent of the server.
UserAgent string UserAgent string
// Address. Example: "127.0.0.1". // Address. Example: "localhost".
Address string Address string
// AnnouncedPort is an announced node port for P2P version exchange. // AnnouncedPort is an announced node port for P2P version exchange.