- Nodejs installed
- Tests - /tests
- App - /src
Clone the repository
git clone https://github.com/elraphty/otcnetwork.git
After cloning the repository,
- cd into the otcnetwork directory
cd otcnetwork
- install dependencies
npm install
- Create a .env file
touch .env
- Copy the placeholders from the .env.sample file into your .env and populate with your own values
- install grenache-grape globally
npm i -g grenache-grape
- boot two grape servers
grape --dp 20001 --aph 30001 --bn '127.0.0.1:20002'
grape --dp 20002 --aph 40001 --bn '127.0.0.1:20001'
- First of all run the grape server
npm run grape_server
- Then run the grape client
npm run grape_client
- Run the API server lastly to make calls to the grape client
npm run start
- Run tests with
npm run test
- GET /api/v1 = Base route
- POST /api/v1/otc = Adds an otc value to and array and returns other otcs that matches if found.
Request Body
{
"order": "$50000/1BTC",
}
Response
{
"msg": "Added otc",
"data": {
"id": 8166,
"order": "$50000/1BTC",
}
}
// OR
{
"msg": "Otc match found",
"data": [
{
"id": 8166,
"order": "$50000/1BTC",
},
{
"id": 8046,
"order": "$50000/1BTC",
},
]
}