diff --git a/ingest/README.md b/ingest/README.md index cf3d38f8da..277807f978 100644 --- a/ingest/README.md +++ b/ingest/README.md @@ -67,15 +67,15 @@ func main() { _(The `panicIf` function is defined in the [footnotes](#footnotes); it's used here for error-checking brevity.)_ -Notice that the mysterious `config` variable above isn't defined. This will be environment-specific and users should consult both the [Captive Core documentation](../../services/horizon/internal/docs/captive_core.md) and the [config docs](./ledgerbackend/captive_core_backend.go#L96-L125) directly for more details if they want to use this backend in production. For now, though, we'll have some hardcoded values for the SDF testnet: +Notice that the mysterious `config` variable above isn't defined. This will be environment-specific and refer to the code [here](./ledgerbackend/captive_core_backend.go) for the complete list of configuration parameters. For now, we'll use the [default](../network/main.go) values defined for the SDF testnet: ```go -networkPassphrase := "Test SDF Network ; September 2015" +archiveURLs := network.TestNetworkhistoryArchiveURLs +networkPassphrase := network.TestNetworkPassphrase captiveCoreToml, err := ledgerbackend.NewCaptiveCoreToml( ledgerbackend.CaptiveCoreTomlParams{ NetworkPassphrase: networkPassphrase, - HistoryArchiveURLs: []string{ - "https://history.stellar.org/prd/core-testnet/core_testnet_001", + HistoryArchiveURLs: archiveURLs, }, }) panicIf(err) @@ -258,7 +258,7 @@ As of this writing, the stats are as follows: - total operations: 33845 - succeeded / failed: 25387 / 8458 -The full, runnable example is available [here](./example_statistics.go). +The full, runnable example is available [here](./tutorial/example_statistics.go). # **Example**: Feature Popularity @@ -392,4 +392,4 @@ func panicIf(err error) { 2. Since the Stellar testnet undergoes periodic resets, the example outputs from various sections (especially regarding network statistics) will not always be accurate. - 3. It's worth noting that even though the [second example](example-tracking-feature-popularity) could *also* be done by using the `LedgerTransactionReader` and inspecting the individual operations, that'd be bit redundant as far as examples go. + 3. It's worth noting that even though the [second example](#example-feature-popularity) could *also* be done by using the `LedgerTransactionReader` and inspecting the individual operations, that'd be bit redundant as far as examples go. diff --git a/ingest/doc.go b/ingest/doc.go index d7fa6ebc95..e4360b9acc 100644 --- a/ingest/doc.go +++ b/ingest/doc.go @@ -8,8 +8,7 @@ possible features. This is why this package was created. # Ledger Backend Ledger backends are sources of information about Stellar network ledgers. This -can be, for example: a Stellar-Core database, (possibly-remote) Captive -Stellar-Core instances, or History Archives. Please consult the "ledgerbackend" +can be, for example: Captive Stellar-Core instances. Please consult the "ledgerbackend" package docs for more information about each backend. Warning: Ledger backends provide low-level xdr.LedgerCloseMeta that should not diff --git a/ingest/tutorial/example_common.go b/ingest/tutorial/example_common.go index 133ac02de6..aaeb14d447 100644 --- a/ingest/tutorial/example_common.go +++ b/ingest/tutorial/example_common.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/stellar/go/ingest/ledgerbackend" + "github.com/stellar/go/network" ) var ( @@ -11,12 +12,8 @@ var ( ) func captiveCoreConfig() ledgerbackend.CaptiveCoreConfig { - archiveURLs := []string{ - "https://history.stellar.org/prd/core-testnet/core_testnet_001", - "https://history.stellar.org/prd/core-testnet/core_testnet_002", - "https://history.stellar.org/prd/core-testnet/core_testnet_003", - } - networkPassphrase := "Test SDF Network ; September 2015" + archiveURLs := network.TestNetworkhistoryArchiveURLs + networkPassphrase := network.TestNetworkPassphrase captiveCoreToml, err := ledgerbackend.NewCaptiveCoreToml(ledgerbackend.CaptiveCoreTomlParams{ NetworkPassphrase: networkPassphrase, HistoryArchiveURLs: archiveURLs,