Skip to content

Commit

Permalink
Merge pull request #1135 from bitholla/testnet
Browse files Browse the repository at this point in the history
Testnet
  • Loading branch information
abeikverdi committed Dec 29, 2021
2 parents bfe109c + ec4fc97 commit 11fce64
Show file tree
Hide file tree
Showing 81 changed files with 1,594 additions and 559 deletions.
47 changes: 47 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,51 @@ trigger:
event:
- push

---

kind: pipeline
type: docker
name: kit_v2_next_deployment

steps:
- name: slack_noti_job_start
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
template: "<{{build.link}}|HollaEx v2 Next Test Exchange Deployment> - #{{build.number}} started on <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}} / {{build.branch}}> by {{build.author}}"

- name: partymaker_version_tag
image: alpine
commands:
- echo "$(cat version)-next" > .tags
- echo "Current version tag is :" && cat .tags

- name: request_hollacloud_to_run_upgrade
image: bitholla/devops-tools:drone_hollacloud-201007
environment:
HOLLAEX_EMAIL:
from_secret: next_email
HOLLAEX_PASSWORD:
from_secret: next_password
settings:
exchange_id: 539
exchange_name: "Next"

- name: slack_noti_job_end
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
when:
status: [success, failure]

trigger:
branch:
- next
event:
- push


