yasiryagi 97d326cd97 Update the storage documentation (#851) | 1 rok temu | |
---|---|---|
.. | ||
Upgrade | 2 lat temu | |
hosting | 2 lat temu | |
joystream-node | 1 rok temu | |
monitoring | 2 lat temu | |
query-node | 2 lat temu | |
README.md | 1 rok temu | |
storage-node.service | 2 lat temu |
The instructions below will assume you are running as root
.
Note that this has been tested on a fresh images of Ubuntu 20.04 LTS
.
Please note that unless there are any openings for new storage providers (which you can check in Pioneer , you will not be able to join.
To upgrade the node please go here for the upgrade guide
No more that 15% of the current operator clustered at the same region.
$ apt-get update && apt-get upgrade -y
$ apt install vim git curl -y
Go here for the installation guide
Go here for the installation guide
Go here for the installation guide
Click here to open the Pioneer app
in your browser.
Make sure to save the 5YourJoyMemberAddress.json
file. This key will require tokens to be used as stake for the Storage Provider
application (application stake
) and further stake may be required if you are selected for the role (role stake
).
During this process you will be provided with a role key, which will be made available to download in the format 5YourStorageRoleKey.json
. If you set a password for this key, remember it :)
The next steps (below) will only apply if you are a successful applicant.
Operator key: in the codebase it's referred to as the transactor key.
$ mkdir ~/keys/
$ cd ~/joystream/
$ yarn joystream-cli account:create
# give it the name:
storage-operator-key
# this guide assumes you don't set a password
cat /root/.local/share/joystream-cli/accounts/storage-operator-key.json
This will give show you the address:
..."address":"5StorageOperatorKey"...
# Go the directory where you saved your <5YourStorageRoleKey.json>, then rename it to
storage-role-key.json
#copy the role key to your keys directory, the below if you are copying from another server.
$ scp storage-role-key.json <user>@<your.vps.ip.address>:/root/keys/
Make sure your Joystream full node and Query Node is fully synced before you move to the next step(s)!
If you have done this on the query node setup, you can skip this section.
$ git clone https://github.com/Joystream/joystream.git
$ cd joystream
$ ./setup.sh
# this requires you to start a new session. if you are using a vps:
$ exit
$ ssh user@ipOrURL
$ cd joystream
$ ./build-packages.sh
$ yarn storage-node --help
Once hired, the Storage Lead will invite you a to "bucket". Before this is done, you will not be able to participate. Assuming:
<workerId>
the Lead has invited to bucket <bucketId>
$ cd ~/joystream
yarn run storage-node operator:accept-invitation -i <bucketId> -w <workerId> -t <5StorageRolerKey> --password=YourKeyPassword -k /root/keys/storage-role-key.json
# With bucketId=1, workerId=2, and operatorkey=5StorageOperatorKey that would be:
# yarn run storage-node operator:set-metadata -i 1 -w 2 -t 5StorageOperatorKey -k /root/keys/storage-role-key.json
When you have accepted the invitation, you have to set metadata for your node. If your VPS is in Frankfurt, Germany:
$ nano metadata.json
# Modify, and paste in everything below the stapled line
---
{
"endpoint": "https://<your.cool.url>/storage/",
"location": {
"countryCode": "DE",
"city": "Frankfurt",
"coordinates": {
"latitude": 52,
"longitude": 15
}
},
"extra": "<Node ID>: <Location>, Xcores, <RAM>G, <SSD>G "
}
Where:
Then, set it on-chain with:
$ cd ~/joystream
$ yarn run storage-node operator:set-metadata -i <bucketId> -w <workerId> -j /path/to/metadata.json -k /root/keys/storage-role-key.json
# With bucketId=1, workerId=2, that would be:
# yarn run storage-node operator:set-metadata -i 1 -w 2 -j /path/to/metadata.json -k /root/keys/storage-role-key.json
First, create a systemd
file. Example file below:
$ nano /etc/systemd/system/storage-node.service
# Modify, and paste in everything below the stapled line
---
[Unit]
Description=Joystream Storage Node
After=network.target joystream-node.service
[Service]
User=root
WorkingDirectory=/root/joystream/
LimitNOFILE=10000
ExecStart=/root/.volta/bin/yarn storage-node server \
-u ws://localhost:9944 \
-w <workerId> \
-o 3333 \
-l /<root/joystream-storage>/log/ \
-d /<root/joystream-storage> \
-q http://localhost:8081/graphql \
-p <Passowrd> \
-k /root/keys/storage-role-key.json \
-s
Restart=on-failure
StartLimitInterval=600
[Install]
WantedBy=multi-user.target
If you (like most) have needed to buy extra storage volume, remember to set -d /path/to/volume
Save and exit.
$ systemctl start storage-node
# If everything works, you should get an output. Verify with:
$ journalctl -f -n 200 -u storage-node
# If it looks ok, it probably is :)
---
# To have colossus start automatically at reboot:
$ systemctl enable storage-node
# If you want to stop the storage node, either to edit the storage-node.service file or some other reason:
$ systemctl stop storage-node
In your browser, try:
https://<your.cool.url>/storage/api/v1/state/data
.