Skip to content

Commit 44eea62

Browse files
committed
Add config field and node info filed for direct RPC server
1 parent 46972db commit 44eea62

3 files changed

Lines changed: 38 additions & 29 deletions

File tree

conf/config.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@ type Config struct {
112112
StartupSyncHoles bool `yaml:"StartupSyncHoles,omitempty"`
113113
GenerateKeyPair bool `yaml:"-"`
114114
//TODO(auxten): set yaml key for config
115-
WorkingRoot string `yaml:"WorkingRoot"`
116-
PubKeyStoreFile string `yaml:"PubKeyStoreFile"`
117-
PrivateKeyFile string `yaml:"PrivateKeyFile"`
118-
DHTFileName string `yaml:"DHTFileName"`
119-
ListenAddr string `yaml:"ListenAddr"`
120-
ThisNodeID proto.NodeID `yaml:"ThisNodeID"`
121-
ValidDNSKeys map[string]string `yaml:"ValidDNSKeys"` // map[DNSKEY]domain
115+
WorkingRoot string `yaml:"WorkingRoot"`
116+
PubKeyStoreFile string `yaml:"PubKeyStoreFile"`
117+
PrivateKeyFile string `yaml:"PrivateKeyFile"`
118+
DHTFileName string `yaml:"DHTFileName"`
119+
ListenAddr string `yaml:"ListenAddr"`
120+
ListenDirectAddr string `yaml:"ListenDirectAddr",omitempty`
121+
ThisNodeID proto.NodeID `yaml:"ThisNodeID"`
122+
ValidDNSKeys map[string]string `yaml:"ValidDNSKeys"` // map[DNSKEY]domain
122123
// Check By BP DHT.Ping
123124
MinNodeIDDifficulty int `yaml:"MinNodeIDDifficulty"`
124125

proto/nodeinfo.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ func (k *NodeKey) Less(y *NodeKey) bool {
111111

112112
// Node is all node info struct.
113113
type Node struct {
114-
ID NodeID `yaml:"ID"`
115-
Role ServerRole `yaml:"Role"`
116-
Addr string `yaml:"Addr"`
117-
PublicKey *asymmetric.PublicKey `yaml:"PublicKey"`
118-
Nonce mine.Uint256 `yaml:"Nonce"`
114+
ID NodeID `yaml:"ID"`
115+
Role ServerRole `yaml:"Role"`
116+
Addr string `yaml:"Addr"`
117+
DirectAddr string `yaml:"DirectAddr",omitempty`
118+
PublicKey *asymmetric.PublicKey `yaml:"PublicKey"`
119+
Nonce mine.Uint256 `yaml:"Nonce"`
119120
}
120121

121122
// NewNode just return a new node struct.

proto/nodeinfo_gen.go

Lines changed: 24 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)