I am trying to set up Storj locally to make OSS contributions.
So after forking and cloning I set up storj-up
and spin up all the containers. Then created an identity certificate and key and run satellite setup
followed by satellite run
. Am I doing it the correct way?
Also apart from testing did I need to run storj sim testnet?
storj-up is a test local Storj network based on docker compose, it has a satellite, the databases, Edge services (linkshare, Gateway-MT, auth service) and 10 nodes by default. It’s ready to test how to Storj network works. You do not need to setup anything separately, it’s a self-contained.
storj-sim is a test local Storj network based on native binaries, it has a satellite, the gateway-st, uplink and 10 nodes, but you also need to setup redis and the database server separately. It’s also a self-contained, however, it’s missing the Edge services (except single tenant S3-compatible gateway), so they need to be setup separately.
If you trying to run the Storj network without using storj-up and storj-sim, it’s possible too, but it’s recommended to play with storj-sim and/or storj-up first. There is not much documentation, how to setup all services together, so storj-sim and storj-up is a working local Storj network, which you can learn and test.
Actually, I am able to run the frontend but getting frontend config not found
error. So I thought that the backend was not running so I am trying to run the backend.
Also is it possible to run the backend without creating an identity key and certificate as it take so much time?
No, as far as I know. However, it likely may be configured to tolerate a low difficulty for the identity. Then you may generate an identity with a lower difficulty for this test network.
I would suggest to take a look on configuration parameters in the config file for the satellite in storj-up or storj-sim.
Yes, their is a maxdifficulty
flag. I generated the key and the cert successfully.
Do I need to configure the satellite UI manually as their is a service in docker-compose file for satellite-api
which is running but still the frontend is not receiving data from the backend and shows this:
Do I need to make any changes to the frontend like some env variables?
Are you trying to run all the binaries separately from storj-up/storj-sim?
Because neither in the former nor in the latter you do need to modify the difficulty and do not need to configure UI separately, all should work out of the box.
To run a production Storj network you need to configure a lot of services, also run them in a High Availability configuration and run a full sized Cockroach DB instance and have all components distributed and scaled accordingly load.
So, I would like to suggest to start small, if you want to learn yourself - use a storj-up, since it’s a most close test Storj network to a production Storj network, just it would run on the localhost. There you can learn what parameters do you need to setup, if you want to run all components separately.
I unlikely can help to run all required services separately (except Setting Up a Self-Hosted S3 Compatible Gateway - Storj Docs, Using the Uplink CLI - Storj Docs or Sign up and host a Node on Storj - Storj Docs). If you want to deploy an own Storj network, I would suggest to setup a meeting and conclude the support contract with the team.
No no, I am not trying to run the production version. I am trying to run the development version. This are the commands I use
git clone https://github.com/storj/storj.git
cd storj
curl -L storj.io/clone | sh
go install storj.io/storj-up@latest
storj-up init
docker compose up -d
This runs all the containers. But I didn’t find any client port. So I might have to start the client separately so I did
cd web/satellite
npm install
npm run dev
And get that screen.
Could you please show the result of the docker compose ps
or docker ps
commands?
And by the way, you do not need to clone storj/storj
repo to work with storj-up, unless you also want to substitute binaries with a locally built versions.
Then you may open the satellite UI on http://localhost:10000
It’s possible that you need to change the IP to your local IP with the commands:
storj-up env setenv satellite-api STORJ_CONSOLE_GATEWAY_CREDENTIALS_REQUEST_URL=http://ipaddr:8888
storj-up env setenv satellite-api STORJ_CONSOLE_LINKSHARING_URL=http://ipaddr:9090
storj-up env setenv authservice STORJ_ENDPOINT=http://ipaddr:9999
storj-up env setenv linksharing STORJ_PUBLIC_URL=http://ipaddr:9090
and of course docker compose up -d
again.
To see credentials:
storj-up credentials
If you would configure the mail server, it would be also possible to register with a new real email address, not the pre-generated one.
Ahh I see. I wasn’t running storj-up credentials
after setting the env variables. Now it working. Thank you so much.
Yes, it would generate them. However, if you would setup a mail server either a local one or the external, you would also be able to register any account in your local setup.
Not sure, that it’s make any sense for the development, but well. It would be a fully functional prod-like environment.
You should not start the web server yourself. See here. TLDR; use the storj-up local-ws /path/to/storj/web/satellite/
command to point your storj-up to your local dev copy of the code.
Edit:
You can ignore my suggestion if it is already working as expected.
Thank for the help. Every time I made any changes to the frontend I had to run npm run build
to see them. Is there a way to view them directly like npm run dev
?
I do not think so, but I would ask the team, maybe there are alternative ways to update a FE faster.
Instead of using storj-up
from GitHub if I able to configure it myself then I think I can make it usable in dev mode
Use npm run build-watch
.
the best way to contribute to the web app is through storj-up. See here for how to point your storj-up to your local web app copy. From then you any changes you make will be visible on refresh after running npm run build-dev
.