update blossom example to use a different database.

closes https://github.com/fiatjaf/khatru/issues/36
This commit is contained in:
fiatjaf
2025-03-17 13:34:35 -03:00
parent 6cc2477e89
commit 51632dcc9f
2 changed files with 8 additions and 4 deletions

View File

@@ -18,7 +18,8 @@ func main() {
bl := blossom.New(relay, "http://localhost:3334")
// create a database for keeping track of blob metadata
bl.Store = blossom.EventStoreBlobIndexWrapper{Store: db, ServiceURL: bl.ServiceURL}
// (do not use the same database used for the relay events)
bl.Store = blossom.EventStoreBlobIndexWrapper{Store: blobdb, ServiceURL: bl.ServiceURL}
// implement the required storage functions
bl.StoreBlob = append(bl.StoreBlob, func(ctx context.Context, sha256 string, body []byte) error {