diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index a0612a6..afd9314 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -22,4 +22,4 @@ jobs: GOOS=linux GOARCH=amd64 make echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USER }}" --password-stdin docker build . --tag ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag_name }} -f docker/Dockerfile --build-arg "ghcr_token=${{ secrets.GHCR_TOKEN }}" - docker push ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag_name }} + docker push ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag_name }} \ No newline at end of file diff --git a/cmd/node/flags.go b/cmd/node/flags.go index c5b3f83..cd70e01 100644 --- a/cmd/node/flags.go +++ b/cmd/node/flags.go @@ -32,7 +32,8 @@ func parseFlags() *config.Config { pflag.UintVarP(&cfg.Concurrency, "concurrency", "c", defaultConcurrency, "maximum number of requests node will process in parallel") pflag.StringVar(&cfg.API, "rest-api", "", "address where the head node REST API will listen on") pflag.StringVar(&cfg.Workspace, "workspace", "./workspace", "directory that the node can use for file storage") - pflag.StringVar(&cfg.Runtime, "runtime", "", "runtime address (used by the worker node)") + pflag.StringVar(&cfg.RuntimePath, "runtime-path", "", "runtime path (used by the worker node)") + pflag.StringVar(&cfg.RuntimeCLI, "runtime-cli", "", "runtime path (used by the worker node)") pflag.BoolVar(&cfg.LoadAttributes, "attributes", false, "node should try to load its attribute data from IPFS") // Host configuration. diff --git a/cmd/node/main.go b/cmd/node/main.go index ef7f98a..ea5a781 100644 --- a/cmd/node/main.go +++ b/cmd/node/main.go @@ -132,7 +132,8 @@ func run() int { // Executor options. execOptions := []executor.Option{ executor.WithWorkDir(cfg.Workspace), - executor.WithRuntimeDir(cfg.Runtime), + executor.WithRuntimeDir(cfg.RuntimePath), + executor.WithExecutableName(cfg.RuntimeCLI), } if needLimiter(cfg) { @@ -158,7 +159,7 @@ func run() int { log.Error(). Err(err). Str("workspace", cfg.Workspace). - Str("runtime", cfg.Runtime). + Str("runtime_path", cfg.RuntimePath). Msg("could not create an executor") return failure } diff --git a/docker/run.sh b/docker/run.sh index 74f527a..e4497c1 100644 --- a/docker/run.sh +++ b/docker/run.sh @@ -83,5 +83,5 @@ fi if [ "$NODE_ROLE" = "head" ]; then ./upshot-node --peer-db /var/tmp/upshot/peerdb --function-db /var/tmp/upshot/function-db --log-level debug --port $P2P_PORT --role head --workspace $WORKSPACE_ROOT --private-key $NODE_KEY_PATH --rest-api :$REST_API $dialback_args $bootnode_args else - ./upshot-node --peer-db ./peer-database --function-db ./function-database--log-level debug --port $P2P_PORT --role worker --runtime /app/runtime --workspace $WORKSPACE_ROOT --private-key $NODE_KEY_PATH $dialback_args $bootnode_args + ./upshot-node --peer-db ./peer-database --function-db ./function-database--log-level debug --port $P2P_PORT --role worker --runtime-path /app/runtime --runtime-cli bls-runtime --workspace $WORKSPACE_ROOT --private-key $NODE_KEY_PATH $dialback_args $bootnode_args fi \ No newline at end of file diff --git a/go.mod b/go.mod index 09d1d12..6f6ebe1 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ toolchain go1.21.4 require ( github.com/cockroachdb/pebble v0.0.0-20230903225801-a4fe05009372 github.com/labstack/echo/v4 v4.11.3 + github.com/libp2p/go-libp2p v0.31.0 github.com/multiformats/go-multiaddr v0.11.0 github.com/spf13/pflag v1.0.5 ) @@ -78,7 +79,6 @@ require ( github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect - github.com/libp2p/go-libp2p v0.31.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.3.0 // indirect github.com/libp2p/go-libp2p-consensus v0.0.1 // indirect github.com/libp2p/go-libp2p-gostream v0.6.0 // indirect @@ -150,9 +150,8 @@ require ( ) require ( - github.com/blocklessnetwork/b7s v0.4.3 + github.com/blocklessnetwork/b7s v0.4.5 github.com/labstack/gommon v0.4.0 // indirect - github.com/libp2p/go-libp2p-core v0.20.1 github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/rs/zerolog v1.31.0 diff --git a/go.sum b/go.sum index cd8d2a5..7287b93 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blocklessnetwork/b7s v0.4.3 h1:uqojfDy7rBekScFL2bVacKurmOtBo9bdxjKXJg4XhUY= -github.com/blocklessnetwork/b7s v0.4.3/go.mod h1:fkA5Te5tqk+foXMS50qe0zSx4V5KaO4PLKKpt2AudQE= +github.com/blocklessnetwork/b7s v0.4.5 h1:EtiP4NlkwZgDgQKQGx5PO9XWzJgDGV7Civ/BFemSHxM= +github.com/blocklessnetwork/b7s v0.4.5/go.mod h1:fkA5Te5tqk+foXMS50qe0zSx4V5KaO4PLKKpt2AudQE= github.com/blocklessnetwork/b7s-attributes v0.0.0-20231003175355-c87ad3eae97e h1:MbORHFMckGPdJq3Wdya+DqrY5iyvUn4PdcWyI3ywd30= github.com/blocklessnetwork/b7s-attributes v0.0.0-20231003175355-c87ad3eae97e/go.mod h1:OvkFdYsKp1RFpfa/nLuOc4Aif08U6O9uOcAnXgz/qJY= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= @@ -370,8 +370,6 @@ github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLE github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w= github.com/libp2p/go-libp2p-consensus v0.0.1 h1:jcVbHRZLwTXU9iT/mPi+Lx4/OrIzq3bU1TbZNhYFCV8= github.com/libp2p/go-libp2p-consensus v0.0.1/go.mod h1:+9Wrfhc5QOqWB0gXI0m6ARlkHfdJpcFXmRU0WoHz4Mo= -github.com/libp2p/go-libp2p-core v0.20.1 h1:fQz4BJyIFmSZAiTbKV8qoYhEH5Dtv/cVhZbG3Ib/+Cw= -github.com/libp2p/go-libp2p-core v0.20.1/go.mod h1:6zR8H7CvQWgYLsbG4on6oLNSGcyKaYFSEYyDt51+bIY= github.com/libp2p/go-libp2p-gostream v0.6.0 h1:QfAiWeQRce6pqnYfmIVWJFXNdDyfiR/qkCnjyaZUPYU= github.com/libp2p/go-libp2p-gostream v0.6.0/go.mod h1:Nywu0gYZwfj7Jc91PQvbGU8dIpqbQQkjWgDuOrFaRdA= github.com/libp2p/go-libp2p-kad-dht v0.25.0 h1:T2SXQ/VlXTQVLChWY/+OyOsmGMRJvB5kiR+eJt7jtvI=