2019-01-18 13:54:08 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package satellite
|
|
|
|
|
|
|
|
import (
|
2019-08-21 16:49:27 +01:00
|
|
|
"gopkg.in/spacemonkeygo/monkit.v2"
|
2019-01-18 13:54:08 +00:00
|
|
|
|
2019-12-27 11:48:47 +00:00
|
|
|
"storj.io/common/identity"
|
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"
|
|
|
|
"storj.io/storj/satellite/accounting/rollup"
|
|
|
|
"storj.io/storj/satellite/accounting/tally"
|
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"
|
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"
|
2019-10-16 19:08:33 +01:00
|
|
|
"storj.io/storj/satellite/metrics"
|
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"
|
2019-06-24 21:51:54 +01:00
|
|
|
"storj.io/storj/satellite/rewards"
|
2019-01-18 13:54:08 +00:00
|
|
|
)
|
|
|
|
|
2019-06-04 12:55:38 +01:00
|
|
|
var mon = monkit.Package()
|
|
|
|
|
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 {
|
|
|
|
// CreateTables initializes the database
|
|
|
|
CreateTables() error
|
2019-11-02 20:09:07 +00:00
|
|
|
// CheckVersion checks the database is the correct version
|
|
|
|
CheckVersion() error
|
2019-01-18 13:54:08 +00:00
|
|
|
// Close closes the database
|
|
|
|
Close() error
|
|
|
|
|
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
|
2019-01-18 13:54:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Config is the global config satellite
|
|
|
|
type Config struct {
|
|
|
|
Identity identity.Config
|
2019-06-21 11:38:40 +01:00
|
|
|
Server server.Config
|
2019-01-18 13:54:08 +00:00
|
|
|
|
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
|
|
|
|
|
2019-08-27 18:12:38 +01:00
|
|
|
DBCleanup dbcleanup.Config
|
|
|
|
|
2019-05-10 02:39:21 +01:00
|
|
|
Tally tally.Config
|
|
|
|
Rollup rollup.Config
|
|
|
|
LiveAccounting live.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
|
2019-01-18 13:54:08 +00:00
|
|
|
}
|