Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rchain music dApp

NotificationsYou must be signed in to change notification settings

rchain/rsong

Repository files navigation

GitHub Logo

RSong Proxy

A client facing REST layer to proxy RSong requests to RSongs Rholang contracts.

RSong is implemented as a combination of multiple microservices and their interactions. These microservices are:

  • acq, this is the RSong Acquisition service responsible for Acquiring assets
  • proxy, RSong Proxy provides RChain rnode REST layer
  • microbatch, tbd

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system

Prerequisites

Installs

clone and build the project

git clone git@github.com:rchain/rsong.gitcd rsongsbt compile

Running the project locally

To run the project locally:

  • set the environment variables
  • run the docker

Alternatively you may build and run the project from source code.

Environment variables

To run the project locally, configure your environment variables:

##export LOCAL_GRPC='localhost'export GCP_GRPC='dd.dd.dd.dd'export AWS_GRPC='dd.dd.dd.dd'export DOCKER_GRPC='172.17.0.2'export HTTP_PORT=9000export GRPC_SERVER=$LOCAL_GRPCexport GRPC_PORT_INTERNAL=40404export GRPC_PORT_EXTERNAL=40401export PRD_K8='http://prd-rchain.com'export DEV_K8='http://dev-rchain.com'export LOCAL_K8='http://localhost'export HOST_URL=$LOCAL_K8

You may consider usingdirenv to manage projects environment variables

Run the docker image

Circle CI build process publishes thersong-proxy docker image to docker hub. To run the image:

sccripts/docker-run.sh

Running the Source code

sbt clean compile run## to create a local dokcer imagesbt clean compile docker:stage docker:publishLocaldocker images | grep 'rsong-proxy'

Running tests:

tests are:

  • unit tests
  • integration tests

Unit tests

sbt clean test

Integration tests

  • configure .envrc for both rsong-proxy and rsong-acquisition are configured for the same node instance
  • executersong-acquisition to migrate the song data to node
  • build rsong-proxy and run integration tests
Execute rsong-acquisition
cd ../rsong-acquisition## make sure rsong-acquisition & rsong-proxy are using the same nodesbt clean compile universal:packageBincd target/universal && unzip ./rsong-acquisition-1.2-SNAPSHOT && cd rsong-acquisition-1.2-SNAPSHOT./bin/rsong-acquisition
Execute rsong-proxy integration tests

Integration tests are run by the python scriptrsong-int-tests.py.
The scripts assumesrequests is installed.

sbt clean compile run## from a different terminal:./scripts/rsong-int-tests.py localhost:9000

url Inventory

host='localhost:9000'## create a new user curl -X POST $host/v1/user/<user_id>## retrieve  user  objectcurl  $host/v1/user/<user_id>## retrive a user's songcurl -v  GET $host/v1/song/song1?userId=123 | jq##  retrive user's songscurl -v  GET $host/v1/song\?userId=user123\&perPage=10\&page=1 | jq

for asset urls, see output from:

curlGET$host/v1/song/song1?userId=123|jq

Built With

circle-ci

Runtime env

  • rnode
  • rsong-proxy

rnode

rnode is build from the latestrchain dev branch deployed to GCP.This is a single instance at this time.

rsong-proxy

rsong-proxy runs onkubernetes-cluster on GCPSeedeployment-prd-spec for more detail

References

About

Rchain music dApp

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp