The social service is an enabler of social interactions for decentraland, it stores the friendships between users, has the logic for managing friend requests, and has logic on top of the chat to make sure it's being used correctly (sets a max amount of friends or channels a user can have).
The preferred way to install Rust is by using the rustup command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
This will by default install the stable toolchain, but will also enable you to install beta and nightly toolchains as well as new platforms (e.g. WASM) and update all toolchains to their latest versions.
Run
rustup update
There are two recommended editors/IDEs at the moment:
- IntelliJ Rust
- VS Code with Rust Analyzer support
- Follow the instructions in the following post to add the extension for VS Code for debugging LLVM programs in VS Code
This project will run an HTTP Server and a WebSocket Server.
The WebSocket server implements the protocol definition defined in https://github.com/decentraland/protocol/blob/main/proto/decentraland/social/friendships/friendships.proto which is automatically downloaded from GitHub during the build time. If a build fails, it could be related to that.
You need to have protoc installed
brew install protobuf
make run
Running this command will run a dockerized Postgres DB and run the server on port 8080
. You should have Docker installed on your computer and running.
For development, you can use this command:
make dev
Running this command will run a dockerized Postgres DB and run the server on port 8080
but in watch mode, so every change you make will be watched and the server will restart.
make test
Migrations or pending migrations run when the server starts programmatically using the sqlx API.
In order to create a new migration, you have to run:
make migration name={YOUR_MIGRATION_NAME}
This command will create the migration SQL files (up and down) with the given name
docker exec -ti social_service_db psql -U postgres -d social_service
There's a configuration file (configuration.toml
) that allows configuring the following variables but you can ignore this file, if you use the above make
commands:
host: Host address where the server will run
port: Port where the server will be exposed