Skip to content

Commit

Permalink
Release Alpha 2.0 (#97)
Browse files Browse the repository at this point in the history
* fix: changed util path name

* feat: change size of chart line

* feat: added width of asset

* feat: added styles for centering content

* chore: removed reduntant files from utils/proto

* feat: chart shows first asset from wallet

* feat: removed checking to action

* chore: added constants for accounts

* feat: cryptoUtil don't access directly to local storage

* test: fixed tests

* chore: favicon

* fix: changed to VUE_APP_ since they are only visible

* chore: command to surely build this app

* hack: CORS for devserver :)

* fix: build with all memory :)

* chore: new tokens

* feat: correct position of pie chart

* feat: removed dots settings

* chore: redesign accounts consts

* chore: removed not needed dev server option

* fix: change change pie -> donat

* fix: storage don't make actions if wallets empty

* fix: added font-style IBM

* fix: change styles for table list

* fix: change font

* chore: updated dependencies

* chore: import per icon

* chore: change chains to flow

* feat: allow users to download reports as PDF/CSV

* fix: use file-saver

* feat: calculate the values of a report

* feat: move report-util to mixins

* feat: pdfmake

* test: report-util

* feat: PDF output

* feat: CSV output

* fix: allow only one wallet to be selected

* fix: small pdf styling

* feat: use settings value instead of USD being fixed

* feat: list the previous month's reports

* fix: use Dashboard store's price list

* chore: add informative comments to report-util

* refactor: use fp-style

* chore: add an explanation for generateReportData

* chore: remove unnecessary import

* chore: pdfmake -> pdfmake.min

* test: include repor-util to coverage report

* chore: import only required elements from element.ui

* chore: removed locale from moment and reduced date-fns size

* chore: added lazy loading of components

* fix: remove hardCache

* fix: correct args position

* feat: Removed iroha-amount  since it is no more needed

* feat: new proto files

* feat: new proto files in iroha-util

* fix: removed iroha-amount from files

* feat: updated iroha-lib

* chore: small improvements to setup script

* feat: reduced payload

* fix: tests

* chore: removed pub keys since they are not needed

* feat: setAccountDetail for script/etc. (we can use it later)

* feat: qr code

* chore: setting eth address for fake accounts

* feat: deposit wallet + withdrawal to notary_red

* chore: removed unused file

* feat: crypto-list

* feat: asset list

* feat: cool precision, amount as string

* feat: cool text for deposit/withdrawals

* fix: amount as string (because of Iroha)

* fix: tests

* fix: typo

* fix: description as string

* fix: amount as string

* fix: find in fp style

* chore: updated readme

* feat: change chartjs to echarts

* chore: minified version

* feature: used query-helper instead of iroha-lib :)

* feat: transactions, new version of ed

* chore: transfered proto files

* feat: correct signing in tx/queries, new proto file.

* chore: update to setup-script, so it can work with import-exports.

* feat: tx-s without iroha-lib

* feat: update dependencies + new dependencies.

* feat: helper for transformation array to hexstring

* feat: no iroha-lib :), added google-protobuf

* fix: exports

* chore: unneeded console.log

* feat: import + exports, crypto key generation.

* fix: import-exports

* feat: NO linting for generated proto files

* chore: moved iroha-helpers to the external dependency

* chore: updated some packages.

* chore: iroha-helpers update

* fix: fixed setup script

* fix: date-fns imports

* feat: cherry-pick

* fix: get daily prices before generating a report

* fix: disable days after today

because there are no history

* test: update a fixture of report-util

* fix: cherry-picking make csv lighter

* fix: add balanceFiat to transactionDetails

* fix: include the first day in range

* chore: insert an issue link to font-util.js

* fix: pass timestamps as seconds

* fix: the end timestamp of an arbitarary time range

* feat: select the first wallet by default

* feat: add NoAssetsCard to the report page

* fix: assetId instead of wallets.name, so reports functionality works.