4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Join us on the [Forum](https://forum.hollaex.com) and [Discord](https://discord.
## Useful Links

- Exchange Dashboard: https://dash.hollaex.com
- HollaEx Whitepaper: https://hollaex.com/docs/whitepaper.html
- HollaEx Live Exchange: https://hollaex.com
- HollaEx Whitepaper: https://whitepaper.hollaex.com
- HollaEx Live Exchange: https://pro.hollaex.com/trade/xht-usdt
- Discord Community: https://discord.gg/RkRHU8RbyM
- Forum: https://forum.hollaex.com
- Docs: https://docs.hollaex.com
5 changes: 4 additions & 1 deletion server/api/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,13 +805,16 @@ const getExchangeGeneratedFees = (req, res) => {
};

const settleFees = (req, res) => {
const { user_id } = req.swagger.params;
loggerAdmin.verbose(
req.uuid,
'controllers/admin/settleFees auth',
req.auth
req.auth,
user_id.value
);

toolsLib.order.settleFees({
user_id: user_id.value,
additionalHeaders: {
'x-forwarded-for': req.headers['x-forwarded-for']
}
Expand Down
8 changes: 7 additions & 1 deletion server/api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: "2.0"
info:
version: "2.2.6"
version: "2.2.7"
title: HollaEx Kit
host: api.hollaex.com
basePath: /v2
Expand Down Expand Up @@ -2066,6 +2066,12 @@ paths:
description: Settle exchange fees
tags:
- Admin
parameters:
- in: query
name: user_id
required: false
type: number
format: int32
responses:
200:
description: Success
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.2.6",
"version": "2.2.7",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
10 changes: 8 additions & 2 deletions server/utils/nodeLib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ class HollaExNetwork {
return createRequest(verb, `${this.apiUrl}${path}`, headers);
}

/**
/**
* Get all deposits for a user on the network
* @param {number} userId - User id on network. Leave blank to get all deposits for the exchange
* @param {object} opts - Optional parameters.
Expand Down Expand Up @@ -2287,16 +2287,22 @@ class HollaExNetwork {
/**
* Settle exchange fees
* @param {object} opts - Optional parameters.
* @param {object} opts.user_id - user id that receives the fee earnings.
* @param {object} opts.additionalHeaders - Object storing addtional headers to send with request.
* @return {object} Object with settled fees.
*/
settleFees(opts = {
user_id: null,
additionalHeaders: null
}) {
checkKit(this.exchange_id);
const verb = 'GET';

const path = `${this.baseUrl}/network/${this.exchange_id}/fees/settle`;
let path = `${this.baseUrl}/network/${this.exchange_id}/fees/settle?`;

if (opts.user_id) {
path += `&user_id=${opts.user_id}`;
}

const headers = generateHeaders(
isPlainObject(opts.additionalHeaders) ? { ...this.headers, ...opts.additionalHeaders } : this.headers,
Expand Down
19 changes: 17 additions & 2 deletions server/utils/toolsLib/tools/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,25 @@ const getGeneratedFees = (startDate, endDate, opts = {
});
};

const settleFees = (opts = {
const settleFees = async (opts = {
additionalHeaders: null
}) => {
return getNodeLib().settleFees(opts);
let network_id = null;
if (opts.user_id) {
const user = await getUserByKitId(opts.user_id, false);
if (!user) {
throw new Error(USER_NOT_FOUND);
} else if (!user.network_id) {
throw new Error(USER_NOT_REGISTERED_ON_NETWORK);
} else {
network_id = user.network_id;
}
}

return getNodeLib().settleFees({
additionalHeaders: opts.additionalHeaders,
user_id: network_id
});
};

const generateOrderFeeData = (userTier, symbol, opts = { discount: 0 }) => {
Expand Down
4 changes: 2 additions & 2 deletions settings/configmap
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ENVIRONMENT_DOCKER_COMPOSE_RUN_POSTGRESQL_DB=true
ENVIRONMENT_DOCKER_COMPOSE_RUN_REDIS=true

ENVIRONMENT_KUBERNETES_RUN_POSTGRESQL_DB=true
ENVIRONMENT_KUBERNETES_POSTGRESQL_DB_VOLUMESIZE=50Gi
ENVIRONMENT_KUBERNETES_POSTGRESQL_DB_VOLUMESIZE=4Gi

ENVIRONMENT_KUBERNETES_RUN_REDIS=true

Expand Down Expand Up @@ -125,7 +125,7 @@ ENVIRONMENT_API_CPU_REQUESTS=0.05
ENVIRONMENT_API_MEMORY_REQUESTS=512Mi

ENVIRONMENT_STREAM_CPU_LIMITS=0.1
ENVIRONMENT_STREAM_MEMORY_LIMITS=256Mi
ENVIRONMENT_STREAM_MEMORY_LIMITS=512Mi
ENVIRONMENT_STREAM_CPU_REQUESTS=0.05
ENVIRONMENT_STREAM_MEMORY_REQUESTS=256Mi

Expand Down
10 changes: 10 additions & 0 deletions templates/local/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"';

limit_req_zone $remote_addr zone=api:1m rate=4r/s;
limit_req_zone $remote_addr zone=sms:1m rate=1r/m;

server {

Expand Down Expand Up @@ -82,6 +83,15 @@ server {
proxy_pass http://plugins;
}

location /plugins/sms/verify {
limit_req zone=sms burst=1 nodelay;
limit_req_log_level info;
limit_req_status 429;

proxy_pass http://plugins;

}

error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
Expand Down
24 changes: 12 additions & 12 deletions test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions test/selenium/Onboarding/AccountLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ async function AccountLevel () {
let passWord = process.env.PASSWORD;
let logInPage = process.env.LOGIN_PAGE;
let Website = process.env.WEBSITE;
//let browser = process.env.BROWSER;
let browser = 'MicrosoftEdge';
let step = util.getStep();
util.logHolla(logPath)

Expand All @@ -33,12 +35,12 @@ async function AccountLevel () {
});
}
beforeEach(async function() {
driver = await new Builder().forBrowser('chrome').build();
driver = await new Builder().forBrowser(browser).build();
driver.manage().window().maximize();
vars = {};
});
afterEach(async function() {
//await driver.quit();
await driver.quit();
});
it('Account Level', async function() {
console.log('Supervisor can access all deposit, withdrawals and approval settings');
Expand Down
11 changes: 6 additions & 5 deletions test/selenium/Onboarding/ChatBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let userName = process.env.ADMIN_USER;
let passWord = process.env.ADMIN_PASS;
let logInPage = process.env.LOGIN_PAGE;
let Remot = process.env.SELENIUM_REMOTE_URL;
let browser = process.env.BROWSER;
describe('Orders', function() {
this.timeout(30000);
let driver;
Expand All @@ -31,7 +32,7 @@ describe('Orders', function() {
});

it('firefox', async function() {
// driver = await new Builder().forBrowser('chrome').build();
// driver = await new Builder().forBrowser(browser).build();
driver = await new Builder().forBrowser('firefox').usingServer(Remot).build();


Expand Down Expand Up @@ -64,9 +65,9 @@ describe('Orders', function() {
assert(elements.length)
}
})
it('chrome', async function() {
// driver = await new Builder().forBrowser('chrome').build();
driver = await new Builder().forBrowser('chrome').usingServer(Remot).build();
it(browser, async function() {
// driver = await new Builder().forBrowser(browser).build();
driver = await new Builder().forBrowser(browser).usingServer(Remot).build();


//driver = await new RemoteWebDriver(new URL("https://3.37.238.142:4444/wd/hub"), capability);
Expand Down Expand Up @@ -101,7 +102,7 @@ describe('Orders', function() {
}
})
it('Edge', async function() {
// driver = await new Builder().forBrowser('chrome').build();
// driver = await new Builder().forBrowser(browser).build();
driver = await new Builder().forBrowser('MicrosoftEdge').usingServer(Remot).build();


Expand Down
12 changes: 7 additions & 5 deletions test/selenium/Onboarding/LogIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ async function LogIn () {
let passWord = process.env.PASSWORD;
let logInPage = process.env.LOGIN_PAGE;
let emailPass =process.env.EMAIL_PASS ;
let emailAdmin = process.env.EMAIL_ADMIN_USERNAME
let emailAdmin = process.env.EMAIL_ADMIN_USERNAME;
let browser = process.env.BROWSER;
let step = util.getStep();
util.logHolla(logPath)

describe('BobLogIn', function() {
this.timeout(100000);
this.timeout(200000);
let driver;
let vars;
function sleep(ms) {
Expand All @@ -36,18 +37,19 @@ async function LogIn () {
}
function shot(){util.takeHollashot(driver,reportPath,step);}
beforeEach(async function() {
driver = await new Builder().forBrowser('chrome').build();
driver = await new Builder().forBrowser(browser).build();
vars = {};
driver.manage().window().maximize();
let step = util.getStep()
});

afterEach(async function() {
util.setStep(step);
await sleep(10000)
await driver.quit();
});

it('Simple log in', async function() {
it('Bob Simple Log In', async function() {
//Given User's data
console.log(' Test name : BobLogIn');
console.log(logInPage);
Expand Down Expand Up @@ -97,7 +99,7 @@ async function LogIn () {
console.log('This is the EndOfTest');

});
it('Email Confirmation', async function() {
it('Email Confirmation For Log In', async function() {
console.log('Test name: Confirmation');
console.log('Step # | name | target | value');

Expand Down
Loading

0 comments on commit 11fce64

Please sign in to comment.