Skip to content

Commit

Permalink
server setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kunal047 committed Aug 2, 2022
1 parent 52034b4 commit dd6e83d
Show file tree
Hide file tree
Showing 60 changed files with 13,629 additions and 6,095 deletions.
File renamed without changes.
36 changes: 36 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"airbnb-base",
"airbnb-typescript/base"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project" : "./tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/indent": ["error"],
"import/prefer-default-export": "off",
"semi": ["error", "always"],
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"import/no-dynamic-require": 0,
"no-underscore-dangle": "off",
"no-restricted-syntax": "off"
}
}
Empty file.
3 changes: 1 addition & 2 deletions relayer/.gitignore → .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

node_modules

.env
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2019-2022 Biconomy

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# relayer-node-service
# Relayer Node Service
31 changes: 31 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Security

Biconomy takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.

If you believe you have found a security vulnerability in any Biconomy-owned repository, please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the at [[email protected]](mailto:[email protected]).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Biconomy Bug Bounty Program](https://biconomy.io/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.
17 changes: 17 additions & 0 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Support

## How to file issues and get help

This project uses [GitHub issues][gh-issue] to [track bugs][gh-bug] and [feature requests][gh-feature]. Please search the existing issues before filing new issues to avoid duplicates. For new topics, file your bug or feature request as a new issue.

For help and questions about using this project, please look at the [docs site for Windows Terminal][docs] and our [Contributor's Guide][contributor] if you want to work on Relayer Node Service.

## Microsoft Support Policy

Support for Windows Terminal is limited to the resources listed above.

[gh-issue]: https://github.com/bcnmy/relayer-node-service/issues/new/choose
[gh-bug]: https://github.com/bcnmy/relayer-node-service/issues/new?assignees=&labels=Issue-Bug&template=bug_report.md&title=
[gh-feature]: https://github.com/bcnmy/relayer-node-service/issues/new?assignees=&labels=Issue-Feature&template=Feature_Request.md&title=
[docs]: https://docs.biconomy.io/relayer-node-service
[contributor]: https://github.com//bcnmy/relayer-node-service/blob/main/CONTRIBUTING.md
2 changes: 2 additions & 0 deletions relayer/src/db/index.ts → common/db/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Mongo } from './mongo';
import { redisClient, redisPubSub } from './redis';

export {
redisClient,
redisPubSub,
Mongo,
};
23 changes: 23 additions & 0 deletions common/db/mongo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import mongoose from 'mongoose';

export class Mongo {
dbUrl: string;

supportedNetworks: [] = [];

constructor(dbUrl: string) {
this.dbUrl = dbUrl;
}

connect = async () => {
try {
await mongoose.connect(this.dbUrl);
} catch (error) {
console.log('error while connecting to mongo db');
}
};

static close() {
return mongoose.disconnect();
}
}
7 changes: 3 additions & 4 deletions relayer/src/db/redis.ts → common/db/redis.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { createClient } from 'redis';
import { logger } from '../../log-config';
import { logger } from '../log-config';

const log = logger(module);
const REDIS_CONN_URL = `redis://${process.env.REDIS_USERNAME}${process.env.REDIS_PASSWORD ? ':' : ''}${process.env.REDIS_PASSWORD}${process.env.REDIS_HOST}:${process.env.REDIS_PORT}`;

const redisClient = createClient({
url: REDIS_CONN_URL,
url: process.env.REDIS_URL,
});

const redisPubSub = createClient({
url: REDIS_CONN_URL,
url: process.env.REDIS_URL,
});

(async () => {
Expand Down
File renamed without changes.
File renamed without changes.
Empty file added doc/roadmap.md
Empty file.
Empty file added doc/submitting_code.md
Empty file.
62 changes: 3 additions & 59 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ volumes:
mongo-data:

services:
meta-entry-point:
image: gasless-meta-entry-point:latest
container_name: meta-entry-point
server:
image: relayer-entry-service:latest
container_name: entry-service
command: /bin/sh -c "yarn run dev"
env_file:
- ./envs/.common.env
Expand All @@ -23,62 +23,7 @@ services:
- ../meta-entry-point:/app/
- /app/node_modules
restart: always

utils-service:
image: gasless-utils-service:latest
container_name: utils-service
command: /bin/sh -c "yarn run dev"
env_file:
- ./envs/.common.env
- ./envs/.utils-service.env
ports:
- "0.0.0.0:3001:3000"
depends_on:
- mongo
- redis
- centrifugo
volumes:
- ../utils-service:/app/
- /app/node_modules
restart: always

transaction-listener:
image: gasless-transaction-listener:latest
container_name: transaction-listener
command: /bin/sh -c "yarn run dev"
env_file:
- ./envs/.common.env
- ./envs/.transaction-listener.env
ports:
- "0.0.0.0:3001:3000"
depends_on:
- mongo
- redis
- centrifugo
volumes:
- ../gasless-transaction-listener:/app/
- /app/node_modules
restart: always

transaction-handler:
image: gasless-transaction-handler:latest
container_name: transaction-handler
command: /bin/sh -c "yarn run dev"
env_file:
- ./envs/.common.env
- ./envs/.transaction-handler.env
ports:
- "0.0.0.0:3001:3000"
depends_on:
- mongo
- redis
- centrifugo
- transaction-listener
volumes:
- ../transaction-handler:/app/
- /app/node_modules
restart: always

relayers-service:
image: gasless-relayers-service:latest
container_name: relayers-service
Expand All @@ -90,7 +35,6 @@ services:
- mongo
- redis
- centrifugo
- transaction-handler
volumes:
- ../relayers-service:/app/
- /app/node_modules
Expand Down
Loading

0 comments on commit dd6e83d

Please sign in to comment.