-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: submitter/send sealed checkpoints to BTC #37
Changes from all commits
790c1bb
1d87382
e34548e
918443f
e834def
02ec4a6
bdf4695
50c2a8d
576d1b1
732ccc2
7b55118
bc48954
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[url "ssh://[email protected]/"] | ||
insteadOf = https://github.com/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,7 @@ | |
# vendor/ | ||
|
||
.vscode/ | ||
main | ||
.idea/ | ||
.testnet/ | ||
.DS_Store | ||
main |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,38 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/babylonchain/babylon/btctxformatter" | ||
"github.com/babylonchain/vigilante/netparams" | ||
) | ||
|
||
const ( | ||
DefaultCheckpointCacheMaxEntries = 100 | ||
DefaultPollingFrequency = 60 // in seconds | ||
) | ||
|
||
// SubmitterConfig defines configuration for the gRPC-web server. | ||
type SubmitterConfig struct { | ||
NetParams string `mapstructure:"netparams"` // should be mainnet|testnet|simnet | ||
NetParams string `mapstructure:"netparams"` // should be mainnet|testnet|simnet | ||
BufferSize uint `mapstructure:"buffer-size"` // buffer for raw checkpoints | ||
PollingFrequency uint `mapstructure:"polling-frequency"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "frequency" is probably not the right word here. The unit of frequency is normally 1/s, so a default of 60 would mean 60 times per second. Maybe "polling-interval", and if it's numeric, unlike the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. Thanks. Will change this in the next PR. |
||
} | ||
|
||
func (cfg *SubmitterConfig) Validate() error { | ||
return nil | ||
} | ||
|
||
func (cfg *SubmitterConfig) GetTag() btctxformatter.BabylonTag { | ||
return netparams.GetBabylonParams(cfg.NetParams).Tag | ||
} | ||
|
||
func (cfg *SubmitterConfig) GetVersion() btctxformatter.FormatVersion { | ||
return netparams.GetBabylonParams(cfg.NetParams).Version | ||
} | ||
|
||
func DefaultSubmitterConfig() SubmitterConfig { | ||
return SubmitterConfig{ | ||
NetParams: "simnet", | ||
NetParams: "simnet", | ||
BufferSize: DefaultCheckpointCacheMaxEntries, | ||
PollingFrequency: DefaultPollingFrequency, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case maybe the
DefaultBabylonConfig
could have this as a parameter, to make sure it's not forgotten. The example could be on the CLI arg or in the config file as a docstring. Or the Babylon devnet/local testnet config could give some funds to this account in its genesis file.But at least the comment helps warn about it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the advice! I marked it as issue #49 as a reminder.