generated from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16932b9
commit c6d296a
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] | ||
``` |