@@ -109,10 +109,6 @@ func main() {
109109 Params: map [string ]string {
110110 " destination_bucket_path" : " your-gcs-bucket/data" , // Replace with actual GCS bucket path
111111 },
112- Schema: datastore.DataStoreSchema {
113- LedgersPerFile: 1 , // Defines how many ledgers per file
114- FilesPerPartition: 64000 , // Defines partition size
115- },
116112 }
117113
118114 // Initialize the datastore
@@ -130,8 +126,15 @@ func main() {
130126 RetryWait: 5 * time.Second , // Wait time between retries
131127 }
132128
129+ // Per SEP-54 (https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0054.md),
130+ // the schema is stored in the datastore; LoadSchema retrieves it.
131+ schema , err := datastore.LoadSchema (context.Background (), dataStore, datastoreConfig)
132+ if err != nil {
133+ log.Fatal (errors.Wrap (err, " failed to retrieve datastore schema" ))
134+ }
135+
133136 // Initialize the backend
134- backend , err := ledgerbackend.NewBufferedStorageBackend (backendConfig, dataStore)
137+ backend , err := ledgerbackend.NewBufferedStorageBackend (backendConfig, dataStore, schema )
135138 if err != nil {
136139 log.Fatal (errors.Wrap (err, " failed to create buffered storage backend" ))
137140 }
0 commit comments