Skip to content

Commit fdf8a27

Browse files
authored
Merge pull request #91 from bitholla/testnet
Kit v1.3 Release
2 parents d0b8e8f + 645d2d6 commit fdf8a27

File tree

249 files changed

+6753
-1116
lines changed

Some content is hidden

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

249 files changed

+6753
-1116
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ templates/local/*.env.local
3131
templates/local/letsencrypt/*
3232

3333
templates/kubernetes/config/*
34+
35+
.DS_Store

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
FROM bitholla/hollaex-core:1.20.7
2-
3-
RUN rm -rf /app/mail
1+
FROM bitholla/hollaex-core:1.22.0
42

53
COPY ./mail /app/mail
64

75
COPY ./plugins /app/plugins
86

9-
EXPOSE 10011
7+
COPY ./db/migrations /app/db/migrations
108

11-
RUN cd plugins && npm install
9+
COPY ./db/seeders /app/db/seeders
1210

13-
RUN cd plugins && for d in ./*/ ; do (cd "$d" && npm install); done
11+
COPY ./db/models /app/db/models
12+
13+
EXPOSE 10011
1414

15-
RUN cd mail && npm install
15+
RUN cd plugins && npm install --loglevel=error && \
16+
for d in ./*/ ; do (cd "$d" && npm install --loglevel=error); done && \
17+
cd /app/mail && npm install --loglevel=error
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
'use strict';
2+
3+
module.exports = {
4+
up: (queryInterface, Sequelize) => {
5+
return queryInterface.createTable(
6+
'Users',
7+
{
8+
id: {
9+
allowNull: false,
10+
autoIncrement: true,
11+
primaryKey: true,
12+
type: Sequelize.INTEGER
13+
},
14+
email: {
15+
type: Sequelize.STRING,
16+
allowNull: false,
17+
unique: true
18+
},
19+
password: {
20+
type: Sequelize.STRING,
21+
allowNull: false
22+
},
23+
first_name: {
24+
type: Sequelize.STRING,
25+
defaultValue: ''
26+
},
27+
last_name: {
28+
type: Sequelize.STRING,
29+
defaultValue: ''
30+
},
31+
gender: {
32+
type: Sequelize.BOOLEAN,
33+
defaultValue: false
34+
},
35+
nationality: {
36+
type: Sequelize.STRING,
37+
defaultValue: ''
38+
},
39+
dob: {
40+
type: Sequelize.DATE
41+
},
42+
address: {
43+
type: Sequelize.STRING,
44+
defaultValue: ''
45+
},
46+
phone_number: {
47+
type: Sequelize.STRING,
48+
defaultValue: ''
49+
},
50+
id_type: {
51+
type: Sequelize.STRING,
52+
defaultValue: ''
53+
},
54+
id_number: {
55+
type: Sequelize.STRING,
56+
defaultValue: ''
57+
},
58+
bank_name: {
59+
type: Sequelize.STRING,
60+
defaultValue: ''
61+
},
62+
crypto_wallet: {
63+
type: Sequelize.JSONB,
64+
defaultValue: {}
65+
},
66+
bank_account_number: {
67+
type: Sequelize.STRING,
68+
defaultValue: ''
69+
},
70+
verification_level: {
71+
type: Sequelize.INTEGER,
72+
defaultValue: 0
73+
},
74+
note: {
75+
type: Sequelize.STRING,
76+
defaultValue: ''
77+
},
78+
created_at: {
79+
allowNull: false,
80+
type: Sequelize.DATE,
81+
defaultValue: Sequelize.literal('NOW()')
82+
},
83+
updated_at: {
84+
allowNull: false,
85+
type: Sequelize.DATE,
86+
defaultValue: Sequelize.literal('NOW()')
87+
}
88+
},
89+
{
90+
timestamps: true,
91+
underscored: true
92+
}
93+
);
94+
},
95+
down: (queryInterface, Sequelize) => queryInterface.dropTable('Users')
96+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
'use strict';
2+
3+
module.exports = {
4+
up: (queryInterface, Sequelize) => {
5+
return queryInterface.createTable(
6+
'Orders',
7+
{
8+
id: {
9+
allowNull: false,
10+
unique: true,
11+
primaryKey: true,
12+
type: Sequelize.UUID
13+
},
14+
created_by: {
15+
type: Sequelize.INTEGER,
16+
onDelete: 'CASCADE',
17+
allowNull: false,
18+
references: {
19+
model: 'Users',
20+
key: 'id'
21+
}
22+
},
23+
side: {
24+
type: Sequelize.ENUM('buy', 'sell'),
25+
allowNull: false
26+
},
27+
type: {
28+
type: Sequelize.ENUM('market', 'limit'),
29+
allowNull: false
30+
},
31+
size: {
32+
type: Sequelize.BIGINT,
33+
allowNull: false
34+
},
35+
price: {
36+
type: Sequelize.INTEGER,
37+
allowNull: false
38+
},
39+
created_at: {
40+
allowNull: false,
41+
type: Sequelize.DATE,
42+
defaultValue: Sequelize.literal('NOW()')
43+
},
44+
updated_at: {
45+
allowNull: false,
46+
type: Sequelize.DATE,
47+
defaultValue: Sequelize.literal('NOW()')
48+
}
49+
},
50+
{
51+
timestamps: true,
52+
underscored: true
53+
}
54+
);
55+
},
56+
down: (queryInterface, Sequelize) => queryInterface.dropTable('Orders')
57+
};
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
'use strict';
2+
3+
module.exports = {
4+
up: (queryInterface, Sequelize) => {
5+
return queryInterface.createTable(
6+
'Trades',
7+
{
8+
id: {
9+
allowNull: false,
10+
autoIncrement: true,
11+
primaryKey: true,
12+
type: Sequelize.INTEGER
13+
},
14+
maker_id: {
15+
type: Sequelize.INTEGER,
16+
allowNull: false,
17+
references: {
18+
model: 'Users',
19+
key: 'id'
20+
}
21+
},
22+
taker_id: {
23+
type: Sequelize.INTEGER,
24+
allowNull: false,
25+
references: {
26+
model: 'Users',
27+
key: 'id'
28+
}
29+
},
30+
side: {
31+
type: Sequelize.ENUM('buy', 'sell'),
32+
allowNull: false
33+
},
34+
size: {
35+
type: Sequelize.BIGINT,
36+
allowNull: false
37+
},
38+
price: {
39+
type: Sequelize.INTEGER,
40+
allowNull: false
41+
},
42+
timestamp: {
43+
defaultValue: Sequelize.literal('NOW()'),
44+
allowNull: false,
45+
type: Sequelize.DATE
46+
}
47+
},
48+
{
49+
timestamps: false,
50+
underscored: true
51+
}
52+
);
53+
},
54+
down: (queryInterface, Sequelize) => queryInterface.dropTable('Trades')
55+
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
'use strict';
2+
3+
const { DataTypes } = require('sequelize');
4+
const { BALANCE_KEYS } = require('../../constants');
5+
6+
const balances = {};
7+
BALANCE_KEYS.forEach(balance => {
8+
balances[balance] = {
9+
type: DataTypes.DOUBLE,
10+
allowNull: false,
11+
defaultValue: 0
12+
};
13+
});
14+
15+
module.exports = {
16+
up: (queryInterface, Sequelize) => {
17+
return queryInterface.createTable(
18+
'Balances',
19+
{
20+
id: {
21+
allowNull: false,
22+
autoIncrement: true,
23+
primaryKey: true,
24+
type: Sequelize.INTEGER
25+
},
26+
user_id: {
27+
type: Sequelize.INTEGER,
28+
onDelete: 'CASCADE',
29+
allowNull: false,
30+
unique: true,
31+
references: {
32+
model: 'Users',
33+
key: 'id'
34+
}
35+
},
36+
created_at: {
37+
allowNull: false,
38+
type: Sequelize.DATE,
39+
defaultValue: Sequelize.literal('NOW()')
40+
},
41+
updated_at: {
42+
allowNull: false,
43+
type: Sequelize.DATE,
44+
defaultValue: Sequelize.literal('NOW()')
45+
}
46+
},
47+
{
48+
timestamps: true,
49+
underscored: true
50+
}
51+
);
52+
},
53+
down: (queryInterface, Sequelize) => queryInterface.dropTable('Balances')
54+
};
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
'use strict';
2+
3+
module.exports = {
4+
up: (queryInterface, Sequelize) => {
5+
return queryInterface.createTable(
6+
'Deposits',
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+
address: {
24+
type: Sequelize.STRING,
25+
defaultValue: ''
26+
},
27+
transaction_id: {
28+
type: Sequelize.STRING,
29+
allowNull: false
30+
},
31+
status: {
32+
type: Sequelize.BOOLEAN,
33+
defaultValue: false
34+
},
35+
amount: {
36+
type: Sequelize.DOUBLE,
37+
allowNull: false
38+
},
39+
type: {
40+
type: Sequelize.STRING,
41+
allowNull: false
42+
},
43+
currency: {
44+
type: Sequelize.STRING,
45+
allowNull: false
46+
},
47+
created_at: {
48+
allowNull: false,
49+
type: Sequelize.DATE,
50+
defaultValue: Sequelize.literal('NOW()')
51+
}
52+
},
53+
{
54+
timestamps: true,
55+
underscored: true
56+
}
57+
);
58+
},
59+
down: (queryInterface, Sequelize) => queryInterface.dropTable('Deposits')
60+
};

0 commit comments

Comments
 (0)