Skip to content

Commit e6ef7f4

Browse files
authored
Merge pull request #124 from bitholla/testnet
HollaEx Kit v1.4.0
2 parents fdf8a27 + 50e9acd commit e6ef7f4

File tree

193 files changed

+7125
-1584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+7125
-1584
lines changed

.env.example

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

.eslintrc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true,
7+
"mocha": true
8+
},
9+
"extends": "eslint:recommended",
10+
"parserOptions": {
11+
"ecmaVersion": 9,
12+
"sourceType": "module"
13+
},
14+
"rules": {
15+
"indent": [
16+
"warn",
17+
"tab",
18+
{
19+
"SwitchCase": 1
20+
}
21+
],
22+
"linebreak-style": [
23+
"warn",
24+
"unix"
25+
],
26+
"quotes": [
27+
"warn",
28+
"single"
29+
],
30+
"semi": [
31+
"warn",
32+
"always"
33+
]
34+
}
35+
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ templates/local/letsencrypt/*
3232

3333
templates/kubernetes/config/*
3434

35-
.DS_Store
35+
.DS_Store
36+
37+
.token
38+
backups

.prettierignore.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"tabWidth": 3,
3+
"useTabs": true,
4+
"semi": true,
5+
"singleQuote": true,
6+
"bracketSpacing": true,
7+
"arrowParens": "always"
8+
}

.sequelizerc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
'config': path.resolve('config', 'db.js'),
5+
'migrations-path': path.resolve('db', 'migrations'),
6+
'models-path': path.resolve('db', 'models'),
7+
'seeders-path': path.resolve('db', 'seeders'),
8+
};

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM bitholla/hollaex-core:1.22.0
22

3+
RUN apt-get update && apt-get install -y git
4+
35
COPY ./mail /app/mail
46

57
COPY ./plugins /app/plugins
@@ -12,6 +14,7 @@ COPY ./db/models /app/db/models
1214

1315
EXPOSE 10011
1416

15-
RUN cd plugins && npm install --loglevel=error && \
17+
RUN npm install -g nodemon --loglevel=error && \
18+
cd plugins && npm install --loglevel=error && \
1619
for d in ./*/ ; do (cd "$d" && npm install --loglevel=error); done && \
1720
cd /app/mail && npm install --loglevel=error
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
3+
const TABLE = 'Users';
4+
const COLUMN = 'custom_fee';
5+
6+
module.exports = {
7+
up: (queryInterface, Sequelize) => queryInterface.addColumn(
8+
TABLE,
9+
COLUMN,
10+
{
11+
type: Sequelize.BOOLEAN,
12+
defaultValue: false,
13+
}
14+
),
15+
down: (queryInterface) => queryInterface.removeColumn(TABLE, COLUMN),
16+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
'use strict';
2+
3+
module.exports = {
4+
up: (queryInterface, Sequelize) => {
5+
return queryInterface.createTable(
6+
'Fees',
7+
{
8+
id: {
9+
allowNull: false,
10+
autoIncrement: true,
11+
primaryKey: true,
12+
type: Sequelize.INTEGER
13+
},
14+
user_id: {
15+
type: Sequelize.INTEGER,
16+
onDelete: 'CASCADE',
17+
allowNull: false,
18+
references: {
19+
model: 'Users',
20+
key: 'id'
21+
}
22+
},
23+
transaction_id: {
24+
type: Sequelize.STRING,
25+
allowNull: false
26+
},
27+
amount: {
28+
type: Sequelize.DOUBLE,
29+
allowNull: false
30+
},
31+
currency: {
32+
type: Sequelize.STRING,
33+
allowNull: false
34+
},
35+
timestamp: {
36+
type: Sequelize.DATE,
37+
allowNull: false,
38+
defaultValue: Sequelize.literal('NOW()')
39+
}
40+
},
41+
{
42+
timestamps: true,
43+
underscored: true
44+
}
45+
);
46+
},
47+
down: (queryInterface) => queryInterface.dropTable('Fees')
48+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use strict';
2+
3+
const TABLE = 'Fees';
4+
5+
module.exports = {
6+
up: (queryInterface) => {
7+
return queryInterface.sequelize.query(
8+
`
9+
INSERT INTO "${TABLE}" (user_id, transaction_id, amount, currency)
10+
Select 1, 'init', 0, 'init' Where exists (SELECT * FROM "Users")
11+
;`
12+
);
13+
},
14+
down: () => {
15+
return new Promise((resolve) => {
16+
resolve();
17+
});
18+
}
19+
};

0 commit comments

Comments
 (0)