Skip to content

Commit

Permalink
*: use localhost address instead of 127.0.0.1, fix #2575
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov committed Jun 30, 2022
1 parent a15a957 commit c26a962
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions cli/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ func TestRestoreDB(t *testing.T) {
}

func TestConfigureAddresses(t *testing.T) {
defaultAddress := "http://127.0.0.1:10333"
customAddress := "http://127.0.0.1:10334"
defaultAddress := "http://localhost:10333"
customAddress := "http://localhost:10334"

t.Run("default addresses", func(t *testing.T) {
cfg := &config.ApplicationConfiguration{
Expand Down
2 changes: 1 addition & 1 deletion config/protocol.mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/mainnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 10333
Relay: true
DialTimeout: 3
Expand Down
2 changes: 1 addition & 1 deletion config/protocol.privnet.docker.four.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 20336
Relay: true
DialTimeout: 3
Expand Down
2 changes: 1 addition & 1 deletion config/protocol.privnet.docker.one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 20333
Relay: true
DialTimeout: 3
Expand Down
2 changes: 1 addition & 1 deletion config/protocol.privnet.docker.single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 20333
Relay: true
DialTimeout: 3
Expand Down
2 changes: 1 addition & 1 deletion config/protocol.privnet.docker.three.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 20335
Relay: true
DialTimeout: 3
Expand Down
2 changes: 1 addition & 1 deletion config/protocol.privnet.docker.two.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 20334
Relay: true
DialTimeout: 3
Expand Down
10 changes: 5 additions & 5 deletions config/protocol.privnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ ProtocolConfiguration:
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
ValidatorsCount: 4
SeedList:
- 127.0.0.1:20333
- 127.0.0.1:20334
- 127.0.0.1:20335
- 127.0.0.1:20336
- localhost:20333
- localhost:20334
- localhost:20335
- localhost:20336
VerifyBlocks: true
VerifyTransactions: true
P2PSigExtensions: false
Expand All @@ -39,7 +39,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/privnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 20332
Relay: true
DialTimeout: 3
Expand Down
2 changes: 1 addition & 1 deletion config/protocol.testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/testnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 20333
Relay: true
DialTimeout: 3
Expand Down
4 changes: 2 additions & 2 deletions config/protocol.unit_testnet.single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/unit_testnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 0
Relay: true
DialTimeout: 3
Expand All @@ -53,7 +53,7 @@ ApplicationConfiguration:
Path: "/notary_wallet.json"
Password: "pass"
RPC:
Address: 127.0.0.1
Address: localhost
MaxGasInvoke: 15
Enabled: true
EnableCORSWorkaround: false
Expand Down
10 changes: 5 additions & 5 deletions config/protocol.unit_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ ProtocolConfiguration:
- 02c4de32252c50fa171dbe25379e4e2d55cdc12f69e382c39f59a44573ecff2f9d
ValidatorsCount: 4
SeedList:
- 127.0.0.1:20334
- 127.0.0.1:20335
- 127.0.0.1:20336
- localhost:20334
- localhost:20335
- localhost:20336
VerifyBlocks: true
VerifyTransactions: true
P2PSigExtensions: true
Expand Down Expand Up @@ -43,7 +43,7 @@ ApplicationConfiguration:
# BoltDBOptions:
# FilePath: "./chains/unit_testnet.bolt"
# Uncomment in order to set up custom address for node.
# Address: 127.0.0.1
# Address: localhost
NodePort: 20333
Relay: true
DialTimeout: 3
Expand All @@ -59,7 +59,7 @@ ApplicationConfiguration:
Path: "/notary_wallet.json"
Password: "pass"
RPC:
Address: 127.0.0.1
Address: localhost
MaxGasInvoke: 15
Enabled: true
EnableCORSWorkaround: false
Expand Down
4 changes: 2 additions & 2 deletions pkg/network/payload/address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func TestEncodeDecodeAddress(t *testing.T) {
var (
e, _ = net.ResolveTCPAddr("tcp", "127.0.0.1:2000")
e, _ = net.ResolveTCPAddr("tcp", "localhost:2000")
ts = time.Now()
addr = NewAddressAndTime(e, ts, capability.Capabilities{
{
Expand All @@ -39,7 +39,7 @@ func TestEncodeDecodeAddress(t *testing.T) {

func fillAddressList(al *AddressList) {
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{
{
Type: capability.TCPServer,
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type (
// The user agent of the server.
UserAgent string

// Address. Example: "127.0.0.1".
// Address. Example: "localhost".
Address string

// AnnouncedPort is an announced node port for P2P version exchange.
Expand Down

0 comments on commit c26a962

Please sign in to comment.