* Fix/tests broken by iroha-util (#34)

* We have fixed tests, broken by exports in iroha-util. Also, we have disabled reports test for now since there are problems with dates/prices.

Report-util has skipped test now

* Feature/d3 146 interface fixes (#26)

* feat: added file button

* feat: on wallets page show first wallet

* feat: move exchangeModal to Home.vue

* feat: update form width

* fix: set fixed width to private key modal

* feat: get API prices for asset to exchange

* fix: open another wallets if current is empty

* fix: remove comments

* feat: remove feature back to first if wallet balance equal zero

* feat: remove redundant calculation

* feat: update styles of donut chart legend

* fix: fixed styles of donut chart

* feat: change username when new file selected

* feat: show zero instead N/A

* fix: added function to return zero instead of NaN

* feat: change key value

* Feature/pipeline (#32)

* Pipeline

Signed-off-by: Alexey Rodionov <[email protected]>

* Feature/d3 150 form validation (#27)

* feat: added inputValidation mixin
* feat: added validation to form components
* feat: change error position
* feat: added balance validation
* feat: added rules for validator
* feat: fields reset on close
* fix: correct error labels position
* feat: exchange modal validate fields correctly
* fix: change pattern for nodeIp validation
* fix: checking exchangeForm
* fix: added prop for form-item
* ffeat: remove http regex validation
* feat: added validation for percission

* Feature/e2e tests pipeline (#38)

test:e2e pipeline

Signed-off-by: Alexey Rodionov <[email protected]>

* test: added cypress for e2e

* test: added first e2e tests, removed nightwatch

* chore: add width to cypress

* fix: fixing E2E

* test: skipping one test

* test: change url

* test: change url

* chore: remove redundant -url option

* test: added CYPRESS env variable

* chore: script don't work with import\from

* test: fixed element query selector

* test: change test to be equal url not page name

* Compose tests (#39)

* E2E tests

Signed-off-by: Alexey Rodionov <[email protected]>

* upload develop version

Signed-off-by: Alexey Rodionov <[email protected]>

* uncomment missing steps

Signed-off-by: Alexey Rodionov <[email protected]>

* chore: fixed import of ed

* chore: updated dependencies

* chore: update yarn.lock

* chore: update gitignore for cypress

* test: added cypress env

* test: added fake queries for API

* test: added test for checking validation of fields

* test: added new tests for modals

* test: fix typo

* test: change url

* test: changed json env to process env

* test: fix typo in test name

* test: add before statement

* fix: don't show "no wallets" card if dashboard is loading (#42)

* test: e2e test for reports page

* test: reports page

* feat: new report

* test: new report

* test: force to select a timezone

* test: verify the previous month's reports to be listed

* refactor: add shouldDownload command

* test: take .skip off from report-util.spec

* fix: fix dates in a fixture into UTC+0

* test: force the formatter to treat dates as UTC+0

* test: rebase with #28

* test: use Etc/GMT instead of Etc/UTC or UTC

* test: do not create PDF in e2e testing

* D3-284 | Streaming of TX statuses (#41)

* feat: streaming for status check isntead of single status check

* fix: clearTimeout to keep consistency and avoid problems in future

* D3-274 | Wrong colors of login button on hover (#43)

* D3-265 | Feature white list (#37)

* feat: added getter for white list

* feat: changed withdraw wallet input to select

* feat: added settings param like privacy with list of avaliable wallets

* feat: added eth_whitelist to setAccountDetail

* feat: return empty array when white list empty

* feat: added validation for BTC wallets

* feat: added input area when there empty white list

* feat: added splitting for white list wallets

* feat: removed console.log

* feat: fixed withdrawWalletAddresses

* chore: update eth white list address

* test: added fixtures for non white list tests

* test: fixed tests due to white list select field

* feat: added id to timezone select field

* test: changed get query from class to id

* feat: changed placeholder text

* feat: changed select element to tags element

* test: trying to fix CI

* test: check login on url

* test: order consistency change

* FIX - Updated iroha-utils (#45)

* feat: updated iroha-helpers

* fix: updated object keys due to new genesis.block

* fix: increased time of time lmit

* fix: update genesis block to match latest notary

* Feature/artifacts (#47)

* Upload videos from E2E tests to Nexus

Signed-off-by: Alexey Rodionov <[email protected]>

* fix: updated iroha-helpers v0.1.1 (#46)

* fix: updated iroha-helpers v0.1.1

* fix: now transferForm.description sets correctly

* fix: now transactions signed with correct key

* D3-338 | Update grpc web (#49)

* feat: upgrade grpc-web-client

* feat: removed not needed setTimeout since grpc-web is updated.

* D3-237, D3-232 | Add markup for pages (#40)

* feat: added new icon for menu

* feat: added transaction page

* feat: added route for transaction page

* feat: added getPendingTransactions method

* feat: removed setting quorum directly

* chore: added method to set account quorum

* test: updated test to new account storage

* feat: added label of amount of private keys needed

* feat: updated width of columns

* D3-238 | Logic for Multisign Transactions (#48)

* feat: added transaction page

* feat: added multisign, now iroha support array of private keys

* feat: rename argument privateKey to privateKeys

* feat: each input field works with it own privateKey data

* feat: changes privateKey to privateKeys

* feat: added setAccountQuorum

* fix: add requred permissions to tester

* feat: addSignatory method

* feat: removed console.log

* chore: added wrapper for adding signature and quorum

* feat: added quorum argument to command function

* feat: added filter that shows the amount of keys was filled

* feat: passed quorum as argument due to iroha-util update

* feat: added placeholder for withdraw amount input

* feat: added reset of the description field for the exchange form

* test: changed css selector to get item of menu

* test: changed amount of tokens to smaller value

* feat: removed code dublication after rebase

* feat: added correct representation of decimal numbers

* chore: add informative tooltips to a market card to make sure value
to show

* feat: make a market card date-configurable

* feat: calculate volumes with historical data

* feat: word-break

* fix: market card's labels

* feat: align contents of a market card

* Divide iroha-util (#51)

* feat: iroha-util devided into several files

* fix: remove default export from files

* feat: changed path to iroha-util

* feat: removed iroha-util

* fix: text in a tooltip

* fix: replace rur with fiat

* D3-339 | Remove localStorage from iroha-utils (#50)

* feat: added method setStringifyItem

* feat: rename method due to storage-util update

* feat: removed localStorage

* fix: using wrong method in setParsedItem

* feat: rebased, removed local storage

* feat: remove iroha-util

* [D3-279] wallet list (#53)

* feat: add a sort button to the wallet list

* feat: add sort criteria

* feat: add sort criteria

* fix: delete active item black underlining

* feat: save the sort criterion

* test: E2E tests for sorting

* D3-138 | Settlements creation (#54)

* chore: not needed since iroha-helpers is a separate dependency

* chore: update package

* feat: initial implementation of settlement

* fix: settlement creation

* feat: settlment creation

* chore: dev docker-compose to make life easier

* feat: settlements

* fix: sign now works with all keys.

* fix: exchange rate request not working because of assetID

* fix: correct transaction signing

* feat: MST_PENDING for transactions with not all signatures.

* feat: update iroha-helpers

* [D3-345] multiple keys validation (#55)

* feat: multiple keys validation

* fix: make the before hook called either from Home or from Wallet

* fix: a bug that wallets' sort criterion is not restored

* feat: disable a confirmation button if no keys are entered

* test: e2e tests for approval dialog

* hotfix: fix iroha's docker-image to the specific version

* Revert "hotfix: fix iroha's docker-image to the specific version"

This reverts commit 4bd207e.

* fix: don't fixturize a private key

It seems Cypress fails to upload a file whose path was already fixturized

* fix: reset the number of valid keys on approval dialog's open

* fix: don't call updateNumberOfValidKeys before the dialog is initialized once

* Allow sending transactions with only one key (#59)

* feat: allow sending transactions with only one key

* feat: update the setup script

* feat: filter out empty signatures

* D3-334, D3-234 | Pending transaction getting & signing (#61)

* feat: getting unsigned transactions

* feat: display real data

* fix: removed unused styles

* chore: refactor transaction sending method

* feat: signPendingTransactions

* feat: signing pending part 1

* feat: signing transactions 2

* fix: remove unnused Vue.set

* fix: remove console.log

* chore: renamed function

* chore: dispatch to mapactions

* fix: no message if quorum is large enough

* fix: tests

* D3-347 | Update design due to mockups (#57)

* feat: updated title

* feat: removed unnessary icons

* feat: added logo icons

* feat: added svg icons for menu

* feat: component for svg icons

* feat: updated login screen, changed logo

* feat: update signup screen

* feat: removed menu from home to new component

* feat: added icon for logout

* feat: set position of logout to bottom of menu

* feat: removed unnecessary double declaration

* feat: updated porftolio card

* feat: updated portfolio structure card

* feat: added function to calculate sum of others tokens

* feat: update styles of actions buttons

* feat: added changes to header and buttons

* feat: updated tables, buttons

* feat: set font as primary, add more icons

* feat: updated button and added icons

* feat: updated login page

* feat: table and chart are combined in one card

* feat: added on resize method for resizing dashboard

* feat: now wallets filters works with new design

* feat: fixed size of input field

* feat: updated to new version of cypress

* test: fixed test for wallets page

* test: fixed test for reports page

* test: increase request timeout

* test: change path for wallets

* feat: fix precisions

* feat: update date forma

* feat: updated settlements messages

* feat: removed console.log

* feat: updated font-family to IBM Plex

* fix: fix width of dashboard chart

* feat: added padding for table

* feat: add debounce for resize event

* fix: now check balance works correctly

* feat: increase size of border

* feat: added labels for settings

* feat: new favicon.ico 💖

* feat: update size of pages

* chore: resize of svg images

* feat: update background

* chore: remove css from home to menu

* feat: updated h1

* chore: added text transform

* chore: removed required label

* chore: updated size of button

* fix: fixed no assets card position and removed blinks of dashboard page

* chore: now BasicAttentionToken fits correctly

* chore: removed border-bottom due to mockups

* chore: added currency symbol

* feat: added sorting for dashboard table

* D3-347 | Fixing pr #57 (#63)

* feat: removed console.log and fixed icons

* fix: fixed first loaded icon

* feat: upadted to created

* feat: resize report page on screen size

* [D3-276][D3-393] Portfolio's time range selection and tooltip (#65)

* feat: make a time range selector in a portfolio availbale

* feat: portfolio chart's style

* feat: add tooltip to a portfolio value

* chore: add TODO comment

* feat: adjust yAxis width and some styling

* fix: use histoday as default

* feat: add explanations to tooltips

* Feature/whitelist (#67)

* Implement form for whitelist at signup form

* fixes

* added button for remove the item
little fixes

* Implement form for whitelist at signup form

* fixes

* added button for remove the item
little fixes

* feat: beautiful tags, validation

* feat: cool ui + validation

* fix: validation in wallet

* test: e2e fix + check adding to whitelist

* A report until today (#68)

* feat: enable a report of today

* fix: Moscow Summer Timer problem

* fix: fixture for UTC

* D3 388 | public keys validation (#62)

* feat: pass list of transactions

* fix: safe copy because toObject() mutates object

* fix: assignment instead of comparison

* hack: revert after https://soramitsu.atlassian.net/browse/IR-1680 is commited

* chore: todo/comment

* feat: list of signatures

* chore: setup script

* chore: expose iroha's port in dev container (for debugging)

* feat: same private key validation

* fix: empty key

* fix: making things bEaUtIfUl

* fix: beforeUpdate -> beforeApprovalDialogOpen :)

* fix: tests (pubkey -> publicKey)

* [D3-412] Handle registration failures (#69)

* fix: catch notary-util's errors at the higher layer

* test: signup should fail if notary-util fails

* test: fix an e2e test

* Feature/move to aws (#73)

* Move pipeline to AWS

Signed-off-by: Alexey Rodionov <[email protected]>

* Make the registration service ip changeable (#70)

* feat: install $prompt

ElemeFE/element#2024

* feat: make registration ip changable

* fix: unit tests

* D3-392 | Fixing several dashboard issues (#64)

* feat: don't show empty wallets

* fix: fix button that add address to whitelist

* fix: scoped message

* chore: removed comment

* feat: now charts loaded correctly

* refactor: fix naming

* chore: added getter to mapGetters

* chore: fixed padding of active element

* fix: dashboard page should works correctly

* feat: don't show empty wallets on donut chart

* test: fixed test due to getter renaming

* chore: removed console.log

* feat: now it correctly select first item on dashboard table

* chore: removed console.log

* fix: now filters don't reset charts

* D3-413 | Create candles chart 📈📈📈 (#71)

* feat: removed ALL filter

* feat: added candletick

* feat: changed filter to 1M

* feat: removed redundant code

* test: fixed test due to change of initial asset chart filter

* feat: added data zoom

* feat: fixed time, now it shows correct time depends on timezone

* feat: updated main dashboard chart to candles

* test: fixed test for wallets page

* test: fixing tests

* chore: updated size of elements

* test: change to smaller amount of tokens

* test: skip tests in reports

* D3-387 | Create expiration time for transaction (#72)

* D3-394 | Create tests for transfering tokens (#74)

* chore: update cypress

* chore: changed id of element

* chore: added new mock data

* test: added tests for validation of private keys

* test: completed tests for transfer

* test: updated with new func goToPage

* test: fixed wallets page tests

* D3-465 | Update README.md (#76)

* chore: update readme.md

* chore: update description of the project

* chore: added env description

* chore: add spaces between envs

* chrome: indexing for env

* D3-477, D3-478 | Fix precision in wallets history [Develop] (#80)

* fix: correct precision in history

* feat: change columns

* feature: fit tokens amount to wallets card (#82)

* D3-479 | Fix precisions in reports [Develop] (#79)

* fix: report precision

* feat: added logo

* test: fixed test

* test: select specific wallet for transfer

* feat: fixed layout of report

* D3-463 | Change input of nodeIp [Develop] (#81)

* feat: add nodes and notaryIPs

* feat: selector for login page

* feat: selector for signup page

* test: fixed test

* chore: return back settlements to mocks folder

* fix: trim every element in array (#84)

* D3-552 | Web withdrawal fix - rename notary_red -> notary (#87)

* D3-551 | Change domain @notary to @d3 (#86)

* fix: rename client domain from notary to d3

* fix: remove commented line

* fix: chane names for test data files

* D3-385 | Added exchange to D3 (#85)

* feat: add description to exchange

* feat: removed settlements queries

* feat: added accept/reject settlement

* feat: added util to generate settlement from transactions

* fix: color of dashboard chart

* feat: updated settlements page

* fix: fixed estimated minutes

* feat: update store to new methods

* feat: accept\reject works correctly

* feat: working settlements

* chore: add setup script

* feat: added validation for assets

* fix: fix validation for transfer

* chore: update package.json

* feat: update iroha helpers

* test: fixed issue with settlements

* chore: update docker image to stable

* feat: now you can't sign accept\reject without all keys

* chore: added correct split of initial amount of tokens

* chore: updated docs

* test: fixed issue then test are failed on page changing

* D3-577 | Update settings page (#88)

* feat: updated settings page

* feat: added addSignatory to settings page

* feat: updated genesis block

* feat: added remove signatory

* feat: added feature to update quorum

* test: Updated unit test for settings page

* feat: added attributes for cypress

* test: update timeout

* fix: fixed missing comma

* test: skip test

* test: updated test, updated genesis block

* chore: add vue-clipboard

* feat: added feature for copy to clipboard

* fix: currently user can only fully sign tr

* feat: add features

* feat: convert keys to HEX on getter

* feat: added message about unsuccess public key removing

* fix: add message for incomplete transactions

* fix: remove console log

* feat: add features

* feat: added message about unsuccess public key removing

* fix: move incomplete operation message to mixin

* feature: interface changes

Add caption to portfolio history chart
Add loading to portfolio history chart and assets history chart
Change position of tooltips in wallet and dashboard headers

* fix: test fixes

* fix failre tests
fix: change wallet amount tooltip to precision

* fix: precision in wallet

* D3-655 | Fix bug with transaction shown in settlements (#94)

* fix: remove empty settlements

* chore: removed console.log, improved code

* feature: show bitcoin wallet address

* feature: show bitcoin wallet address

* feature: bitcoin/eth registration from settings

* feature: bitcoin/eth registration from settings

* feat: added feature for copy to clipboard

* feat: convert keys to HEX on getter

* review fixes

* fix add network button style

* fix: remove openApprovalDialog empty object as argument

* fix: add bitcoin in crypto list

* fix show success message on close approval dialog when add network

* fix: update account info on add  network

* fix: horizontal addresses on empty wallets page

* D3 650 651 | Bitcoin withdrawal and deposit (#93)

* feature: bitcoin withdrawal
* fix: choose notary account for withdrawal based on assetId
* fix crypto list
* fix: update genesis
* fix remove address example

* D3-599 | Settlement history (#96)

* chore: removed syntactic sugar

* chore: removed dispatch

* chore: removed dispatch frim walletsPage

* fix: return back valid function

* feat: update table in wallets page due to mockups

* test: added batch to getter test

* feat: updated design also fixed setup script

* fix: return message back

* feat: method assetName become mixin
  • Loading branch information
Pobepto authored Dec 17, 2018
1 parent cfb0ae0 commit b7e89ab
Show file tree
Hide file tree
Showing 137 changed files with 19,175 additions and 7,197 deletions.
13 changes: 12 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@
"targets": {
"node": 8
},
"useBuiltIns": "entry"
"useBuiltIns": "entry",
"exclude": ["transform-regenerator"]
}
]
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
],
"@babel/plugin-syntax-dynamic-import"
]
}
12 changes: 11 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
]
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
.DS_Store
node_modules
/dist
/dist_electron
dist
dist_electron

/tests/e2e/reports/
selenium-debug.log

.nyc_output
coverage

# local env files
.env.local
.env.*.local
Expand All @@ -23,3 +26,7 @@ yarn-error.log*
*.njsproj
*.sln
*.sw*

# Cypress
/tests/e2e/screenshots
/tests/e2e/videos
16 changes: 16 additions & 0 deletions .jenkinsci/cancel-builds-same-job.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env groovy

def cancelSameJobBuilds() {
def jobname = env.JOB_NAME
def buildnum = env.BUILD_NUMBER.toInteger()
def job = Jenkins.instance.getItemByFullName(jobname)

if (jobname =~ /^.*\/${job.name}$/) {
for (build in job.builds) {
if (!build.isBuilding()) { continue; }
if (buildnum == build.getNumber().toInteger()) { continue; }
build.doStop();
}
}
}
return this
98 changes: 98 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
pipeline {
environment {
DOCKER_NETWORK = ''
}
options {
skipDefaultCheckout()
buildDiscarder(logRotator(numToKeepStr: '20'))
timestamps()
}
agent any
stages {
stage ('Stop same job builds') {
agent { label 'master' }
steps {
script {
def scmVars = checkout scm
// need this for develop->master PR cases
// CHANGE_BRANCH is not defined if this is a branch build
try {
scmVars.CHANGE_BRANCH_LOCAL = scmVars.CHANGE_BRANCH
}
catch(MissingPropertyException e) { }
if (scmVars.GIT_LOCAL_BRANCH != "develop" && scmVars.CHANGE_BRANCH_LOCAL != "develop") {
def builds = load ".jenkinsci/cancel-builds-same-job.groovy"
builds.cancelSameJobBuilds()
}
}
}
}
stage('Tests (unit, e2e)') {
agent { label 'd3-build-agent' }
steps {
script {
def scmVars = checkout scm
DOCKER_NETWORK = "${scmVars.CHANGE_ID}-${scmVars.GIT_COMMIT}-${BUILD_NUMBER}"
writeFile file: ".env", text: "SUBNET=${DOCKER_NETWORK}"
sh(returnStdout: true, script: "docker-compose -f docker/docker-compose.yaml pull")
sh(returnStdout: true, script: "docker-compose -f docker/docker-compose.yaml up --build -d")
sh(returnStdout: true, script: "docker exec d3-back-office-${DOCKER_NETWORK} /app/docker/back-office/wait-for-up.sh")
iC = docker.image('cypress/base:10')
iC.inside("--network='d3-${DOCKER_NETWORK}' --shm-size 4096m --ipc=host") {
sh(script: "yarn global add cypress")
var = sh(returnStatus:true, script: "yarn test:unit")
if (var != 0) {
echo '[FAILURE] Unit tests failed'
currentBuild.result = 'FAILURE';
return var
}
var = sh(returnStatus:true, script: "CYPRESS_baseUrl=http://d3-back-office:8080 CYPRESS_IROHA=http://grpcwebproxy:8080 cypress run")
if (var != 0) {
echo '[FAILURE] E2E tests failed'
currentBuild.result = 'FAILURE';
return var
}
}
}
}
post {
success {
script {
if (env.GIT_LOCAL_BRANCH in ["develop"] || env.CHANGE_BRANCH_LOCAL == 'develop') {
def branch = env.CHANGE_BRANCH_LOCAL == 'develop' ? env.CHANGE_BRANCH_LOCAL : env.GIT_LOCAL_BRANCH
sshagent(['jenkins-back-office']) {
sh "ssh-agent"
sh """
rsync \
-e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
-rzcv --delete \
dist/* \
[email protected]:/var/www/dev/
"""
}
}
}
}
always {
script {
withCredentials([usernamePassword(credentialsId: 'jenkins_nexus_creds', passwordVariable: 'NEXUS_PASS', usernameVariable: 'NEXUS_USER')]) {
sh(script: "find \$(pwd)/tests/e2e/videos/*.mp4 -type f -exec curl -u ${NEXUS_USER}:${NEXUS_PASS} --upload-file {} https://nexus.iroha.tech/repository/back-office/crashes/${DOCKER_NETWORK}/ \\;", returnStdout: true)
echo "You can find all videos here: https://nexus.iroha.tech/service/rest/repository/browse/back-office/crashes/${DOCKER_NETWORK}/"
}
}
}
cleanup {
sh "mkdir build-logs"
sh """
while read -r LINE; do \
docker logs \$(echo \$LINE | cut -d ' ' -f1) | gzip -6 > build-logs/\$(echo \$LINE | cut -d ' ' -f2).log.gz; \
done < <(docker ps --filter "network=d3-${DOCKER_NETWORK}" --format "{{.ID}} {{.Names}}")
"""
archiveArtifacts artifacts: 'build-logs/*.log.gz'
sh "docker-compose -f docker/docker-compose.yaml down"
cleanWs()
}
}
}
}
}
70 changes: 54 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,64 @@
# back-office

> Web application for an operator of D3 notary
# D3
<p align="center">
<img src="src/assets/logo.svg">
</p>

## Build Setup
## What is it?
Distributed Digital Depository is a service platform for decentralized safekeeping and settlements of tokenized crypto assets. Financial intermediaries, or custodians, directly participate in the maintenance of the system by auditing exchange process, and by voting during sidechain-to-D3 tokenization process.

[Hyperledger Iroha](https://github.com/hyperledger/iroha) is D3 ledger, which is used for voting (via multisignature accounts) and decentralized data storage.

## Getting started
To start use this application you should run this commands in terminal.
``` bash
$ git clone https://github.com/d3ledger/back-office
$ cd back-office
$ yarn
```

**IMPORTANT** in our application we use `yarn` for dependency management if you do not have it, you should install it - [Installation | Yarn](https://yarnpkg.com/en/docs/install)

#### ENV
1. `VUE_APP_ETH_NOTARY_URL=http://127.0.0.1:8083` - Used to connect to notary etherium registration service, provide IP of notary. Use this ENV when going to run or build application
1. `VUE_APP_BTC_NOTARY_URL=http://127.0.0.1:8084` - Used to connect to notary bitcoin registration service, provide IP of notary. Use this ENV when going to run or build application
2. `CYPRESS_IROHA=http://127.0.0.1:8081` - Used to run e2e tests, provide IP of gRPC IROHA.
3. `CYPRESS_baseUrl=http://127.0.0.1:8080` - Can be used in e2e tests, provide IP of D3 application

#### Data
In our application we are use mock data that historically became our main data. We are use them to fill IROHA, to provide list of nodes or registration services. You can check them in `data` folder.

### How to run
To run application
``` bash
# install dependencies
yarn
$ yarn serve
```
This will serve application with hot reload.

# rebuild native modules for Electron environment
yarn rebuild
### How to build
To build application for deployment
``` bash
$ yarn build
```

If you are run out of memory while building application you can try another command, but it requires at least **4GB** of RAM
``` bash
$ yarn build:more-memory
```

# serve with hot reload
yarn serve:electron
### How to test
To run tests all unit tests
``` bash
$ yarn test:unit
```

# build electron application for production
# See [electron-builder docs](https://www.electron.build/multi-platform-build) for multi platform build
yarn build:electron
To run all e2e tests
``` bash
$ yarn test:e2e
```

# run unit tests
yarn run unit
**IMPORTANT** to run any e2e test need to provide `CYPRESS_IROHA`.

# run all tests
yarn test
``` bash
$ CYPRESS_IROHA=http://127.0.0.1:8081 yarn test:e2e
```
12 changes: 12 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"baseUrl": "http://127.0.0.1:8080",
"fileServerFolder": "tests/e2e",
"fixturesFolder": "tests/e2e/fixtures",
"integrationFolder": "tests/e2e/integration",
"pluginsFile": false,
"screenshotsFolder": "tests/e2e/screenshots",
"supportFile": "tests/e2e/support",
"videosFolder": "tests/e2e/videos",
"viewportWidth": 1200,
"requestTimeout": 10000
}
8 changes: 8 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### How to run?

``` docker-compose up --build ```

### How to kill?

``` docker-compose down ```

6 changes: 6 additions & 0 deletions docker/back-office/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM cypress/base:10

# RUN yarn global add cypress
RUN npm install -g yarn && npm install -g http-server

ENTRYPOINT /app/docker/back-office/entrypoint.sh
13 changes: 13 additions & 0 deletions docker/back-office/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
cd /app
yarn
yarn build

printf 'Waiting for iroha and grpc-server become ready'
while [[ "$(curl -s -o /dev/null -m 5 -w ''%{http_code}'' grpcwebproxy:8080)" != "500" ]]; do
printf '.';
sleep 5;
done

NODE_IP=http://grpcwebproxy:8080 DEBUG=iroha-util node scripts/setup.js
http-server --cors ./dist
6 changes: 6 additions & 0 deletions docker/back-office/wait-for-up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
printf 'Waiting for back-office backend-server become ready'
until $(curl --output /dev/null -m 5 --silent --head --fail http://localhost:8080); do
printf '.'
sleep 5
done
51 changes: 51 additions & 0 deletions docker/docker-compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: '3.5'

networks:
d3-back-office:
name: d3-${SUBNET}
attachable: true

services:
d3-iroha:
image: hyperledger/iroha:snapshot-29a7517
container_name: d3-iroha-${SUBNET}
depends_on:
- d3-iroha-postgres
tty: true
environment:
- KEY=keys/node0
entrypoint:
- /opt/iroha_data/entrypoint.sh
networks:
- d3-back-office
volumes:
- ./iroha:/opt/iroha_data
ports:
- 50051:50051

d3-iroha-postgres:
image: postgres:9.5
container_name: d3-iroha-postgres-${SUBNET}
environment:
- POSTGRES_PASSWORD=mysecretpassword
networks:
- d3-back-office
logging:
driver: none

grpcwebproxy:
build:
context: grpcwebproxy/
container_name: d3-grpcwebproxy-${SUBNET}
depends_on:
- d3-iroha
entrypoint:
- grpcwebproxy
- --backend_addr=d3-iroha:50051
- --run_tls_server=false
networks:
- d3-back-office
logging:
driver: none
ports:
- 8081:8080
Loading

0 comments on commit b7e89ab

Please sign in to comment.