diff --git a/README.md b/README.md index ed366631..9f8f95c2 100644 --- a/README.md +++ b/README.md @@ -450,3 +450,25 @@ example: --tracing-port string port to send tracing data --tracing-service-name string service name identifier for tracing (default "beekeeper") ``` + +## Public Testnet Checks + +### One by one + +```shell +./dist/beekeeper check --cluster-name=bee-testnet --checks=pingpong +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-retrieval +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-settlements +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-manifest +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-pss +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-soc +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-pushsync-chunks +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-postage +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-gsoc +``` + +### All at once, sequentially + +```shell +./dist/beekeeper check --cluster-name=bee-testnet --timeout=2h --checks=pingpong,pt-retrieval,pt-settlements,pt-manifest,pt-pss,pt-soc,pt-pushsync-chunks,pt-postage,pt-gsoc +``` diff --git a/config/public-testnet.yaml b/config/public-testnet.yaml new file mode 100644 index 00000000..7b74cc80 --- /dev/null +++ b/config/public-testnet.yaml @@ -0,0 +1,128 @@ +clusters: + bee-testnet: + _inherit: "default" + namespace: bee-testnet + use-static-endpoints: true + node-groups: + bee: + mode: node + bee-config: default + config: default + count: 20 + endpoints: + - name: bee-1-0 + api-url: http://bee-1-0.bee-testnet.testnet.internal + - name: bee-1-1 + api-url: http://bee-1-1.bee-testnet.testnet.internal + - name: bee-1-2 + api-url: http://bee-1-2.bee-testnet.testnet.internal + - name: bee-1-3 + api-url: http://bee-1-3.bee-testnet.testnet.internal + - name: bee-1-4 + api-url: http://bee-1-4.bee-testnet.testnet.internal + - name: bee-2-0 + api-url: http://bee-2-0.bee-testnet.testnet.internal + - name: bee-2-1 + api-url: http://bee-2-1.bee-testnet.testnet.internal + - name: bee-2-2 + api-url: http://bee-2-2.bee-testnet.testnet.internal + - name: bee-2-3 + api-url: http://bee-2-3.bee-testnet.testnet.internal + - name: bee-2-4 + api-url: http://bee-2-4.bee-testnet.testnet.internal + - name: bee-3-0 + api-url: http://bee-3-0.bee-testnet.testnet.internal + - name: bee-3-1 + api-url: http://bee-3-1.bee-testnet.testnet.internal + - name: bee-3-2 + api-url: http://bee-3-2.bee-testnet.testnet.internal + - name: bee-3-3 + api-url: http://bee-3-3.bee-testnet.testnet.internal + - name: bee-3-4 + api-url: http://bee-3-4.bee-testnet.testnet.internal + - name: bee-4-0 + api-url: http://bee-4-0.bee-testnet.testnet.internal + - name: bee-4-1 + api-url: http://bee-4-1.bee-testnet.testnet.internal + - name: bee-4-2 + api-url: http://bee-4-2.bee-testnet.testnet.internal + - name: bee-4-3 + api-url: http://bee-4-3.bee-testnet.testnet.internal + - name: bee-4-4 + api-url: http://bee-4-4.bee-testnet.testnet.internal + +checks: + pt-retrieval: + options: + chunks-per-node: 3 + postage-amount: 140000000 + postage-depth: 17 + upload-node-count: 3 + timeout: 15m + type: retrieval + pt-settlements: + options: + dry-run: false + expect-settlements: true + file-name: settlements + file-size: 14680064 # 14mb = 14*1024*1024 + postage-amount: 140000000 + postage-depth: 20 + threshold: 100000000 + upload-node-count: 3 + wait-before-download: 15s + timeout: 15m + type: settlements + pt-manifest: + options: + files-in-collection: 10 + max-pathname-length: 64 + postage-amount: 140000000 + postage-depth: 17 + timeout: 5m + type: manifest + pt-pss: + options: + count: 3 + address-prefix: 2 + postage-amount: 140000000 + postage-depth: 17 + request-timeout: 5m + timeout: 30m + type: pss + pt-soc: + options: + postage-amount: 140000000 + postage-depth: 17 + request-timeout: 5m + timeout: 5m + type: soc + pt-pushsync-chunks: + options: + chunks-per-node: 3 + mode: chunks + postage-amount: 140000000 + postage-depth: 17 + retries: 5 + retry-delay: 15s + upload-node-count: 3 + exclude-node-group: + - light + - bootnode + timeout: 30m + type: pushsync + pt-postage: + type: postage + timeout: 30m + options: + postage-amount: 140000000 + postage-depth: 17 + postage-topup-amount: 100 + postage-new-depth: 18 + pt-gsoc: + options: + postage-amount: 140000000 + postage-depth: 20 + postage-label: gsoc-label + timeout: 10m + type: gsoc diff --git a/pkg/check/settlements/settlements.go b/pkg/check/settlements/settlements.go index 613d086d..98fd55c4 100644 --- a/pkg/check/settlements/settlements.go +++ b/pkg/check/settlements/settlements.go @@ -75,7 +75,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int if o.DryRun { c.logger.Info("running settlements (dry mode)") - return dryRun(ctx, cluster, o, c.logger) + return dryRun(ctx, cluster, c.logger) } rnd := random.PseudoGenerator(o.Seed) @@ -97,7 +97,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int return err } - if err := validateSettlements(overlays, accounting, settlements, c.logger); err != nil { + if err := validateSettlements(accounting, settlements, c.logger); err != nil { return fmt.Errorf("invalid initial settlements: %s", err.Error()) } c.logger.Info("Settlements are valid") @@ -152,8 +152,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int settlementsHappened = true } - err = validateSettlements(overlays, accounting, settlements, c.logger) - if err != nil { + if err = validateSettlements(accounting, settlements, c.logger); err != nil { c.logger.Infof("Invalid settlements after uploading a file: %s", err.Error()) c.logger.Info("Retrying ...") continue @@ -203,7 +202,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int settlementsHappened = true } - err = validateSettlements(overlays, accounting, settlements, c.logger) + err = validateSettlements(accounting, settlements, c.logger) if err != nil { c.logger.Infof("Invalid settlements after downloading a file: %s", err.Error()) c.logger.Info("Retrying ...") @@ -228,12 +227,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int } // dryRun executes settlements validation check without files uploading/downloading -func dryRun(ctx context.Context, cluster orchestration.Cluster, o Options, logger logging.Logger) (err error) { - overlays, err := cluster.FlattenOverlays(ctx) - if err != nil { - return err - } - +func dryRun(ctx context.Context, cluster orchestration.Cluster, logger logging.Logger) (err error) { accounting, err := cluster.FlattenAccounting(ctx) if err != nil { return err @@ -244,7 +238,7 @@ func dryRun(ctx context.Context, cluster orchestration.Cluster, o Options, logge return err } - if err := validateSettlements(overlays, accounting, settlements, logger); err != nil { + if err := validateSettlements(accounting, settlements, logger); err != nil { return fmt.Errorf("invalid settlements") } logger.Info("Settlements are valid") @@ -253,7 +247,7 @@ func dryRun(ctx context.Context, cluster orchestration.Cluster, o Options, logge } // validateSettlements checks if settlements are valid -func validateSettlements(overlays orchestration.NodeGroupOverlays, accounting orchestration.NodeGroupAccounting, settlements orchestration.NodeGroupSettlements, logger logging.Logger) (err error) { +func validateSettlements(accounting orchestration.NodeGroupAccounting, settlements orchestration.NodeGroupSettlements, logger logging.Logger) (err error) { // threshold validation for node, v := range accounting { for _, peerInfo := range v { @@ -273,10 +267,10 @@ func validateSettlements(overlays orchestration.NodeGroupOverlays, accounting or for peer, peerInfo := range v { diff := peerInfo.Balance + accounting[peer][node].Balance if diff != 0 { - logger.Infof("Node %s has asymmetric balance with peer %s\n", node, peer) - logger.Infof("Node %s has balance %d with peer %s\n", node, peerInfo.Balance, peer) - logger.Infof("Peer %s has balance %d with node %s\n", peer, accounting[peer][node].Balance, node) - logger.Infof("Difference: %d\n", diff) + logger.Infof("Node %s has asymmetric balance with peer %s", node, peer) + logger.Infof("Node %s has balance %d with peer %s", node, peerInfo.Balance, peer) + logger.Infof("Peer %s has balance %d with node %s", peer, accounting[peer][node].Balance, node) + logger.Infof("Difference: %d", diff) noBalanceSymmetry = true } }