@@ -112,6 +112,12 @@ type SmartnodeConfig struct {
112112 // Threshold for automatic vote power initialization transactions
113113 AutoInitVPThreshold config.Parameter `yaml:"autoInitVPThreshold,omitempty"`
114114
115+ // Port for the node's webserver
116+ APIPort config.Parameter `yaml:"apiPort,omitempty"`
117+
118+ // Whether to expose the node's API port to the local network
119+ OpenAPIPort config.Parameter `yaml:"openAPIPort,omitempty"`
120+
115121 ///////////////////////////
116122 // Non-editable settings //
117123 ///////////////////////////
@@ -413,6 +419,29 @@ func NewSmartnodeConfig(cfg *RocketPoolConfig) *SmartnodeConfig {
413419 OverwriteOnUpgrade : true ,
414420 },
415421
422+ APIPort : config.Parameter {
423+ ID : "apiPort" ,
424+ Name : "API Port" ,
425+ Description : "The port your Smartnode's API should listen on." ,
426+ Type : config .ParameterType_Uint16 ,
427+ Default : map [config.Network ]interface {}{config .Network_All : uint16 (8280 )},
428+ AffectsContainers : []config.ContainerID {config .ContainerID_Node },
429+ CanBeBlank : false ,
430+ OverwriteOnUpgrade : false ,
431+ },
432+
433+ OpenAPIPort : config.Parameter {
434+ ID : "openAPIPort" ,
435+ Name : "Expose API Port" ,
436+ Description : "Expose the API port to other processes on your machine. For security reasons, you cannot expose the API port except to localhost. It is recommended to keep this CLOSED." ,
437+ Type : config .ParameterType_Choice ,
438+ Default : map [config.Network ]interface {}{config .Network_All : config .RPC_Closed },
439+ AffectsContainers : []config.ContainerID {config .ContainerID_Node },
440+ CanBeBlank : false ,
441+ OverwriteOnUpgrade : false ,
442+ Options : config .RestrictedPortModes (),
443+ },
444+
416445 txWatchUrl : map [config.Network ]string {
417446 config .Network_Mainnet : "https://etherscan.io/tx" ,
418447 config .Network_Devnet : "https://hoodi.etherscan.io/tx" ,
@@ -635,6 +664,8 @@ func (cfg *SmartnodeConfig) GetParameters() []*config.Parameter {
635664 & cfg .ArchiveECUrl ,
636665 & cfg .WatchtowerMaxFeeOverride ,
637666 & cfg .WatchtowerPrioFeeOverride ,
667+ & cfg .APIPort ,
668+ & cfg .OpenAPIPort ,
638669 }
639670}
640671
0 commit comments