-
Notifications
You must be signed in to change notification settings - Fork 1
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
services: rpc payment ingestor #47
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,27 +22,11 @@ func (c *ingestCmd) Command() *cobra.Command { | |
cfgOpts := config.ConfigOptions{ | ||
utils.DatabaseURLOption(&cfg.DatabaseURL), | ||
utils.LogLevelOption(&cfg.LogLevel), | ||
utils.NetworkPassphraseOption(&cfg.NetworkPassphrase), | ||
utils.SentryDSNOption(&sentryDSN), | ||
utils.StellarEnvironmentOption(&stellarEnvironment), | ||
{ | ||
Name: "captive-core-bin-path", | ||
Usage: "Path to Captive Core's binary file.", | ||
OptType: types.String, | ||
CustomSetValue: utils.SetConfigOptionCaptiveCoreBinPath, | ||
ConfigKey: &cfg.CaptiveCoreBinPath, | ||
FlagDefault: "/usr/local/bin/stellar-core", | ||
Required: true, | ||
}, | ||
{ | ||
Name: "captive-core-config-dir", | ||
Usage: "Path to Captive Core's configuration files directory.", | ||
OptType: types.String, | ||
CustomSetValue: utils.SetConfigOptionCaptiveCoreConfigDir, | ||
ConfigKey: &cfg.CaptiveCoreConfigDir, | ||
FlagDefault: "./internal/ingest/config", | ||
Required: true, | ||
}, | ||
utils.RPCURLOption(&cfg.RPCURL), | ||
utils.StartLedgerOption(&cfg.StartLedger), | ||
utils.EndLedgerOption(&cfg.EndLedger), | ||
{ | ||
Name: "ledger-cursor-name", | ||
Usage: "Name of last synced ledger cursor, used to keep track of the last ledger ingested by the service. When starting up, ingestion will resume from the ledger number stored in this record. It should be an unique name per container as different containers would overwrite the cursor value of its peers when using the same cursor name.", | ||
|
@@ -59,20 +43,13 @@ func (c *ingestCmd) Command() *cobra.Command { | |
FlagDefault: 0, | ||
Required: false, | ||
}, | ||
{ | ||
Name: "end", | ||
Usage: "Ledger number up to which ingestion should run. When not present, ingestion run indefinitely (live ingestion requires it to be empty).", | ||
OptType: types.Int, | ||
ConfigKey: &cfg.EndLedger, | ||
FlagDefault: 0, | ||
Required: false, | ||
}, | ||
} | ||
|
||
cmd := &cobra.Command{ | ||
Use: "ingest", | ||
Short: "Run Ingestion service", | ||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error { | ||
// SET UP WEBHOOK CHANNEL HERE | ||
if err := cfgOpts.RequireE(); err != nil { | ||
return fmt.Errorf("requiring values of config options: %w", err) | ||
} | ||
|
@@ -89,6 +66,8 @@ func (c *ingestCmd) Command() *cobra.Command { | |
RunE: func(_ *cobra.Command, _ []string) error { | ||
return c.Run(cfg) | ||
}, | ||
PersistentPostRun: func(_ *cobra.Command, _ []string) { | ||
}, | ||
Comment on lines
+69
to
+70
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. Why do we need this? |
||
} | ||
|
||
if err := cfgOpts.Init(cmd); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,41 @@ func DistributionAccountSignatureClientProviderOption(configKey *signing.Signatu | |
} | ||
} | ||
|
||
func RPCURLOption(configKey *string) *config.ConfigOption { | ||
return &config.ConfigOption{ | ||
Name: "rpc-url", | ||
Usage: "The URL of the RPC Server.", | ||
OptType: types.String, | ||
ConfigKey: configKey, | ||
FlagDefault: "localhost:8080", | ||
Required: true, | ||
} | ||
} | ||
Comment on lines
+134
to
+143
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. What do you think about validating if the value passed here is a URL using the |
||
|
||
func StartLedgerOption(configKey *int) *config.ConfigOption { | ||
return &config.ConfigOption{ | ||
Name: "start-ledger", | ||
Usage: "ledger number to start getting transactions from", | ||
OptType: types.Int, | ||
ConfigKey: configKey, | ||
FlagDefault: 0, | ||
Required: true, | ||
} | ||
|
||
} | ||
|
||
func EndLedgerOption(configKey *int) *config.ConfigOption { | ||
return &config.ConfigOption{ | ||
Name: "end-ledger", | ||
Usage: "ledger number to end on", | ||
OptType: types.Int, | ||
ConfigKey: configKey, | ||
FlagDefault: 0, | ||
Required: true, | ||
} | ||
|
||
} | ||
|
||
func AWSOptions(awsRegionConfigKey *string, kmsKeyARN *string, required bool) config.ConfigOptions { | ||
awsOpts := config.ConfigOptions{ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this a
TODO
?