Skip to content

Commit

Permalink
- Add Basic Ship Connection Class
Browse files Browse the repository at this point in the history
- Add LICENSE
- Add Configuration files
  • Loading branch information
fabian-emilius committed May 2, 2020
1 parent af71306 commit 67f5998
Show file tree
Hide file tree
Showing 22 changed files with 1,542 additions and 755 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
logs
build
node_modules

# config
config/connections.json
config/contracts.json
config/ecosystems.config.json
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions config/contracts.example.json

This file was deleted.

10 changes: 0 additions & 10 deletions config/contracts.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
},
"redis": {
"host": "redis",
"port": 6379
"port": 6379,
"prefix": "atomicassets"
},
"chain": {
"chain_name": "wax-testnet",
"name": "wax-testnet",
"chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
"http": "http://nodeos:8888",
"ship": "ws://nodeos:8080"
Expand Down
10 changes: 10 additions & 0 deletions config/example-contracts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"scope": ["atomicassets:*"],
"handler": "atomicassets"
},
{
"scope": ["atomicmarket:*"],
"handler": "atomicmarket"
}
]
49 changes: 49 additions & 0 deletions config/example-ecosystems.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"apps": [
{
"name": "filler",
"script": "build/bin/filler.js",

"autorestart": false,
"kill_timeout": 3600,

"watch": false,
"time": true,

"env": {
"START_ON": 0,
"STOP_ON": 0,
"USE_SNAPSHOT": false,

"SHIP_PREFETCH_BLOCKS": 50,
"SHIP_MIN_BLOCK_CONFIRMATION": 30,

"DELETE_TABLES": false
}
},
{
"name": "api",
"script": "build/bin/api.js",

"autorestart": true,
"exp_backoff_restart_delay": 100,

"exec_mode": "cluster",
"merge_logs": true,
"instances": 2,

"watch": false,

"env": {
"PROVIDER_NAME": "pink.network",
"PROVIDER_URL": "https://pink.network",

"SERVER_ADDR": "0.0.0.0",
"SERVER_NAME": "wax.atomicassets.io",
"SERVER_PORT": 3000,

"CACHE_LIFE": 1
}
}
]
}
13 changes: 0 additions & 13 deletions config/pm2/pm2-dev-process.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions config/pm2/pm2-prod-process.config.js

This file was deleted.

18 changes: 0 additions & 18 deletions config/pm2/pm2.config.js

This file was deleted.

95 changes: 45 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,57 @@
{
"name": "atomicassets-api",
"version": "0.0.1",
"version": "0.1.0",
"description": "AtomicAssets API",
"main": "build/index.ts",
"author": "Fabian Emilius",
"license": "GNU AGPLv3",
"repository": "https://github.com/pinknetworkx/atomicassets-api",

"scripts": {
"clean": "rimraf ./build/* && rimraf ./logs/*",
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"build": "yarn clean && yarn lint && webpack --watch",
"start:dev": "NODE_ENV=development yarn build",
"run:dev": "pm2 start ./config/pm2/pm2-dev-process.config.js",
"start:prod": "NODE_ENV=production yarn build",
"run:prod": "pm2 start ./config/pm2/pm2-prod-process.config.js",
"logs": "pm2 logs api --lines 2000",
"stop": "pm2 delete api && yarn clean",
"test": "TS_NODE_PROJECT=tsconfig.test.json mocha -r ts-node/register test/**/*.test.ts"
"build": "yarn clean && yarn lint && tsc",
"test": "mocha -r ts-node/register test/**/*.test.ts",

"start:api": "pm2-runtime ./config/ecosystems.config.json --only api --update-env",
"start:filler": "pm2-runtime ./config/ecosystems.config.json --only filler --update-env",

"logs:api": "pm2 logs api --lines 2000",
"logs:filler": "pm2 logs filler --lines 2000"
},
"author": "pink.network",
"license": "MIT",
"repository": "https://github.com/pinknetworkx/atomicassets-api",
"dependencies": {
"@types/body-parser": "~1.19.0",
"@types/express": "~4.17.2",
"@types/webpack": "~4.41.6",
"fork-ts-checker-webpack-plugin": "~4.0.4",
"webpack": "~4.41.6",
"webpack-cli": "~3.3.11",
"webpack-node-externals": "~1.7.2",
"webpack-shell-plugin": "~0.5.0",
"winston": "~3.2.1",
"body-parser": "~1.19.0",
"express": "~4.17.1",
"express-rate-limit": "~5.1.1",
"rate-limit-redis": "~1.7.0",
"pm2": "~4.2.3",
"socket.io": "~2.3.0",
"socket.io-redis": "~5.2.0",
"socket.io-emitter": "~3.1.1",
"ioredis": "~4.16.0",
"pg": "~7.18.2",
"eosjs": "~20.0.3",
"node-fetch": "~2.6.0",
"int64-buffer": "~0.99.1007",
"text-encoding": "~0.7.0",
"ws": "~7.2.1"
"winston": "^3.2.1",
"body-parser": "^1.19.0",
"express": "^4.17.1",
"express-rate-limit": "^5.1.1",
"rate-limit-redis": "^1.7.0",
"pm2": "^4.2.3",
"socket.io": "^2.3.0",
"socket.io-redis": "^5.2.0",
"socket.io-emitter": "^3.1.1",
"ioredis": "^4.16.0",
"pg": "^7.18.2",
"eosjs": "^20.0.3",
"node-fetch": "^2.6.0",
"int64-buffer": "^0.99.1007",
"text-encoding": "^0.7.0",
"p-queue": "^6.3.0",
"ws": "^7.2.1"
},
"devDependencies": {
"@types/chai": "~4.2.9",
"@types/mocha": "~7.0.1",
"@types/supertest": "~2.0.8",
"chai": "~4.2.0",
"mocha": "~7.0.1",
"supertest": "~4.0.2",
"ts-node": "~8.6.2",
"ts-loader": "~6.2.1",
"tslint": "~6.0.0",
"typescript": "~3.7.5",
"tslint-eslint-rules": "~5.4.0",
"tslint-origin-ordered-imports-rule": "~1.2.2",
"tslint-consistent-codestyle": "~1.16.0"
"@types/body-parser": "^1.19.0",
"@types/express": "^4.17.2",
"@types/chai": "^4.2.9",
"@types/mocha": "^7.0.1",
"@types/supertest": "^2.0.8",
"chai": "^4.2.0",
"mocha": "^7.0.1",
"supertest": "^4.0.2",
"ts-node": "^8.6.2",
"ts-loader": "^6.2.1",
"tslint": "^6.0.0",
"typescript": "^3.7.5",
"tslint-eslint-rules": "^5.4.0",
"tslint-origin-ordered-imports-rule": "^1.2.2",
"tslint-consistent-codestyle": "^1.16.0"
}
}
5 changes: 5 additions & 0 deletions src/connections/chain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ChainAPI {
constructor(endpoint: string) {

}
}
23 changes: 23 additions & 0 deletions src/connections/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const connections = require('../../config/connections.json');

export default class ConnectionManager {
constructor() {

}

redis() {

}

database() {

}

ship() {

}

chain() {

}
}
3 changes: 3 additions & 0 deletions src/connections/postgres.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default class PostgresConnection {

}
3 changes: 3 additions & 0 deletions src/connections/redis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default class RedisConnection {

}
Loading

0 comments on commit 67f5998

Please sign in to comment.