From e1278c28c3cd65f89a4a27172ab03c423c2b919f Mon Sep 17 00:00:00 2001 From: brucexc Date: Tue, 19 Nov 2024 23:48:41 -0500 Subject: [PATCH 1/3] chore: upgrade to 1.2.0 --- automated_deploy.sh | 4 ++-- pkg/cmd/cmd.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/automated_deploy.sh b/automated_deploy.sh index 36b6645..850526a 100644 --- a/automated_deploy.sh +++ b/automated_deploy.sh @@ -2,11 +2,11 @@ # Deployer information DEPLOYER_NAME="Node-Automated-Deployer" -DEPLOYER_VERSION="v0.5.3" +DEPLOYER_VERSION="v0.5.4" DEPLOYER_RELEASE_URL="https://github.com/RSS3-Network/$DEPLOYER_NAME/releases" # The version of RSS3 Node to deploy -NODE_VERSION="v1.1.3" +NODE_VERSION="v1.2.0" # Detect the operating system OS=$(uname -s) diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index d8f69ba..f3488f9 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -52,7 +52,7 @@ Then, with a single command, you create and start all the services from your con composeFile := compose.NewCompose( compose.WithWorkers(cfg.Component.Decentralized), - // compose.WithWorkers(cfg.Component.Federated), + compose.WithWorkers(cfg.Component.Federated), compose.SetDependsOnAlloyDB(), compose.SetNodeVersion(version), compose.SetNodeVolume(), From f0f7db7a1645bfc52a824c55d6a42e9618a28fc1 Mon Sep 17 00:00:00 2001 From: brucexc Date: Wed, 20 Nov 2024 15:51:39 -0500 Subject: [PATCH 2/3] feat: mastodon worker port --- pkg/compose/compose.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkg/compose/compose.go b/pkg/compose/compose.go index ce8937c..eb1041d 100644 --- a/pkg/compose/compose.go +++ b/pkg/compose/compose.go @@ -2,10 +2,13 @@ package compose import ( "fmt" + "strconv" "strings" "time" "github.com/rss3-network/node/config" + "github.com/rss3-network/node/schema/worker/federated" + "github.com/rss3-network/protocol-go/schema/network" ) type Compose struct { @@ -144,6 +147,10 @@ func SetRestartPolicy() Option { } } +type OptionParameter struct { + Port int64 `json:"port"` +} + func WithWorkers(workers []*config.Module) Option { return func(c *Compose) { services := c.Services @@ -155,6 +162,20 @@ func WithWorkers(workers []*config.Module) Option { ContainerName: name, Image: "rss3/node", } + + // set port for mastodon federated core + if worker.Network == network.Mastodon && worker.Worker == federated.Core { + // default port + var port int64 = 8181 + + if optionParameter := new(OptionParameter); worker.Parameters.Decode(optionParameter) == nil && optionParameter.Port > 0 { + port = optionParameter.Port + } + + service := services[name] + service.Expose = []string{strconv.FormatInt(port, 10)} + services[name] = service + } } c.Services = services From 31eb895173e96d84fdc1117e0d0d3fd55bc617de Mon Sep 17 00:00:00 2001 From: brucexc Date: Wed, 20 Nov 2024 22:59:02 -0500 Subject: [PATCH 3/3] fix: mastodon worker port --- pkg/compose/compose.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/compose/compose.go b/pkg/compose/compose.go index eb1041d..9795cc0 100644 --- a/pkg/compose/compose.go +++ b/pkg/compose/compose.go @@ -172,8 +172,9 @@ func WithWorkers(workers []*config.Module) Option { port = optionParameter.Port } + portStr := strconv.FormatInt(port, 10) service := services[name] - service.Expose = []string{strconv.FormatInt(port, 10)} + service.Ports = []string{fmt.Sprintf("%s:%s", portStr, portStr)} services[name] = service } }