Storagenode Setup

What is the proper way to setup storagenode?
I binded the UI with my docker container.

 volumes:
    - type: bind
      source: ./web/storagenode
      target: /var/lib/storj/web/storagenode
      bind: {}

On storj-up start my containers are running the node api is also working correctly at http://localhost:<STORJ_CONSOLE_ADDRESS>/api however the UI isn’t showing on http://localhost:<STORJ_CONSOLE_ADDRESS>
I have run npm run build
Am I missing something?

If you haven’t already, check out the instructions here

Specifically the frontend section.

A couple things to look out for:

  1. Make sure you have the latest version of storj-up.
  2. If you are bind mounting your own version of the storagenode web directory, try to make sure the binary used in the compose file, is as close of a match as possible to the version of your web source. If these are very different versions, or there are a lot of changes to the binary in comparison to the version of the frontend you’re bind mounting, you can run into issues like these.
3 Likes

I tried it with just after cloning the repo. The satellite and the multinode are working fine but some reason only the storagenode UI not working.
I tried with both binding my local frontend and without binding local frontend. Here is my storagenode docker compose

storagenode1:
    command:
    - storagenode
    - run
    - api
    - --defaults=dev
    - --identity-dir=/var/lib/storj/.local/share/storj/identity/storagenode/
    deploy:
      replicas: 1
    environment:
      STORJUP_AUTHSERVICE: http://authservice:8888
      STORJUP_ROLE: storagenode
      STORJUP_SATELLITE: satellite-api
      STORJ_CONSOLE_ADDRESS: 0.0.0.0:30000
      STORJ_CONTACT_EXTERNAL_ADDRESS: storagenode1:30001
      STORJ_DEBUG_ADDR: 0.0.0.0:11111
      STORJ_DEFAULTS: dev
      STORJ_IDENTITY_DIR: /var/lib/storj/.local/share/storj/identity/storagenode/
      STORJ_LOG_LEVEL: debug
      STORJ_METRICS_APP_SUFFIX: sim
      STORJ_OPERATOR_EMAIL: storage9@mail.test
      STORJ_OPERATOR_WALLET: "0x0123456789012345678901234567890123456789"
      STORJ_ROLE: storagenode
      STORJ_SERVER_ADDRESS: 0.0.0.0:30001
      STORJ_SERVER_EXTENSIONS_REVOCATION: "false"
      STORJ_SERVER_PRIVATE_ADDRESS: 0.0.0.0:30002
      STORJ_SERVER_USE_PEER_CA_WHITELIST: "false"
      STORJ_STORAGE2_MONITOR_MINIMUM_DISK_SPACE: "0"
      STORJ_STORAGE2_TRUST_SOURCES: 12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4@satellite-api:7777
      STORJ_STORAGE_ALLOCATED_DISK_SPACE: 1G
      STORJ_VERSION_SERVER_ADDRESS: http://localhost:8080
      STORJ_WAIT_FOR_SATELLITE: "true"
    image: img.dev.storj.io/storjup/storj:1.111.4
    networks:
      default: null
    ports:
    - mode: ingress
      target: 30000
      published: 30000
      protocol: tcp
    - mode: ingress
      target: 30001
      published: 30001
      protocol: tcp
    volumes:
    - type: bind
      source: ./web/storagenode
      target: /var/lib/storj/web/storagenode
      bind: {}

This are the logs I am getting in the terminal

Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. markup.js:250:53
GET
http://localhost:30000/static/dist/assets/index-DaMTcPfc.js
NS_ERROR_CORRUPTED_CONTENT

GET
http://localhost:30000/static/dist/assets/index-B7WRvI_m.css
NS_ERROR_CORRUPTED_CONTENT

Loading module from “http://localhost:30000/static/dist/assets/index-DaMTcPfc.js” was blocked because of a disallowed MIME type (“text/plain”). localhost:30000
Loading failed for the module with source “http://localhost:30000/static/dist/assets/index-DaMTcPfc.js”. localhost:30000:12:85
The resource from “http://localhost:30000/static/dist/assets/index-B7WRvI_m.css” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff). localhost:30000
GET
http://localhost:30000/static/dist/assets/apple-touch-icon-D1HCd98j.png
[HTTP/1.1 404 Not Found 0ms]

GET
http://localhost:30000/static/dist/assets/favicon-16x16-CA0GT-fi.png
[HTTP/1.1 404 Not Found 0ms]

Make sure that you did install packages before build, e.g.

docker run -it --rm -v ./storj/web/storagenode:/storagenode node:17 bash -c 'cd /storagenode && npm install && npm run build'

and set the web assets for the service:

storj-up local-ws ./storj/web/storagenode storagenode1
storj-up env setenv storagenode1 STORJ_CONSOLE_STATIC_DIR=/var/lib/storj/web/storagenode
docker compose up -d

storagenode1 here would change this only for this node, but not all. Actually, you may want to set the static dir for all storagenodes to be able to compare (by default it’s not set for some reason, so the web UI is absent for nodes):

storj-up env setenv storagenode STORJ_CONSOLE_STATIC_DIR=/var/lib/storj/web/storagenode
docker compose up -d

This version perhaps is too old for the main branch. You may want to build your own image from the main branch using

storj-up build remote github storagenode
docker compose build
docker compose up -d

but seems it’s not required, because I was able to run it without rebuild the image from main.