Skip to content

Commit

Permalink
stellar#4483: enable captive core use db
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Jul 29, 2022
1 parent 2cc3a3d commit b1589f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion exp/services/ledgerexporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func main() {
continueFromLatestLedger := flag.Bool("continue", false, "start export from the last exported ledger (as indicated in the target's /latest path)")
endingLedger := flag.Uint("end-ledger", 0, "ledger at which to stop the export (must be a closed ledger), 0 means no ending")
writeLatestPath := flag.Bool("write-latest-path", true, "update the value of the /latest path on the target")
captiveCoreUseDb := flag.Bool("captive-core-use-db", true, "configure captive core to store database on disk in working directory rather than in memory")
flag.Parse()

logger.SetLevel(supportlog.InfoLevel)
Expand All @@ -51,6 +52,7 @@ func main() {
CheckpointFrequency: 64,
Log: logger.WithField("subservice", "stellar-core"),
Toml: captiveCoreToml,
UseDB: *captiveCoreUseDb,
}
core, err := ledgerbackend.NewCaptive(captiveConfig)
logFatalIf(err, "Could not create captive core instance")
Expand Down Expand Up @@ -91,7 +93,7 @@ func main() {
err = core.PrepareRange(context.Background(), ledgerRange)
logFatalIf(err, "could not prepare range")

for nextLedger := startLedger; nextLedger <= endLedger; {
for nextLedger := startLedger; endLedger < 1 || nextLedger <= endLedger; {
ledger, err := core.GetLedger(context.Background(), nextLedger)
if err != nil {
logger.WithError(err).Warnf("could not fetch ledger %v, retrying", nextLedger)
Expand Down
1 change: 0 additions & 1 deletion historyarchive/s3_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func (b *S3ArchiveBackend) PutFile(pth string, in io.ReadCloser) error {
params := &s3.PutObjectInput{
Bucket: aws.String(b.bucket),
Key: aws.String(key),
ACL: aws.String(s3.ObjectCannedACLPublicRead),
Body: bytes.NewReader(buf.Bytes()),
}
req, _ := b.svc.PutObjectRequest(params)
Expand Down
2 changes: 1 addition & 1 deletion services/horizon/docker/ledgerexporter/start
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONTINUE="${CONTINUE:=false}"
WRITE_LATEST_PATH="${WRITE_LATEST_PATH:=false}"
NETWORK_PASSPHRASE="${NETWORK_PASSPHRASE:=Public Global Stellar Network ; September 2015}"
HISTORY_ARCHIVE_URLS="${HISTORY_ARCHIVE_URLS:=https://s3-eu-west-1.amazonaws.com/history.stellar.org/prd/core-live/core_live_001}"
CAPTIVE_CORE_CONFIG="/captive-core-pubnet.cfg"
CAPTIVE_CORE_CONFIG="${CAPTIVE_CORE_CONFIG:=/captive-core-pubnet.cfg}"

if [ -z "$ARCHIVE_TARGET" ]; then
echo "error: undefined ARCHIVE_TARGET env variable"
Expand Down

0 comments on commit b1589f0

Please sign in to comment.