forked from TrueCloudLab/neoneo-go
Merge pull request #2786 from nspcc-dev/simplify-getversion
Simplify result.Version
This commit is contained in:
commit
93cec0bba5
7 changed files with 46 additions and 186 deletions
1
go.mod
1
go.mod
|
@ -2,7 +2,6 @@ module github.com/nspcc-dev/neo-go
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
|
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
|
||||||
github.com/coreos/go-semver v0.3.0
|
|
||||||
github.com/davecgh/go-spew v1.1.1
|
github.com/davecgh/go-spew v1.1.1
|
||||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
|
||||||
github.com/google/uuid v1.2.0
|
github.com/google/uuid v1.2.0
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -84,8 +84,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
|
||||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
|
|
||||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
|
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
|
|
|
@ -2,11 +2,7 @@ package result
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/coreos/go-semver/semver"
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/config"
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
|
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
|
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
|
||||||
)
|
)
|
||||||
|
@ -15,17 +11,11 @@ type (
|
||||||
// Version model used for reporting server version
|
// Version model used for reporting server version
|
||||||
// info.
|
// info.
|
||||||
Version struct {
|
Version struct {
|
||||||
// Magic contains network magic.
|
TCPPort uint16 `json:"tcpport"`
|
||||||
// Deprecated: use Protocol.Network instead
|
WSPort uint16 `json:"wsport,omitempty"`
|
||||||
Magic netmode.Magic
|
Nonce uint32 `json:"nonce"`
|
||||||
TCPPort uint16
|
UserAgent string `json:"useragent"`
|
||||||
WSPort uint16
|
Protocol Protocol `json:"protocol"`
|
||||||
Nonce uint32
|
|
||||||
UserAgent string
|
|
||||||
Protocol Protocol
|
|
||||||
// StateRootInHeader is true if state root is contained in the block header.
|
|
||||||
// Deprecated: use Protocol.StateRootInHeader instead
|
|
||||||
StateRootInHeader bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Protocol represents network-dependent parameters.
|
// Protocol represents network-dependent parameters.
|
||||||
|
@ -52,19 +42,6 @@ type (
|
||||||
// ValidatorsHistory stores height:size map of the validators count.
|
// ValidatorsHistory stores height:size map of the validators count.
|
||||||
ValidatorsHistory map[uint32]int
|
ValidatorsHistory map[uint32]int
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
// versionMarshallerAux is an auxiliary struct used for Version JSON marshalling.
|
|
||||||
versionMarshallerAux struct {
|
|
||||||
Magic netmode.Magic `json:"network"`
|
|
||||||
TCPPort uint16 `json:"tcpport"`
|
|
||||||
WSPort uint16 `json:"wsport,omitempty"`
|
|
||||||
Nonce uint32 `json:"nonce"`
|
|
||||||
UserAgent string `json:"useragent"`
|
|
||||||
Protocol protocolMarshallerAux `json:"protocol"`
|
|
||||||
StateRootInHeader bool `json:"staterootinheader,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// protocolMarshallerAux is an auxiliary struct used for Protocol JSON marshalling.
|
// protocolMarshallerAux is an auxiliary struct used for Protocol JSON marshalling.
|
||||||
protocolMarshallerAux struct {
|
protocolMarshallerAux struct {
|
||||||
|
@ -83,125 +60,49 @@ type (
|
||||||
StateRootInHeader bool `json:"staterootinheader,omitempty"`
|
StateRootInHeader bool `json:"staterootinheader,omitempty"`
|
||||||
ValidatorsHistory map[uint32]int `json:"validatorshistory,omitempty"`
|
ValidatorsHistory map[uint32]int `json:"validatorshistory,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// versionUnmarshallerAux is an auxiliary struct used for Version JSON unmarshalling.
|
|
||||||
versionUnmarshallerAux struct {
|
|
||||||
Magic netmode.Magic `json:"network"`
|
|
||||||
TCPPort uint16 `json:"tcpport"`
|
|
||||||
WSPort uint16 `json:"wsport,omitempty"`
|
|
||||||
Nonce uint32 `json:"nonce"`
|
|
||||||
UserAgent string `json:"useragent"`
|
|
||||||
Protocol protocolUnmarshallerAux `json:"protocol"`
|
|
||||||
StateRootInHeader bool `json:"staterootinheader,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// protocolUnmarshallerAux is an auxiliary struct used for Protocol JSON unmarshalling.
|
|
||||||
protocolUnmarshallerAux struct {
|
|
||||||
AddressVersion byte `json:"addressversion"`
|
|
||||||
Network netmode.Magic `json:"network"`
|
|
||||||
MillisecondsPerBlock int `json:"msperblock"`
|
|
||||||
MaxTraceableBlocks uint32 `json:"maxtraceableblocks"`
|
|
||||||
MaxValidUntilBlockIncrement uint32 `json:"maxvaliduntilblockincrement"`
|
|
||||||
MaxTransactionsPerBlock uint16 `json:"maxtransactionsperblock"`
|
|
||||||
MemoryPoolMaxTransactions int `json:"memorypoolmaxtransactions"`
|
|
||||||
ValidatorsCount byte `json:"validatorscount"`
|
|
||||||
InitialGasDistribution json.RawMessage `json:"initialgasdistribution"`
|
|
||||||
|
|
||||||
CommitteeHistory map[uint32]int `json:"committeehistory,omitempty"`
|
|
||||||
P2PSigExtensions bool `json:"p2psigextensions,omitempty"`
|
|
||||||
StateRootInHeader bool `json:"staterootinheader,omitempty"`
|
|
||||||
ValidatorsHistory map[uint32]int `json:"validatorshistory,omitempty"`
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// latestNonBreakingVersion is a latest NeoGo revision that keeps older RPC
|
// MarshalJSON implements the JSON marshaler interface.
|
||||||
// clients compatibility with newer RPC servers (https://github.com/nspcc-dev/neo-go/pull/2435).
|
func (p Protocol) MarshalJSON() ([]byte, error) {
|
||||||
var latestNonBreakingVersion = *semver.New("0.98.5")
|
aux := protocolMarshallerAux{
|
||||||
|
AddressVersion: p.AddressVersion,
|
||||||
|
Network: p.Network,
|
||||||
|
MillisecondsPerBlock: p.MillisecondsPerBlock,
|
||||||
|
MaxTraceableBlocks: p.MaxTraceableBlocks,
|
||||||
|
MaxValidUntilBlockIncrement: p.MaxValidUntilBlockIncrement,
|
||||||
|
MaxTransactionsPerBlock: p.MaxTransactionsPerBlock,
|
||||||
|
MemoryPoolMaxTransactions: p.MemoryPoolMaxTransactions,
|
||||||
|
ValidatorsCount: p.ValidatorsCount,
|
||||||
|
InitialGasDistribution: int64(p.InitialGasDistribution),
|
||||||
|
|
||||||
// MarshalJSON implements the json marshaller interface.
|
CommitteeHistory: p.CommitteeHistory,
|
||||||
func (v *Version) MarshalJSON() ([]byte, error) {
|
P2PSigExtensions: p.P2PSigExtensions,
|
||||||
aux := versionMarshallerAux{
|
StateRootInHeader: p.StateRootInHeader,
|
||||||
Magic: v.Magic,
|
ValidatorsHistory: p.ValidatorsHistory,
|
||||||
TCPPort: v.TCPPort,
|
|
||||||
WSPort: v.WSPort,
|
|
||||||
Nonce: v.Nonce,
|
|
||||||
UserAgent: v.UserAgent,
|
|
||||||
Protocol: protocolMarshallerAux{
|
|
||||||
AddressVersion: v.Protocol.AddressVersion,
|
|
||||||
Network: v.Protocol.Network,
|
|
||||||
MillisecondsPerBlock: v.Protocol.MillisecondsPerBlock,
|
|
||||||
MaxTraceableBlocks: v.Protocol.MaxTraceableBlocks,
|
|
||||||
MaxValidUntilBlockIncrement: v.Protocol.MaxValidUntilBlockIncrement,
|
|
||||||
MaxTransactionsPerBlock: v.Protocol.MaxTransactionsPerBlock,
|
|
||||||
MemoryPoolMaxTransactions: v.Protocol.MemoryPoolMaxTransactions,
|
|
||||||
ValidatorsCount: v.Protocol.ValidatorsCount,
|
|
||||||
InitialGasDistribution: int64(v.Protocol.InitialGasDistribution),
|
|
||||||
|
|
||||||
CommitteeHistory: v.Protocol.CommitteeHistory,
|
|
||||||
P2PSigExtensions: v.Protocol.P2PSigExtensions,
|
|
||||||
StateRootInHeader: v.Protocol.StateRootInHeader,
|
|
||||||
ValidatorsHistory: v.Protocol.ValidatorsHistory,
|
|
||||||
},
|
|
||||||
StateRootInHeader: v.StateRootInHeader,
|
|
||||||
}
|
}
|
||||||
return json.Marshal(aux)
|
return json.Marshal(aux)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON implements the json unmarshaller interface.
|
// UnmarshalJSON implements the JSON unmarshaler interface.
|
||||||
func (v *Version) UnmarshalJSON(data []byte) error {
|
func (p *Protocol) UnmarshalJSON(data []byte) error {
|
||||||
var aux versionUnmarshallerAux
|
var aux protocolMarshallerAux
|
||||||
err := json.Unmarshal(data, &aux)
|
err := json.Unmarshal(data, &aux)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.Magic = aux.Magic
|
p.AddressVersion = aux.AddressVersion
|
||||||
v.TCPPort = aux.TCPPort
|
p.Network = aux.Network
|
||||||
v.WSPort = aux.WSPort
|
p.MillisecondsPerBlock = aux.MillisecondsPerBlock
|
||||||
v.Nonce = aux.Nonce
|
p.MaxTraceableBlocks = aux.MaxTraceableBlocks
|
||||||
v.UserAgent = aux.UserAgent
|
p.MaxValidUntilBlockIncrement = aux.MaxValidUntilBlockIncrement
|
||||||
v.Protocol.AddressVersion = aux.Protocol.AddressVersion
|
p.MaxTransactionsPerBlock = aux.MaxTransactionsPerBlock
|
||||||
v.Protocol.Network = aux.Protocol.Network
|
p.MemoryPoolMaxTransactions = aux.MemoryPoolMaxTransactions
|
||||||
v.Protocol.MillisecondsPerBlock = aux.Protocol.MillisecondsPerBlock
|
p.ValidatorsCount = aux.ValidatorsCount
|
||||||
v.Protocol.MaxTraceableBlocks = aux.Protocol.MaxTraceableBlocks
|
p.CommitteeHistory = aux.CommitteeHistory
|
||||||
v.Protocol.MaxValidUntilBlockIncrement = aux.Protocol.MaxValidUntilBlockIncrement
|
p.P2PSigExtensions = aux.P2PSigExtensions
|
||||||
v.Protocol.MaxTransactionsPerBlock = aux.Protocol.MaxTransactionsPerBlock
|
p.StateRootInHeader = aux.StateRootInHeader
|
||||||
v.Protocol.MemoryPoolMaxTransactions = aux.Protocol.MemoryPoolMaxTransactions
|
p.ValidatorsHistory = aux.ValidatorsHistory
|
||||||
v.Protocol.ValidatorsCount = aux.Protocol.ValidatorsCount
|
p.InitialGasDistribution = fixedn.Fixed8(aux.InitialGasDistribution)
|
||||||
v.Protocol.CommitteeHistory = aux.Protocol.CommitteeHistory
|
|
||||||
v.Protocol.P2PSigExtensions = aux.Protocol.P2PSigExtensions
|
|
||||||
v.Protocol.StateRootInHeader = aux.Protocol.StateRootInHeader
|
|
||||||
v.Protocol.ValidatorsHistory = aux.Protocol.ValidatorsHistory
|
|
||||||
v.StateRootInHeader = aux.StateRootInHeader
|
|
||||||
if len(aux.Protocol.InitialGasDistribution) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if strings.HasPrefix(v.UserAgent, config.UserAgentWrapper+config.UserAgentPrefix) {
|
|
||||||
ver, err := userAgentToVersion(v.UserAgent)
|
|
||||||
if err == nil && ver.Compare(latestNonBreakingVersion) <= 0 {
|
|
||||||
err := json.Unmarshal(aux.Protocol.InitialGasDistribution, &v.Protocol.InitialGasDistribution)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("failed to unmarshal InitialGASDistribution into fixed8: %w", err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var val int64
|
|
||||||
err = json.Unmarshal(aux.Protocol.InitialGasDistribution, &val)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("failed to unmarshal InitialGASDistribution into int64: %w", err)
|
|
||||||
}
|
|
||||||
v.Protocol.InitialGasDistribution = fixedn.Fixed8(val)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func userAgentToVersion(userAgent string) (*semver.Version, error) {
|
|
||||||
verStr := strings.Trim(userAgent, config.UserAgentWrapper)
|
|
||||||
verStr = strings.TrimPrefix(verStr, config.UserAgentPrefix)
|
|
||||||
ver, err := semver.NewVersion(verStr)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("can't retrieve neo-go version from UserAgent: %w", err)
|
|
||||||
}
|
|
||||||
return ver, nil
|
|
||||||
}
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ func TestVersion_MarshalUnmarshalJSON(t *testing.T) {
|
||||||
"wsport": 10334
|
"wsport": 10334
|
||||||
}`
|
}`
|
||||||
responseFromGoNew := `{
|
responseFromGoNew := `{
|
||||||
"network": 860833102,
|
|
||||||
"nonce": 1677922561,
|
"nonce": 1677922561,
|
||||||
"protocol": {
|
"protocol": {
|
||||||
"addressversion": 53,
|
"addressversion": 53,
|
||||||
|
@ -63,7 +62,6 @@ func TestVersion_MarshalUnmarshalJSON(t *testing.T) {
|
||||||
"wsport": 10334
|
"wsport": 10334
|
||||||
}`
|
}`
|
||||||
v := &Version{
|
v := &Version{
|
||||||
Magic: 860833102,
|
|
||||||
TCPPort: 10333,
|
TCPPort: 10333,
|
||||||
WSPort: 10334,
|
WSPort: 10334,
|
||||||
Nonce: 1677922561,
|
Nonce: 1677922561,
|
||||||
|
@ -81,7 +79,6 @@ func TestVersion_MarshalUnmarshalJSON(t *testing.T) {
|
||||||
InitialGasDistribution: fixedn.Fixed8FromInt64(52000000),
|
InitialGasDistribution: fixedn.Fixed8FromInt64(52000000),
|
||||||
StateRootInHeader: false,
|
StateRootInHeader: false,
|
||||||
},
|
},
|
||||||
StateRootInHeader: false,
|
|
||||||
}
|
}
|
||||||
t.Run("MarshalJSON", func(t *testing.T) {
|
t.Run("MarshalJSON", func(t *testing.T) {
|
||||||
actual, err := json.Marshal(v)
|
actual, err := json.Marshal(v)
|
||||||
|
@ -92,11 +89,7 @@ func TestVersion_MarshalUnmarshalJSON(t *testing.T) {
|
||||||
t.Run("Go node response", func(t *testing.T) {
|
t.Run("Go node response", func(t *testing.T) {
|
||||||
t.Run("old RPC server", func(t *testing.T) {
|
t.Run("old RPC server", func(t *testing.T) {
|
||||||
actual := &Version{}
|
actual := &Version{}
|
||||||
require.NoError(t, json.Unmarshal([]byte(responseFromGoOld), actual))
|
require.Error(t, json.Unmarshal([]byte(responseFromGoOld), actual))
|
||||||
expected := new(Version)
|
|
||||||
*expected = *v
|
|
||||||
expected.UserAgent = "/NEO-GO:0.98.2/"
|
|
||||||
require.Equal(t, expected, actual)
|
|
||||||
})
|
})
|
||||||
t.Run("new RPC server", func(t *testing.T) {
|
t.Run("new RPC server", func(t *testing.T) {
|
||||||
actual := &Version{}
|
actual := &Version{}
|
||||||
|
@ -110,34 +103,7 @@ func TestVersion_MarshalUnmarshalJSON(t *testing.T) {
|
||||||
expected := new(Version)
|
expected := new(Version)
|
||||||
*expected = *v
|
*expected = *v
|
||||||
expected.UserAgent = "/Neo:3.1.0/"
|
expected.UserAgent = "/Neo:3.1.0/"
|
||||||
expected.Magic = 0 // No magic in C#.
|
|
||||||
require.Equal(t, expected, actual)
|
require.Equal(t, expected, actual)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestVersionFromUserAgent(t *testing.T) {
|
|
||||||
type testCase struct {
|
|
||||||
success bool
|
|
||||||
cmpWithBreaking int
|
|
||||||
}
|
|
||||||
var testcases = map[string]testCase{
|
|
||||||
"/Neo:3.1.0/": {success: false},
|
|
||||||
"/NEO-GO:0.98.7": {success: true, cmpWithBreaking: 1},
|
|
||||||
"/NEO-GO:0.98.7-pre-12344/": {success: true, cmpWithBreaking: 1},
|
|
||||||
"/NEO-GO:0.98.6/": {success: true, cmpWithBreaking: 1},
|
|
||||||
"/NEO-GO:0.98.6-pre-123/": {success: true, cmpWithBreaking: 1},
|
|
||||||
"/NEO-GO:0.98.5/": {success: true, cmpWithBreaking: 0},
|
|
||||||
"/NEO-GO:0.98.5-pre-12345/": {success: true, cmpWithBreaking: -1},
|
|
||||||
"/NEO-GO:123456": {success: false},
|
|
||||||
}
|
|
||||||
for str, tc := range testcases {
|
|
||||||
ver, err := userAgentToVersion(str)
|
|
||||||
if tc.success {
|
|
||||||
require.NoError(t, err)
|
|
||||||
require.Equal(t, ver.Compare(latestNonBreakingVersion), tc.cmpWithBreaking, str)
|
|
||||||
} else {
|
|
||||||
require.Error(t, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -167,10 +167,6 @@ func (c *Client) Init() error {
|
||||||
|
|
||||||
c.cache.network = version.Protocol.Network
|
c.cache.network = version.Protocol.Network
|
||||||
c.cache.stateRootInHeader = version.Protocol.StateRootInHeader
|
c.cache.stateRootInHeader = version.Protocol.StateRootInHeader
|
||||||
if version.Protocol.MillisecondsPerBlock == 0 {
|
|
||||||
c.cache.network = version.Magic
|
|
||||||
c.cache.stateRootInHeader = version.StateRootInHeader
|
|
||||||
}
|
|
||||||
for _, ctr := range natives {
|
for _, ctr := range natives {
|
||||||
c.cache.nativeHashes[ctr.Manifest.Name] = ctr.Hash
|
c.cache.nativeHashes[ctr.Manifest.Name] = ctr.Hash
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -700,11 +700,9 @@ func (s *Server) getVersion(_ params.Params) (interface{}, *neorpc.Error) {
|
||||||
|
|
||||||
cfg := s.chain.GetConfig()
|
cfg := s.chain.GetConfig()
|
||||||
return &result.Version{
|
return &result.Version{
|
||||||
Magic: s.network,
|
TCPPort: port,
|
||||||
TCPPort: port,
|
Nonce: s.coreServer.ID(),
|
||||||
Nonce: s.coreServer.ID(),
|
UserAgent: s.coreServer.UserAgent,
|
||||||
UserAgent: s.coreServer.UserAgent,
|
|
||||||
StateRootInHeader: cfg.StateRootInHeader,
|
|
||||||
Protocol: result.Protocol{
|
Protocol: result.Protocol{
|
||||||
AddressVersion: address.NEO3Prefix,
|
AddressVersion: address.NEO3Prefix,
|
||||||
Network: cfg.Magic,
|
Network: cfg.Magic,
|
||||||
|
|
Loading…
Reference in a new issue