File tree Expand file tree Collapse file tree 4 files changed +7
-18
lines changed Expand file tree Collapse file tree 4 files changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import (
30
30
"github.com/SundaeSwap-finance/kugo"
31
31
"github.com/SundaeSwap-finance/ogmigo/v6/ouroboros/chainsync"
32
32
"github.com/blinklabs-io/adder/event"
33
+ "github.com/blinklabs-io/adder/internal/config"
33
34
"github.com/blinklabs-io/adder/internal/logging"
34
35
"github.com/blinklabs-io/adder/plugin"
35
36
ouroboros "github.com/blinklabs-io/gouroboros"
@@ -97,6 +98,8 @@ func New(options ...ChainSyncOptionFunc) *ChainSync {
97
98
intersectPoints : []ocommon.Point {},
98
99
status : & ChainSyncStatus {},
99
100
}
101
+ // Use Kupo URL from global config
102
+ c .kupoUrl = config .GetConfig ().KupoUrl
100
103
for _ , option := range options {
101
104
option (c )
102
105
}
Original file line number Diff line number Diff line change @@ -108,13 +108,6 @@ func WithBulkMode(bulkMode bool) ChainSyncOptionFunc {
108
108
return func (c * ChainSync ) {}
109
109
}
110
110
111
- // WithKupoUrl specifies the URL for a Kupo instance that will be queried for additional information
112
- func WithKupoUrl (kupoUrl string ) ChainSyncOptionFunc {
113
- return func (c * ChainSync ) {
114
- c .kupoUrl = kupoUrl
115
- }
116
- }
117
-
118
111
// WithDelayConfirmationCount specifies the number of confirmations (subsequent blocks) are required before an event will be emitted
119
112
func WithDelayConfirmations (count uint ) ChainSyncOptionFunc {
120
113
return func (c * ChainSync ) {
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ var cmdlineOptions struct {
35
35
intersectPoint string
36
36
includeCbor bool
37
37
autoReconnect bool
38
- kupoUrl string
39
38
delayConfirmations uint
40
39
}
41
40
@@ -112,13 +111,6 @@ func init() {
112
111
DefaultValue : true ,
113
112
Dest : & (cmdlineOptions .autoReconnect ),
114
113
},
115
- {
116
- Name : "kupo-url" ,
117
- Type : plugin .PluginOptionTypeString ,
118
- Description : "kupo-url address" ,
119
- DefaultValue : "" ,
120
- Dest : & (cmdlineOptions .kupoUrl ),
121
- },
122
114
{
123
115
Name : "delay-confirmations" ,
124
116
Type : plugin .PluginOptionTypeUint ,
@@ -149,7 +141,6 @@ func NewFromCmdlineOptions() plugin.Plugin {
149
141
WithNtcTcp (cmdlineOptions .ntcTcp ),
150
142
WithIncludeCbor (cmdlineOptions .includeCbor ),
151
143
WithAutoReconnect (cmdlineOptions .autoReconnect ),
152
- WithKupoUrl (cmdlineOptions .kupoUrl ),
153
144
WithDelayConfirmations (cmdlineOptions .delayConfirmations ),
154
145
}
155
146
if cmdlineOptions .intersectPoint != "" {
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ type Config struct {
38
38
Input string `yaml:"input" envconfig:"INPUT"`
39
39
Output string `yaml:"output" envconfig:"OUTPUT"`
40
40
Plugin map [string ]map [string ]map [any ]any `yaml:"plugins"`
41
+ KupoUrl string `yaml:"kupo_url" envconfig:"KUPO_URL"`
41
42
}
42
43
43
44
type ApiConfig struct {
@@ -67,8 +68,9 @@ var globalConfig = &Config{
67
68
ListenAddress : "localhost" ,
68
69
ListenPort : 0 ,
69
70
},
70
- Input : DefaultInputPlugin ,
71
- Output : DefaultOutputPlugin ,
71
+ Input : DefaultInputPlugin ,
72
+ Output : DefaultOutputPlugin ,
73
+ KupoUrl : "" ,
72
74
}
73
75
74
76
func (c * Config ) Load (configFile string ) error {
You can’t perform that action at this time.
0 commit comments