Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ethersphere/beekeeper int…
Browse files Browse the repository at this point in the history
…o load_max-storage-radius
  • Loading branch information
gacevicljubisa committed Jun 3, 2024
2 parents bd8ba5e + f6e52a9 commit bcefcc4
Show file tree
Hide file tree
Showing 42 changed files with 120 additions and 1,206 deletions.
2 changes: 1 addition & 1 deletion cmd/beekeeper/cmd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func setupNodes(ctx context.Context, clusterConfig config.Cluster, cfg *config.C

if clusterConfig.IsUsingStaticEndpoints() {
for nodeName, endpoint := range v.GetEndpoints() {
beeOpt := orchestration.WithURLs(endpoint.APIURL, endpoint.DebugAPIURL)
beeOpt := orchestration.WithURL(endpoint.APIURL)
nodeCount++
go setupOrAddNode(ctx, false, ng, nodeName, orchestration.NodeOptions{
Config: &bConfig,
Expand Down
8 changes: 4 additions & 4 deletions cmd/beekeeper/cmd/node_funder.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ func (nf *nodeLister) List(ctx context.Context, namespace string) (nodes []funde
return nil, fmt.Errorf("namespace not provided")
}

ingressHosts, err := nf.k8sClient.Ingress.ListDebugNodesHosts(ctx, namespace)
ingressHosts, err := nf.k8sClient.Ingress.ListAPINodesHosts(ctx, namespace)
if err != nil {
return nil, fmt.Errorf("list ingress debug nodes hosts: %s", err.Error())
return nil, fmt.Errorf("list ingress api nodes hosts: %s", err.Error())
}

ingressRouteHosts, err := nf.k8sClient.IngressRoute.ListDebugNodesHosts(ctx, namespace)
ingressRouteHosts, err := nf.k8sClient.IngressRoute.ListAPINodesHosts(ctx, namespace)
if err != nil {
return nil, fmt.Errorf("list ingress route debug nodes hosts: %s", err.Error())
return nil, fmt.Errorf("list ingress route api nodes hosts: %s", err.Error())
}

ingressHosts = append(ingressHosts, ingressRouteHosts...)
Expand Down
13 changes: 0 additions & 13 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ clusters:
api-domain: staging.internal
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
admin-password: test
funding:
eth: 0.1
Expand Down Expand Up @@ -103,7 +100,6 @@ node-groups:
nginx.ingress.kubernetes.io/session-cookie-path: "default"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
ingress-class: "nginx-internal"
ingress-debug-class: "nginx-internal"
labels:
app.kubernetes.io/component: "node"
app.kubernetes.io/name: "bee"
Expand Down Expand Up @@ -140,8 +136,6 @@ bee-configs:
db-block-cache-capacity: 33554432
db-write-buffer-size: 33554432
db-disable-seeks-compaction: false
debug-api-addr: ":1635"
debug-api-enable: true
full-node: true
nat-addr: ""
mainnet: false
Expand Down Expand Up @@ -364,13 +358,6 @@ checks:
postage-depth: 17
postage-topup-amount: 100
postage-new-depth: 18
authenticate:
type: authenticate
timeout: 5m
options:
role: consumer
admin-password: test
restricted-group-name: restricted
stake:
type: stake
timeout: 5m
Expand Down
3 changes: 0 additions & 3 deletions config/helm-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ clusters:
api-domain: staging.internal
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
node-groups:
bee:
bee-config: default
Expand Down
30 changes: 1 addition & 29 deletions config/local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ clusters:
disable-namespace: true
api-domain: localhost
api-scheme: http
debug-api-domain: localhost
debug-api-scheme: http
admin-password: test
funding:
eth: 0.1
Expand Down Expand Up @@ -45,18 +43,13 @@ clusters:
bee:
bee-config: bee-local-dns
config: local-dns
count: 2
count: 3
mode: node
light:
bee-config: bee-local-light
config: local-light
count: 2
mode: node
restricted:
mode: node
bee-config: bee-local-restricted
config: bee-local-restricted
count: 1
local-clef:
_inherit: "local"
node-groups:
Expand Down Expand Up @@ -119,7 +112,6 @@ node-groups:
nginx.ingress.kubernetes.io/session-cookie-path: "default"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
ingress-class: "traefik"
ingress-debug-class: "traefik"
labels:
app.kubernetes.io/component: "node"
app.kubernetes.io/name: "bee"
Expand All @@ -143,8 +135,6 @@ node-groups:
_inherit: "local"
local-light:
_inherit: "local"
bee-local-restricted:
_inherit: "local"

# bee-configs defines Bee configuration that can be assigned to node-groups
bee-configs:
Expand All @@ -163,8 +153,6 @@ bee-configs:
db-block-cache-capacity: 33554432
db-write-buffer-size: 33554432
db-disable-seeks-compaction: false
debug-api-addr: ":1635"
debug-api-enable: true
full-node: true
mainnet: false
nat-addr: ""
Expand All @@ -182,9 +170,6 @@ bee-configs:
staking-address: "0xfc28330f1ecE0ef2371B724E0D19c1EE60B728b2"
redistribution-address: "0x09Ad42a7d020244920309FfA14EA376dd2D3b7d5"
resolver-options: ""
restricted: false
token-encryption-key: ""
admin-password: ""
chequebook-enable: true
swap-enable: true
swap-endpoint: "ws://geth-swap:8546"
Expand Down Expand Up @@ -214,12 +199,6 @@ bee-configs:
_inherit: "bee-local"
clef-signer-enable: true
clef-signer-endpoint: "http://localhost:8550"
bee-local-restricted:
_inherit: "bee-local"
bootnode: /dnsaddr/localhost
restricted: true
token-encryption-key: testtest
admin-password: $2a$12$Ltg3M2W53Xv9wwJ2.iAv4e4gWELrrr8D2dYat7wNdY2xArdmOSL1i
bootnode-local-clef:
_inherit: "bee-local"
clef-signer-enable: true
Expand Down Expand Up @@ -372,13 +351,6 @@ checks:
postage-depth: 17
postage-topup-amount: 100
postage-new-depth: 18
ci-authenticate:
type: authenticate
timeout: 5m
options:
role: consumer
admin-password: test
restricted-group-name: restricted
ci-stake:
type: stake
timeout: 5m
Expand Down
3 changes: 0 additions & 3 deletions config/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ clusters:
api-domain: gateway.ethswarm.org
api-insecure-tls: true
api-scheme: https
debug-api-domain: bee-gateway.mainnet.internal
debug-api-insecure-tls: true
debug-api-scheme: https
funding:
eth: 0.1
gbzz: 2.0
Expand Down
15 changes: 0 additions & 15 deletions config/restricted.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions config/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ clusters:
api-domain: staging.ethswarm.org
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
funding:
eth: 0.1
gbzz: 2.0
Expand Down
6 changes: 0 additions & 6 deletions config/testnet-giant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ clusters:
api-domain: staging.internal
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
funding:
eth: 0.1
gbzz: 2.0
Expand Down Expand Up @@ -51,7 +48,6 @@ node-groups:
nginx.ingress.kubernetes.io/session-cookie-path: "default"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
ingress-class: "nginx-internal"
ingress-debug-class: "nginx-internal"
labels:
app.kubernetes.io/component: "node"
app.kubernetes.io/name: "bee"
Expand Down Expand Up @@ -88,8 +84,6 @@ bee-configs:
db-block-cache-capacity: 33554432
db-write-buffer-size: 33554432
db-disable-seeks-compaction: false
debug-api-addr: ":1635"
debug-api-enable: true
full-node: true
mainnet: false
nat-addr: ""
Expand Down
6 changes: 0 additions & 6 deletions config/testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ clusters:
api-domain: staging.internal
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
funding:
eth: 0.1
gbzz: 2.0
Expand Down Expand Up @@ -48,7 +45,6 @@ node-groups:
nginx.ingress.kubernetes.io/session-cookie-path: "default"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
ingress-class: "nginx-internal"
ingress-debug-class: "nginx-internal"
labels:
app.kubernetes.io/component: "node"
app.kubernetes.io/name: "bee"
Expand Down Expand Up @@ -90,8 +86,6 @@ bee-configs:
db-block-cache-capacity: 33554432
db-write-buffer-size: 33554432
db-disable-seeks-compaction: false
debug-api-addr: ":1635"
debug-api-enable: true
full-node: true
nat-addr: ""
mainnet: false
Expand Down
38 changes: 8 additions & 30 deletions pkg/bee/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ var userAgent = "beekeeper/" + beekeeper.Version
type Client struct {
httpClient *http.Client // HTTP client must handle authentication implicitly.
service service // Reuse a single struct instead of allocating one for each service on the heap.
restricted bool

// Services that API provides.
Bytes *BytesService
Expand All @@ -43,13 +42,15 @@ type Client struct {
PSS *PSSService
SOC *SOCService
Stewardship *StewardshipService
Auth *AuthService
Node *NodeService
PingPong *PingPongService
Postage *PostageService
Stake *StakingService
}

// ClientOptions holds optional parameters for the Client.
type ClientOptions struct {
HTTPClient *http.Client
Restricted bool
}

// NewClient constructs a new Client.
Expand All @@ -62,8 +63,6 @@ func NewClient(baseURL *url.URL, o *ClientOptions) (c *Client) {
}

c = newClient(httpClientWithTransport(baseURL, o.HTTPClient))
c.restricted = o.Restricted

return
}

Expand All @@ -81,7 +80,10 @@ func newClient(httpClient *http.Client) (c *Client) {
c.PSS = (*PSSService)(&c.service)
c.SOC = (*SOCService)(&c.service)
c.Stewardship = (*StewardshipService)(&c.service)
c.Auth = (*AuthService)(&c.service)
c.Node = (*NodeService)(&c.service)
c.PingPong = (*PingPongService)(&c.service)
c.Postage = (*PostageService)(&c.service)
c.Stake = (*StakingService)(&c.service)
return c
}

Expand Down Expand Up @@ -140,14 +142,6 @@ func (c *Client) request(ctx context.Context, method, path string, body io.Reade
}
req.Header.Set("Accept", contentType)

if c.restricted && req.Header.Get("Authorization") == "" {
key, err := GetToken(path, method)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+key)
}

r, err := c.httpClient.Do(req)
if err != nil {
return err
Expand Down Expand Up @@ -186,14 +180,6 @@ func (c *Client) requestData(ctx context.Context, method, path string, body io.R
}
req.Header.Set("Accept", contentType)

if c.restricted && req.Header.Get("Authorization") == "" {
key, err := GetToken(path, method)
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "Bearer "+key)
}

if opts != nil && opts.Cache != nil {
req.Header.Set(swarmCacheDownloadHeader, strconv.FormatBool(*opts.Cache))
}
Expand Down Expand Up @@ -224,14 +210,6 @@ func (c *Client) requestWithHeader(ctx context.Context, method, path string, hea
req.Header = header
req.Header.Add("Accept", contentType)

if c.restricted && req.Header.Get("Authorization") == "" {
key, err := GetToken(path, method)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+key)
}

r, err := c.httpClient.Do(req)
if err != nil {
return err
Expand Down
Loading

0 comments on commit bcefcc4

Please sign in to comment.