-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from humanprotocol/feature/fortune-JL-server
Fortune Job Launcher Server
- Loading branch information
Showing
28 changed files
with
2,026 additions
and
30 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
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
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
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,19 @@ | ||
NODE_ENV='development' | ||
LOG_LEVEL='debug' | ||
API_HOST='localhost' | ||
API_PORT='8080' | ||
S3_HOST=localhost | ||
S3_PORT=80 | ||
S3_ACCESS_KEY=access-key | ||
S3_SECRET_KEY=secret-key | ||
S3_BUCKET_NAME=fortune-manifests | ||
S3_BASE_URL=http://localhost | ||
ETH_PRIVATE_KEY=df57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e | ||
REC_ORACLE_ADDRESS=0x670bCc966ddc4fE7136c8793617a2C4D22849827 | ||
REP_ORACLE_ADDRESS=0x6aC0881d52B08a9FF766b9Ac51FD9F488D761d98 | ||
EX_ORACLE_ADDRESS=0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec | ||
REC_ORACLE_URL=http://localhost | ||
REP_ORACLE_URL=http://localhost | ||
EX_ORACLE_URL=http://localhost | ||
REC_ORACLE_PERCENTAGE_FEE=10 | ||
REP_ORACLE_PERCENTAGE_FEE=10 |
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,35 @@ | ||
# Job Launcher server | ||
Job Launcher server is an API that allows Human Protocol users to create jobs. | ||
### Validations: | ||
1. In order to accept the job creation the user needs to approve to the job launcher address, in the contract of the token selected, to spend the amount of tokens desired for funding the escrow. | ||
2. Check for curse words in title and description. | ||
|
||
### Flow: | ||
1. User approves the amount necessary | ||
2. User submits the escrow data calling ```POST /escrow``` | ||
3. Server passes validations | ||
4. Server creates the escrow | ||
5. Server funds the escrow | ||
6. Server uploads manifest with the escrow data | ||
7. Server sets the escrow up | ||
8. Server returns escrow address | ||
|
||
|
||
## Run locally | ||
1. Create a copy of .env.test and call it .env: | ||
|
||
```bash | ||
cp .env.test .env | ||
```` | ||
|
||
2. Edit .env file with the required values. | ||
3. Start the server: | ||
|
||
```bash | ||
yarn start | ||
``` | ||
|
||
## Tests | ||
```bash | ||
yarn test | ||
``` |
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,27 @@ | ||
{ | ||
"name": "@human-protocol/job-launcher-server", | ||
"version": "1.0.0", | ||
"description": "Job Launcher Server", | ||
"main": "index.ts", | ||
"license": "MIT", | ||
"private": false, | ||
"type": "module", | ||
"dependencies": { | ||
"@fastify/cors": "^8.2.0", | ||
"@human-protocol/core": "workspace:*", | ||
"@types/node": "^18.11.18", | ||
"bn.js": "^5.2.1", | ||
"fastify": "^4.11.0", | ||
"typescript": "^4.9.4" | ||
}, | ||
"devDependencies": { | ||
"pino-pretty": "^9.1.1", | ||
"ts-node": "^10.9.1", | ||
"vitest": "^0.28.1" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"start": "ts-node --esm ./src/index.ts", | ||
"test": "concurrently -k -s first --hide 0 \"hardhat node --port 8546\" \"sleep 5 && cross-env RPC_PORT=8546 yarn workspace @human-protocol/core deploy:local && vitest --run\"" | ||
} | ||
} |
Oops, something went wrong.