Merge pull request #2577 from nspcc-dev/localhost

Localhost
This commit is contained in:
Roman Khimov 2022-06-30 19:14:18 +03:00 committed by GitHub
commit 5c4e83db4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 25 additions and 25 deletions

View file

@ -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{

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
@ -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

View file

@ -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

View file

@ -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
@ -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

View file

@ -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
@ -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
@ -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

View file

@ -16,7 +16,7 @@ node-related settings described in the table below.
| Section | Type | Default value | Description |
| --- | --- | --- | --- |
| Address | `string` | `127.0.0.1` | Node address that P2P protocol handler binds to. |
| Address | `string` | `0.0.0.0` | Node address that P2P protocol handler binds to. |
| AnnouncedPort | `uint16` | Same as `NodePort` | Node port which should be used to announce node's port on P2P layer, it can differ from the `NodePort` the node is bound to (for example, if your node is behind NAT). |
| AttemptConnPeers | `int` | `20` | Number of connection to try to establish when the connection count drops below the `MinPeers` value.|
| DBConfiguration | [DB Configuration](#DB-Configuration) | | Describes configuration for database. See the [DB Configuration](#DB-Configuration) section for details. |

View file

@ -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{
{
@ -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,

View file

@ -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.