From c6d296a2b38568c7b6245a0f02b797072200ca03 Mon Sep 17 00:00:00 2001 From: Alessandro Manfredi Date: Tue, 1 Oct 2024 16:23:26 +0200 Subject: [PATCH] feat(rpc): adds README.md --- packages/rpc/README.md | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 packages/rpc/README.md diff --git a/packages/rpc/README.md b/packages/rpc/README.md new file mode 100644 index 00000000..2bbbff1e --- /dev/null +++ b/packages/rpc/README.md @@ -0,0 +1,62 @@ +# Hashi RPC + +A RPC server to expose hashi APIs. + +## Getting Started + +These instructions will cover the usage information and how to run the code locally for development using Docker. + +### Configuration + +Configure the mode you want to run by editing the variable in `.env` by checking `.env.example` + +```sh +cp .env.example .env +``` + +### Install + +Please make sure you have run `yarn install` on the root level. + +```sh +cd ../.. # To the root level +nvm use +yarn install +cd packages/rpc +``` + +To start the RPC server, run the following command: + +```sh +cd packages/rpc +yarn start:dev +``` + +### Building and Running the Docker Image + +On the root's `docker-compose.yml`, run the following command: + +```sh +cd ../.. # To the root level +docker compose up --build mongodb hashi_rpc +``` + +Make sure to set `PORT=3000` within `.env` file. + +### Viewing Logs + +To view the logs from the running container, use: + +```sh +docker logs -f [CONTAINER_ID or CONTAINER_NAME] +``` + +You can find the `CONTAINER_ID` or `CONTAINER_NAME` using `docker ps`. + +### Stopping the rpc + +To stop the running container: + +```sh +docker stop [CONTAINER_ID or CONTAINER_NAME] +``` \ No newline at end of file