Skip to content

Commit

Permalink
feat: remove unused configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszos4chain committed Dec 19, 2024
1 parent 9ef666b commit 22404d4
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 118 deletions.
16 changes: 0 additions & 16 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type ArcConfig struct {
MessageQueue *MessageQueueConfig `mapstructure:"messageQueue"`
Tracing *TracingConfig `mapstructure:"tracing"`
PeerRPC *PeerRPCConfig `mapstructure:"peerRpc"`
Broadcasting *BroadcastingConfig `mapstructure:"broadcasting"`
Metamorph *MetamorphConfig `mapstructure:"metamorph"`
Blocktx *BlocktxConfig `mapstructure:"blocktx"`
API *APIConfig `mapstructure:"api"`
Expand All @@ -41,21 +40,6 @@ func (p *PrometheusConfig) IsEnabled() bool {
return p.Enabled && p.Addr != "" && p.Endpoint != ""
}

type BroadcastingConfig struct {
Mode string `mapstructure:"mode"`
Multicast *Mulsticast `mapstructure:"multicast"`
Unicast *Unicast `mapstructure:"unicast"`
}

type Unicast struct {
Peers []*PeerConfig `mapstructure:"peers"`
}
type Mulsticast struct {
Ipv6Enabled bool `mapstructure:"ipv6Enabled"`
MulticastGroups []*string `mapstructure:"multicastGroups"`
Interfaces []*string `mapstructure:"interfaces"`
}

type PeerConfig struct {
Host string `mapstructure:"host"`
Port *PeerPortConfig `mapstructure:"port"`
Expand Down
35 changes: 0 additions & 35 deletions config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ func getDefaultArcConfig() *ArcConfig {
MessageQueue: getDefaultMessageQueueConfig(),
Tracing: getDefaultTracingConfig(),
PeerRPC: getDefaultPeerRPCConfig(),
Broadcasting: getBroadcastingConfig(),
Metamorph: getMetamorphConfig(),
Blocktx: getBlocktxConfig(),
API: getAPIConfig(),
Expand Down Expand Up @@ -54,40 +53,6 @@ func getDefaultPeerRPCConfig() *PeerRPCConfig {
}
}

func getBroadcastingConfig() *BroadcastingConfig {
return &BroadcastingConfig{
Mode: "unicast",
Unicast: &Unicast{
Peers: []*PeerConfig{
{
Host: "localhost",
Port: &PeerPortConfig{
P2P: 18333,
ZMQ: 28332,
},
},
{
Host: "localhost",
Port: &PeerPortConfig{
P2P: 18334,
},
},
{
Host: "localhost",
Port: &PeerPortConfig{
P2P: 18335,
},
},
},
},
Multicast: &Mulsticast{
Ipv6Enabled: false,
MulticastGroups: nil,
Interfaces: nil,
},
}
}

func getMetamorphConfig() *MetamorphConfig {
return &MetamorphConfig{
ListenAddr: "localhost:8001",
Expand Down
22 changes: 0 additions & 22 deletions config/example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,6 @@ peerRpc: # rpc configuration for bitcoin node
host: localhost
port: 18332

broadcasting: # settings for connection to nodes
mode: unicast # one of unicast | multicast
multicast:
ipv6Enabled: true # indicates whether ipv6 is enabled for multicasting
multicastGroups: # must be specified if mode = multicast
- "172.28.56.77" # address of multicast group, needs to be ipv6 address if ipv6 is enabled
interfaces:
- "eth0"
- "eth1"
unicast:
peers: # list of bitcoin node peers to connect to
- host: localhost
port:
p2p: 18333 # port for p2p connection
zmq: 28332 # port for zmq connection
- host: localhost
port:
p2p: 18334
- host: localhost
port:
p2p: 18335

cache:
engine: redis # cache engine - one of in-memory | redis
redis: # redis cache configuration in case that engine: redis
Expand Down
6 changes: 0 additions & 6 deletions config/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ func Test_Load(t *testing.T) {
assert.Equal(t, "INFO", actualConfig.LogLevel)
assert.Equal(t, "text", actualConfig.LogFormat)
assert.Equal(t, "mainnet", actualConfig.Network)
assert.Equal(t, 18335, actualConfig.Broadcasting.Unicast.Peers[2].Port.P2P)
assert.Equal(t, "172.28.56.77", *actualConfig.Broadcasting.Multicast.MulticastGroups[0])
assert.Equal(t, true, actualConfig.Broadcasting.Multicast.Ipv6Enabled)
assert.Equal(t, "unicast", actualConfig.Broadcasting.Mode)
assert.Equal(t, "eth1", *actualConfig.Broadcasting.Multicast.Interfaces[1])
assert.Equal(t, 18335, actualConfig.Broadcasting.Unicast.Peers[2].Port.P2P)
assert.NotNil(t, actualConfig.Tracing)
assert.Equal(t, "http://tracing:1234", actualConfig.Tracing.DialAddr)
})
Expand Down
21 changes: 0 additions & 21 deletions config/test_files/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,3 @@ network: mainnet
tracing:
dialAddr: http://tracing:1234
sample: 10 # sampling in percentage
broadcasting: # settings for connection to nodes
mode: unicast # one of unicast | multicast
multicast:
ipv6Enabled: true # indicates whether ipv6 is enabled for multicasting
multicastGroups: # must be specified if mode = multicast
- "172.28.56.77" # address of multicast group, needs to be ipv6 address if ipv6 is enabled
interfaces:
- "eth0"
- "eth1"
unicast:
peers: # list of bitcoin node peers to connect to
- host: localhost
port:
p2p: 18333 # port for p2p connection
zmq: 28332 # port for zmq connection
- host: localhost
port:
p2p: 18334
- host: localhost
port:
p2p: 18335
18 changes: 0 additions & 18 deletions test/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ prometheus:
endpoint: /metrics
addr: :2112
grpcMessageSize: 100000000
network: regtest
messageQueue:
streaming:
enabled: true
Expand All @@ -24,23 +23,6 @@ peerRpc:
host: node1
port: 18332

broadcasting:
mode: unicast
unicast:
peers:
- host: node1
port:
p2p: 18333
zmq: 28332
- host: node2
port:
p2p: 18333
zmq: 28332
- host: node3
port:
p2p: 18333
zmq: 28332

cache:
engine: redis
redis:
Expand Down

0 comments on commit 22404d4

Please sign in to comment.