2019-01-18 13:54:08 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package satellite
|
|
|
|
|
|
|
|
import (
|
2020-01-13 13:31:09 +00:00
|
|
|
"context"
|
|
|
|
|
2020-07-09 18:21:25 +01:00
|
|
|
hw "github.com/jtolds/monkit-hw/v2"
|
2019-11-08 20:40:39 +00:00
|
|
|
"github.com/spacemonkeygo/monkit/v3"
|
2019-01-18 13:54:08 +00:00
|
|
|
|
2019-12-27 11:48:47 +00:00
|
|
|
"storj.io/common/identity"
|
2020-03-23 19:18:20 +00:00
|
|
|
"storj.io/private/debug"
|
2019-01-18 13:54:08 +00:00
|
|
|
"storj.io/storj/pkg/server"
|
2019-11-14 19:46:15 +00:00
|
|
|
version_checker "storj.io/storj/private/version/checker"
|
2019-07-28 06:55:36 +01:00
|
|
|
"storj.io/storj/satellite/accounting"
|
|
|
|
"storj.io/storj/satellite/accounting/live"
|
2020-07-07 15:48:09 +01:00
|
|
|
"storj.io/storj/satellite/accounting/projectbwcleanup"
|
2020-01-15 21:45:17 +00:00
|
|
|
"storj.io/storj/satellite/accounting/reportedrollup"
|
2019-07-28 06:55:36 +01:00
|
|
|
"storj.io/storj/satellite/accounting/rollup"
|
|
|
|
"storj.io/storj/satellite/accounting/tally"
|
2020-02-07 16:36:28 +00:00
|
|
|
"storj.io/storj/satellite/admin"
|
2019-06-19 13:02:37 +01:00
|
|
|
"storj.io/storj/satellite/attribution"
|
2019-07-28 06:55:36 +01:00
|
|
|
"storj.io/storj/satellite/audit"
|
2020-03-10 20:42:11 +00:00
|
|
|
"storj.io/storj/satellite/compensation"
|
2019-01-18 13:54:08 +00:00
|
|
|
"storj.io/storj/satellite/console"
|
2019-01-24 16:26:36 +00:00
|
|
|
"storj.io/storj/satellite/console/consoleweb"
|
2019-09-04 20:04:18 +01:00
|
|
|
"storj.io/storj/satellite/contact"
|
2019-08-27 18:12:38 +01:00
|
|
|
"storj.io/storj/satellite/dbcleanup"
|
2019-12-30 19:42:10 +00:00
|
|
|
"storj.io/storj/satellite/downtime"
|
2019-07-24 18:26:43 +01:00
|
|
|
"storj.io/storj/satellite/gc"
|
2019-09-25 18:12:44 +01:00
|
|
|
"storj.io/storj/satellite/gracefulexit"
|
2019-03-02 15:22:20 +00:00
|
|
|
"storj.io/storj/satellite/mailservice"
|
2019-06-24 21:51:54 +01:00
|
|
|
"storj.io/storj/satellite/marketingweb"
|
2019-03-18 10:55:06 +00:00
|
|
|
"storj.io/storj/satellite/metainfo"
|
2020-04-15 20:20:16 +01:00
|
|
|
"storj.io/storj/satellite/metainfo/expireddeletion"
|
2019-10-16 19:08:33 +01:00
|
|
|
"storj.io/storj/satellite/metrics"
|
2020-07-15 18:08:24 +01:00
|
|
|
"storj.io/storj/satellite/nodeapiversion"
|
2019-03-27 10:24:35 +00:00
|
|
|
"storj.io/storj/satellite/orders"
|
2019-07-28 06:55:36 +01:00
|
|
|
"storj.io/storj/satellite/overlay"
|
2019-11-05 20:26:19 +00:00
|
|
|
"storj.io/storj/satellite/payments/paymentsconfig"
|
2019-10-10 18:12:23 +01:00
|
|
|
"storj.io/storj/satellite/payments/stripecoinpayments"
|
2019-11-21 22:34:49 +00:00
|
|
|
"storj.io/storj/satellite/referrals"
|
2019-07-28 06:55:36 +01:00
|
|
|
"storj.io/storj/satellite/repair/checker"
|
|
|
|
"storj.io/storj/satellite/repair/irreparable"
|
|
|
|
"storj.io/storj/satellite/repair/queue"
|
|
|
|
"storj.io/storj/satellite/repair/repairer"
|
2020-06-03 14:51:02 +01:00
|
|
|
"storj.io/storj/satellite/revocation"
|
2019-06-24 21:51:54 +01:00
|
|
|
"storj.io/storj/satellite/rewards"
|
2020-09-10 15:08:25 +01:00
|
|
|
"storj.io/storj/satellite/snopayout"
|
2019-01-18 13:54:08 +00:00
|
|
|
)
|
|
|
|
|
2019-06-04 12:55:38 +01:00
|
|
|
var mon = monkit.Package()
|
|
|
|
|
2020-07-09 18:21:25 +01:00
|
|
|
func init() {
|
|
|
|
hw.Register(monkit.Default)
|
|
|
|
}
|
|
|
|
|
2019-01-18 13:54:08 +00:00
|
|
|
// DB is the master database for the satellite
|
2019-09-10 14:24:16 +01:00
|
|
|
//
|
|
|
|
// architecture: Master Database
|
2019-01-18 13:54:08 +00:00
|
|
|
type DB interface {
|
2020-04-30 07:36:59 +01:00
|
|
|
// MigrateToLatest initializes the database
|
|
|
|
MigrateToLatest(ctx context.Context) error
|
2019-11-02 20:09:07 +00:00
|
|
|
// CheckVersion checks the database is the correct version
|
2020-01-13 13:44:55 +00:00
|
|
|
CheckVersion(ctx context.Context) error
|
2019-01-18 13:54:08 +00:00
|
|
|
// Close closes the database
|
|
|
|
Close() error
|
|
|
|
|
2020-04-30 07:36:59 +01:00
|
|
|
// TestingMigrateToLatest initializes the database for testplanet.
|
|
|
|
TestingMigrateToLatest(ctx context.Context) error
|
2020-01-17 20:56:56 +00:00
|
|
|
|
2019-08-26 17:49:42 +01:00
|
|
|
// PeerIdentities returns a storage for peer identities
|
|
|
|
PeerIdentities() overlay.PeerIdentities
|
2019-01-18 13:54:08 +00:00
|
|
|
// OverlayCache returns database for caching overlay information
|
|
|
|
OverlayCache() overlay.DB
|
2019-06-19 13:02:37 +01:00
|
|
|
// Attribution returns database for partner keys information
|
|
|
|
Attribution() attribution.DB
|
2019-05-10 20:05:42 +01:00
|
|
|
// StoragenodeAccounting returns database for storing information about storagenode use
|
|
|
|
StoragenodeAccounting() accounting.StoragenodeAccounting
|
|
|
|
// ProjectAccounting returns database for storing information about project data use
|
|
|
|
ProjectAccounting() accounting.ProjectAccounting
|
2019-01-18 13:54:08 +00:00
|
|
|
// RepairQueue returns queue for segments that need repairing
|
|
|
|
RepairQueue() queue.RepairQueue
|
|
|
|
// Irreparable returns database for failed repairs
|
|
|
|
Irreparable() irreparable.DB
|
|
|
|
// Console returns database for satellite console
|
|
|
|
Console() console.DB
|
2019-12-04 03:36:21 +00:00
|
|
|
// Rewards returns database for marketing admin GUI
|
2019-06-24 21:51:54 +01:00
|
|
|
Rewards() rewards.DB
|
2019-03-27 10:24:35 +00:00
|
|
|
// Orders returns database for orders
|
|
|
|
Orders() orders.DB
|
2019-05-22 15:50:22 +01:00
|
|
|
// Containment returns database for containment
|
2019-05-23 15:37:23 +01:00
|
|
|
Containment() audit.Containment
|
2019-07-08 23:32:18 +01:00
|
|
|
// Buckets returns the database to interact with buckets
|
|
|
|
Buckets() metainfo.BucketsDB
|
2019-09-25 18:12:44 +01:00
|
|
|
// GracefulExit returns database for graceful exit
|
|
|
|
GracefulExit() gracefulexit.DB
|
2019-11-05 13:16:02 +00:00
|
|
|
// StripeCoinPayments returns stripecoinpayments database.
|
|
|
|
StripeCoinPayments() stripecoinpayments.DB
|
2019-12-27 22:03:03 +00:00
|
|
|
// DowntimeTracking returns database for downtime tracking
|
2019-12-30 19:42:10 +00:00
|
|
|
DowntimeTracking() downtime.DB
|
2020-09-10 15:08:25 +01:00
|
|
|
// SnoPayout returns database for payout.
|
|
|
|
SnoPayout() snopayout.DB
|
2020-03-10 20:42:11 +00:00
|
|
|
// Compoensation tracks storage node compensation
|
|
|
|
Compensation() compensation.DB
|
2020-06-03 14:51:02 +01:00
|
|
|
// Revocation tracks revoked macaroons
|
|
|
|
Revocation() revocation.DB
|
2020-07-15 18:08:24 +01:00
|
|
|
// NodeAPIVersion tracks nodes observed api usage
|
|
|
|
NodeAPIVersion() nodeapiversion.DB
|
2019-01-18 13:54:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 15:18:02 +01:00
|
|
|
// Config is the global config satellite.
|
2019-01-18 13:54:08 +00:00
|
|
|
type Config struct {
|
|
|
|
Identity identity.Config
|
2019-06-21 11:38:40 +01:00
|
|
|
Server server.Config
|
2020-01-28 17:35:45 +00:00
|
|
|
Debug debug.Config
|
2019-01-18 13:54:08 +00:00
|
|
|
|
2020-02-07 16:36:28 +00:00
|
|
|
Admin admin.Config
|
|
|
|
|
2019-10-14 15:57:01 +01:00
|
|
|
Contact contact.Config
|
|
|
|
Overlay overlay.Config
|
2019-01-18 13:54:08 +00:00
|
|
|
|
2019-06-06 14:57:58 +01:00
|
|
|
Metainfo metainfo.Config
|
2019-06-21 11:38:40 +01:00
|
|
|
Orders orders.Config
|
2019-01-18 13:54:08 +00:00
|
|
|
|
|
|
|
Checker checker.Config
|
|
|
|
Repairer repairer.Config
|
2019-01-23 19:58:44 +00:00
|
|
|
Audit audit.Config
|
|
|
|
|
2019-07-24 18:26:43 +01:00
|
|
|
GarbageCollection gc.Config
|
|
|
|
|
2020-04-15 20:20:16 +01:00
|
|
|
ExpiredDeletion expireddeletion.Config
|
|
|
|
|
2019-08-27 18:12:38 +01:00
|
|
|
DBCleanup dbcleanup.Config
|
|
|
|
|
2020-07-07 15:48:09 +01:00
|
|
|
Tally tally.Config
|
|
|
|
Rollup rollup.Config
|
|
|
|
LiveAccounting live.Config
|
|
|
|
ReportedRollup reportedrollup.Config
|
|
|
|
ProjectBWCleanup projectbwcleanup.Config
|
2019-01-24 16:26:36 +00:00
|
|
|
|
2019-11-05 20:26:19 +00:00
|
|
|
Mail mailservice.Config
|
|
|
|
|
|
|
|
Payments paymentsconfig.Config
|
|
|
|
|
2019-11-21 22:34:49 +00:00
|
|
|
Referrals referrals.Config
|
|
|
|
|
2019-01-24 16:26:36 +00:00
|
|
|
Console consoleweb.Config
|
2019-04-03 20:13:39 +01:00
|
|
|
|
2019-06-11 16:00:59 +01:00
|
|
|
Marketing marketingweb.Config
|
2019-05-30 20:52:33 +01:00
|
|
|
|
2019-10-20 08:56:23 +01:00
|
|
|
Version version_checker.Config
|
2019-10-07 21:38:05 +01:00
|
|
|
|
|
|
|
GracefulExit gracefulexit.Config
|
2019-10-16 19:08:33 +01:00
|
|
|
|
|
|
|
Metrics metrics.Config
|
2020-01-02 20:41:18 +00:00
|
|
|
|
|
|
|
Downtime downtime.Config
|
2020-03-10 20:42:11 +00:00
|
|
|
|
|
|
|
Compensation compensation.Config
|
2019-01-18 13:54:08 +00:00
|
|
|
}
|