spacemeshos / pos-server

Apache License 2.0
4 stars 1 forks source link

Pos Server

A server for creating Spacemesh proof of space data files using one or more supported system gpus. The service provides a grpc service for clients to configure it, submit pos jobs and get jobs execution progress. Reuqested client jobs are executed using the system's available supported gpus. To run the server, you need to have at least one supported gpu or set the use_cpu_provider config param to true to use the system's cpu. This is not recommended to production, only for testing.

Prerequisites

You must include a gpu-post c-library for the platform you are building this project on.

  1. Build the gpu-post c-library
  2. Copy the shared library file(s) to the ./pos-compute/resources directory. On macOS, the library file name is libgpu-setup.dylib and on Linux it is libgpu-setup.so. On Windows, copy both gpu-setup.dll and gpu-setup.lib.

Building

make

Testing

Copy all files from crates/pos-compute/resources/ to target/debug/.

make test

Running

  1. Copy all gpu-lib artifacts to pos-service executable directory.
  2. Add the gpu-post dynamic lib path to your system's dynamic lib path. macOS: export DYLD_LIBRARY_PATH=.:$DYLD_LIBRARY_PATH. linux: use LD_LIBRARY_PATH.
  3. Execute the pos-service process.
  4. Use any GRPC client to connect to the server's GRPC service.
  5. Call the service's methods from your client.

Design