Skip to content

Commit 6120daf

Browse files
authored
Merge pull request #378 from wavesplatform/release/v0.36.0
Release/v0.36.0
2 parents 64a718e + 3497489 commit 6120daf

File tree

8 files changed

+87
-36
lines changed

8 files changed

+87
-36
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM node:10-alpine
22

3+
# pg-native
4+
RUN apk --no-cache add make python gcc postgresql-dev g++
5+
36
# enable node_modules caching layer
47
RUN apk add --no-cache tini git
58
ADD package.json /tmp/package.json
@@ -18,5 +21,4 @@ ENTRYPOINT ["/sbin/tini", "--"]
1821

1922
# NodeJS launch
2023
USER node
21-
ENV NODE_ENV production
22-
CMD ["node", "--max-old-space-size=2048", "dist/index.js"]
24+
CMD ["npm", "start"]

nodemon.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

package-lock.json

Lines changed: 58 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
{
22
"name": "data-service",
3-
"version": "0.35.0",
3+
"version": "0.36.0",
44
"description": "Waves data service",
55
"main": "src/index.js",
66
"repository": "[email protected]:wavesplatform/data-service.git",
77
"author": "Dmitry Shuranov <[email protected]>",
88
"license": "MIT",
99
"scripts": {
1010
"build": "rm -rf dist/ && tsc",
11-
"start": "export $(cat variables.env | xargs) && NODE_ENV=production node dist/index.js",
12-
"candles": "export $(cat variables.env | xargs) && NODE_ENV=production node dist/daemons/candles/index.js",
13-
"dev:candles": "export $(cat variables.stage.env | xargs) && NODE_ENV=development LOG_LEVEL=debug nodemon --inspect dist/daemons/candles/index.js",
14-
"dev:candles:t": "export $(cat variables.testnet.env | xargs) && NODE_ENV=development LOG_LEVEL=debug nodemon --inspect dist/daemons/candles/index.js",
15-
"pairs": "export $(cat variables.env | xargs) && NODE_ENV=production node dist/daemons/pairs/index.js",
16-
"dev:pairs": "export $(cat variables.stage.env | xargs) && NODE_ENV=development LOG_LEVEL=debug nodemon --inspect dist/daemons/pairs/index.js",
17-
"dev:pairs:t": "export $(cat variables.testnet.env | xargs) && NODE_ENV=development LOG_LEVEL=debug nodemon --inspect dist/daemons/pairs/index.js",
11+
"start": "NODE_PG_FORCE_NATIVE=1 node dist/index.js",
12+
"dev": "NODE_PG_FORCE_NATIVE=1 NODE_ENV=development LOG_LEVEL=debug node dist/index.js",
13+
"candles": "NODE_PG_FORCE_NATIVE=1 node dist/daemons/candles/index.js",
14+
"pairs": "NODE_PG_FORCE_NATIVE=1 node dist/daemons/pairs/index.js",
1815
"lint": "eslint src",
19-
"dev": "NODE_ENV=development LOG_LEVEL=debug nodemon --inspect dist/index.js",
20-
"test": "npm run test:u && npm run test:i",
21-
"test:t": "npm run test:u && npm run test:it",
22-
"test:u": "jest --runInBand --detectOpenHandles --config=config/jest.config.unit.json",
16+
"test": "jest --runInBand --detectOpenHandles --config=config/jest.config.unit.json",
2317
"test:i": "export $(cat variables.env | xargs) && jest --runInBand --detectOpenHandles --config=config/jest.config.integration.json",
24-
"test:is": "export $(cat variables.stage.env | xargs) && jest --runInBand --detectOpenHandles --config=config/jest.config.integration.json",
2518
"test:it": "export $(cat variables.testnet.env | xargs) && jest --runInBand --detectOpenHandles --config=config/jest.config.integration.testnet.json"
2619
},
2720
"devDependencies": {
@@ -37,7 +30,6 @@
3730
"@types/ramda": "^0.25.43",
3831
"eslint": "^5.15.1",
3932
"jest": "^24.5.0",
40-
"nodemon": "^1.18.8",
4133
"pg-monitor": "^1.3.1",
4234
"ts-jest": "^23.10.5",
4335
"ts-node": "^7.0.1",
@@ -61,6 +53,7 @@
6153
"koa-router": "^7.4.0",
6254
"lru-cache": "^5.1.1",
6355
"merge-descriptors": "^1.0.1",
56+
"pg-native": "^3.0.1",
6457
"pg-promise": "^8.2.3",
6558
"qs": "^6.5.2",
6659
"ramda": "^0.25.0",

src/daemons/candles/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM node:10-alpine
22

3+
# pg-native
4+
RUN apk --no-cache add make python gcc postgresql-dev g++
5+
36
# enable node_modules caching layer
47
RUN apk add --no-cache tini git
58
ADD package.json /tmp/package.json
@@ -18,5 +21,4 @@ ENTRYPOINT ["/sbin/tini", "--"]
1821

1922
# NodeJS launch
2023
USER node
21-
ENV NODE_ENV production
22-
CMD ["node", "--max-old-space-size=2048", "dist/daemons/candles/index.js"]
24+
CMD ["npm", "run", "candles"]

src/daemons/pairs/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM node:10-alpine
22

3+
# pg-native
4+
RUN apk --no-cache add make python gcc postgresql-dev g++
5+
36
# enable node_modules caching layer
47
RUN apk add --no-cache tini git
58
ADD package.json /tmp/package.json
@@ -18,5 +21,4 @@ ENTRYPOINT ["/sbin/tini", "--"]
1821

1922
# NodeJS launch
2023
USER node
21-
ENV NODE_ENV production
22-
CMD ["node", "--max-old-space-size=2048", "dist/daemons/pairs/index.js"]
24+
CMD ["npm", "run", "pairs"]

src/http/_common/filters/filters.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { DEFAULT_MAX_LIMIT } from './';
1212
import { CommonFilters } from './types';
1313

1414
// default limit is 100
15-
const limitFilter =
15+
export const limit =
1616
(max: number): CommonFilters['limit'] =>
1717
(raw) => {
1818
if (isNil(raw)) {
@@ -30,25 +30,25 @@ const limitFilter =
3030
};
3131

3232
// default sort is SortOrder.Descending
33-
const sortFilter: CommonFilters['sort'] = (s) =>
33+
const sort: CommonFilters['sort'] = (s) =>
3434
typeof s === 'undefined'
3535
? ok(undefined)
3636
: isSortOrder(s)
3737
? ok(s)
3838
: error(new ParseError(new Error('Invalid sort value')));
3939

40-
const afterFilter: CommonFilters['after'] = parseTrimmedStringIfDefined;
40+
const after: CommonFilters['after'] = parseTrimmedStringIfDefined;
4141

4242
export default {
4343
timeStart: parseDate,
4444
timeEnd: parseDate,
4545
blockTimeStart: parseDate,
4646
blockTimeEnd: parseDate,
47-
limit: limitFilter(DEFAULT_MAX_LIMIT),
47+
limit: limit(DEFAULT_MAX_LIMIT),
4848
sender: parseTrimmedStringIfDefined,
4949
senders: parseArrayQuery,
50-
sort: sortFilter,
51-
after: afterFilter,
50+
sort,
51+
after,
5252
ids: parseArrayQuery,
5353
query: parseTrimmedStringIfDefined,
5454
};

src/http/pairs/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import { parseArrayQuery, parseBool, parsePairs } from '../../utils/parsers';
1111
import { ParseArrayQuery } from '../../utils/parsers/parseArrayQuery';
1212
import { parseFilterValues } from '../_common/filters';
1313
import { ParsedFilterValues, Parser } from '../_common/filters/types';
14-
import commonFilters from '../_common/filters/filters';
14+
import commonFilters, { limit } from '../_common/filters/filters';
1515
import { withMatcher } from '../_common/utils';
1616

17+
const PAIRS_MAX_LIMIT = 1000;
18+
1719
export type ParseMatchExactly = Parser<boolean[]>;
1820
export const parseMatchExactly: ParseMatchExactly = (
1921
matchExactlyRaw?: string
@@ -40,6 +42,7 @@ export const mgetOrSearchParser = parseFilterValues({
4042
match_exactly: parseMatchExactly,
4143
search_by_asset: commonFilters.query,
4244
search_by_assets: parseArrayQuery as ParseArrayQuery, // merge function type and overloads
45+
limit: limit(PAIRS_MAX_LIMIT),
4346
});
4447

4548
type ParserFnType = typeof mgetOrSearchParser;

0 commit comments

Comments
 (0)