diff --git a/.babelrc b/.babelrc index 12c82ed8d..a8e305805 100644 --- a/.babelrc +++ b/.babelrc @@ -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" ] } \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 57a6277e0..a1fd69fc1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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' + } } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 31c533209..3b3e9d174 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -23,3 +26,7 @@ yarn-error.log* *.njsproj *.sln *.sw* + +# Cypress +/tests/e2e/screenshots +/tests/e2e/videos diff --git a/.jenkinsci/cancel-builds-same-job.groovy b/.jenkinsci/cancel-builds-same-job.groovy new file mode 100644 index 000000000..73d253ca0 --- /dev/null +++ b/.jenkinsci/cancel-builds-same-job.groovy @@ -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 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..14f5a7791 --- /dev/null +++ b/Jenkinsfile @@ -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/* \ + root@95.179.153.222:/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() + } + } + } + } +} diff --git a/README.md b/README.md index 652dda7e1..e612e07ff 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,64 @@ -# back-office -> Web application for an operator of D3 notary +# D3 +
+ +
-## 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 ``` \ No newline at end of file diff --git a/cypress.json b/cypress.json new file mode 100644 index 000000000..3d823080a --- /dev/null +++ b/cypress.json @@ -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 +} diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..64895d24a --- /dev/null +++ b/docker/README.md @@ -0,0 +1,8 @@ +### How to run? + +``` docker-compose up --build ``` + +### How to kill? + +``` docker-compose down ``` + diff --git a/docker/back-office/Dockerfile b/docker/back-office/Dockerfile new file mode 100644 index 000000000..e7eba0232 --- /dev/null +++ b/docker/back-office/Dockerfile @@ -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 diff --git a/docker/back-office/entrypoint.sh b/docker/back-office/entrypoint.sh new file mode 100755 index 000000000..e3c594854 --- /dev/null +++ b/docker/back-office/entrypoint.sh @@ -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 diff --git a/docker/back-office/wait-for-up.sh b/docker/back-office/wait-for-up.sh new file mode 100755 index 000000000..6361ee421 --- /dev/null +++ b/docker/back-office/wait-for-up.sh @@ -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 diff --git a/docker/docker-compose-dev.yaml b/docker/docker-compose-dev.yaml new file mode 100644 index 000000000..2d6d8bf91 --- /dev/null +++ b/docker/docker-compose-dev.yaml @@ -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 diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml new file mode 100644 index 000000000..6b765173c --- /dev/null +++ b/docker/docker-compose.yaml @@ -0,0 +1,63 @@ +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 + logging: + driver: none + + 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 + + d3-back-office: + build: + context: back-office + container_name: d3-back-office-${SUBNET} + depends_on: + - grpcwebproxy + networks: + - d3-back-office + volumes: + - ..:/app + # - /dev/null:/app/node_modules diff --git a/docker/grpcwebproxy/Dockerfile b/docker/grpcwebproxy/Dockerfile new file mode 100644 index 000000000..185c0621e --- /dev/null +++ b/docker/grpcwebproxy/Dockerfile @@ -0,0 +1,62 @@ +# Use the `golang` image to build a statically linked binary. +# https://blog.codeship.com/building-minimal-docker-containers-for-go-applications/ +# +# Tested with: +# golang@sha256:4826b5c314a498142c7291ad835ab6be1bf02f7813d6932d01f1f0f1383cdda1 +FROM golang as gobin + +# Clone the improbable-eng/grpc-web repo. +WORKDIR /go/src/github.com/improbable-eng +RUN git clone https://github.com/improbable-eng/grpc-web.git + +# Use `dep` to ensure the correct versions of vendor dependencies are used. +# See: https://github.com/improbable-eng/grpc-web/issues/174 +WORKDIR /go/src/github.com/improbable-eng/grpc-web +RUN go get github.com/golang/dep/cmd/dep +RUN dep ensure + +# Build a static binary for `grpcwebproxy`. +WORKDIR /go/src/github.com/improbable-eng/grpc-web/go/grpcwebproxy +ENV CGO_ENABLED='0' GOOS='linux' +RUN go install + +# Use the `alpine` image to get `ca-certificates`. +# +# Tested with: +# alpine@sha256:7df6db5aa61ae9480f52f0b3a06a140ab98d427f86d8d5de0bedab9b8df6b1c0 +FROM alpine as certs +RUN apk update +RUN apk add ca-certificates + +# Build the image from the `scratch` (empty) container by copying the binary +# and SSL certificates into an approapriate location. +FROM scratch +COPY --from=gobin ["/go/bin/grpcwebproxy", "/bin/"] +COPY --from=gobin ["/go/src/github.com/improbable-eng/grpc-web/misc/localhost.*", "/misc/"] +COPY --from=certs ["/etc/ssl/*", "/etc/ssl/"] + +# Advertise ports 8080 and 8443. +EXPOSE 8080 8443 + +# Start the `grpcwebproxy` binary as the main process. +ENTRYPOINT ["/bin/grpcwebproxy"] + +# Provide default arguments for `grpcwebproxy`. These will normally be +# overridden when running the container. Using ENV for HOST and PORT would +# be better here, but ENV variables don't expand without a shell. +# +# See: https://github.com/moby/moby/issues/5509#issuecomment-42173047 +# +# Instead, `dev.localdomain` is used for the host. This can be set when +# running the container by using the argument: +# +# `--add-host dev.localdomain:192.0.2.1 +# +# Replace 192.0.2.1 with the IP address of the host. +# +# Port 50051 is used because it's the most common port used in the GRPC +# quickstart examples. +CMD ["--server_tls_cert_file=/misc/localhost.crt", \ + "--server_tls_key_file=/misc/localhost.key", \ + "--backend_addr=dev.localdomain:50051", \ + "--backend_tls_noverify"] diff --git a/docker/iroha/config.docker b/docker/iroha/config.docker new file mode 100755 index 000000000..f851a1ab5 --- /dev/null +++ b/docker/iroha/config.docker @@ -0,0 +1,11 @@ +{ + "block_store_path" : "/tmp/block_store/", + "torii_port" : 50051, + "internal_port" : 10001, + "pg_opt" : "host=d3-iroha-postgres port=5432 user=postgres password=mysecretpassword", + "max_proposal_size" : 10, + "proposal_delay" : 5000, + "vote_delay" : 5000, + "load_delay" : 5000, + "mst_enable" : true +} diff --git a/docker/iroha/entrypoint.sh b/docker/iroha/entrypoint.sh new file mode 100755 index 000000000..4822d6533 --- /dev/null +++ b/docker/iroha/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +#while ! curl http://d3-iroha-postgres:5432/ 2>&1 | grep '52' +#do +#done +sleep 10 +irohad --genesis_block genesis.block --config config.docker --keypair_name $KEY --overwrite-ledger diff --git a/docker/iroha/genesis.block b/docker/iroha/genesis.block new file mode 100755 index 000000000..ba7d86f78 --- /dev/null +++ b/docker/iroha/genesis.block @@ -0,0 +1,443 @@ +{ + "payload": { + "transactions": [ + { + "payload": { + "reducedPayload": { + "commands": [ + { + "addPeer": { + "peer": { + "address": "localhost:10001", + "peerKey": "0E2icbV/5jQmrh3Jf2lSEEA3QR/PTztzncIX9F5fyZs=" + } + } + }, + { + "createRole": { + "roleName": "notary", + "permissions": [ + "can_get_all_acc_ast", + "can_get_all_accounts", + "can_create_asset", + "can_add_asset_qty", + "can_transfer", + "can_set_detail", + "can_get_all_txs", + "can_receive", + "can_get_blocks", + "can_read_assets", + "can_add_signatory", + "can_set_quorum", + "can_grant_can_set_my_quorum", + "can_grant_can_add_my_signatory", + "can_grant_can_transfer_my_assets" + ] + } + }, + { + "createRole": { + "roleName": "relay_deployer", + "permissions": [ + "can_set_detail" + ] + } + }, + { + "createRole": { + "roleName": "eth_token_list_storage", + "permissions": [ + "can_set_detail", + "can_create_asset" + ] + } + }, + { + "createRole": { + "roleName": "registration_service", + "permissions": [ + "can_create_account", + "can_set_detail", + "can_get_all_accounts", + "can_get_domain_accounts", + "can_get_all_txs", + "can_get_blocks", + "can_set_quorum" + ] + } + }, + { + "createRole": { + "roleName": "client", + "permissions": [ + "can_get_my_account", + "can_get_my_acc_ast", + "can_get_my_acc_ast_txs", + "can_get_my_acc_txs", + "can_get_my_txs", + "can_transfer", + "can_receive", + "can_set_quorum", + "can_add_signatory", + "can_get_my_signatories", + "can_remove_signatory" + ] + } + }, + { + "createRole": { + "roleName": "admin", + "permissions": [ + "can_get_all_accounts" + ] + } + }, + { + "createRole": { + "roleName": "withdrawal", + "permissions": [ + "can_get_all_accounts", + "can_get_blocks", + "can_read_assets", + "can_receive", + "can_get_all_txs" + ] + } + }, + { + "createRole": { + "roleName": "signature_collector", + "permissions": [ + "can_create_account", + "can_set_detail", + "can_get_all_accounts" + ] + } + }, + { + "createRole": { + "roleName": "vacuumer", + "permissions": [ + "can_get_domain_accounts", + "can_read_assets" + ] + } + }, + { + "createRole": { + "roleName": "none", + "permissions": [ + ] + } + }, + { + "createRole": { + "roleName": "tester", + "permissions": [ + "can_get_all_accounts", + "can_get_all_acc_ast", + "can_add_asset_qty", + "can_transfer", + "can_create_asset", + "can_create_account", + "can_receive", + "can_read_assets", + "can_append_role", + "can_add_peer", + "can_set_detail", + "can_get_blocks", + "can_get_domain_accounts", + "can_set_quorum", + "can_add_signatory", + "can_create_account", + "can_get_all_txs", + "can_get_domain_acc_detail", + "can_read_assets", + "can_grant_can_set_my_quorum", + "can_grant_can_add_my_signatory", + "can_grant_can_transfer_my_assets", + "can_get_my_signatories", + "can_remove_signatory" + ] + } + }, + { + "createRole": { + "roleName": "whitelist_setter", + "permissions": [ + "can_set_detail" + ] + } + }, + { + "createRole": { + "roleName": "notary_list_holder", + "permissions": [ + "can_set_detail" + ] + } + }, + { + "createDomain": { + "domainId": "notary", + "defaultRole": "none" + } + }, + { + "createDomain": { + "domainId": "d3", + "defaultRole": "client" + } + }, + { + "createDomain": { + "domainId": "btcSession", + "defaultRole": "none" + } + }, + { + "createDomain": { + "domainId": "ethereum", + "defaultRole": "none" + } + }, + { + "createAsset": { + "assetName": "ether", + "domainId": "ethereum", + "precision": 18 + } + }, + { + "createDomain": { + "domainId": "bitcoin", + "defaultRole": "none" + } + }, + { + "createDomain": { + "domainId": "btcSignCollect", + "defaultRole": "none" + } + }, + { + "createAsset": { + "assetName": "btc", + "domainId": "bitcoin", + "precision": 8 + } + }, + { + "createAccount": { + "accountName": "notary", + "domainId": "notary", + "publicKey": "gl/XANujspTdZQKbLsHyG1v0ZOb3lcSHliy1mHgKsNE=" + } + }, + { + "appendRole": { + "accountId": "notary@notary", + "roleName": "notary" + } + }, + { + "createAccount": { + "accountName": "eth_registration_service", + "domainId": "notary", + "publicKey": "/iaL2sezwMrJRx6RUpm0gZkcmwsUVD9lhoxWHa/Wtok=" + } + }, + { + "appendRole": { + "accountId": "eth_registration_service@notary", + "roleName": "registration_service" + } + }, + { + "appendRole": { + "accountId": "eth_registration_service@notary", + "roleName": "relay_deployer" + } + }, + { + "appendRole": { + "accountId": "eth_registration_service@notary", + "roleName": "whitelist_setter" + } + }, + { + "createAccount": { + "accountName": "btc_registration_service", + "domainId": "notary", + "publicKey": "5I4AOZEUK5CjVp1oBHOMaSlvM5IWFmo+bSDWOAr7JbE=" + } + }, + { + "appendRole": { + "accountId": "btc_registration_service@notary", + "roleName": "registration_service" + } + }, + { + "createAccount": { + "accountName": "mst_btc_registration_service", + "domainId": "notary", + "publicKey": "qJWq9AOcKadQ5+mZC33Y8Fsdx4LEipp8X3DQCmZdfQI=" + + } + }, + { + "setAccountQuorum":{ + "accountId":"mst_btc_registration_service@notary", + "quorum":1 + } + }, + { + "appendRole": { + "accountId": "mst_btc_registration_service@notary", + "roleName": "registration_service" + } + }, + { + "createAccount": { + "accountName": "eth_token_storage_service", + "domainId": "notary", + "publicKey": "jw9s6xR2efuBVJxI5yA0XxTtA0CHnkrTcKIbbdwygck=" + } + }, + { + "appendRole": { + "accountId": "eth_token_storage_service@notary", + "roleName": "eth_token_list_storage" + } + }, + { + "createAccount": { + "accountName": "withdrawal", + "domainId": "notary", + "publicKey": "CSdCcCMvQ/15TFyBdirByGh/cINoJlRlbqltH5sU9NM=" + } + }, + { + "appendRole": { + "accountId": "withdrawal@notary", + "roleName": "withdrawal" + } + }, + { + "createAccount": { + "accountName": "btc_withdrawal_service", + "domainId": "notary", + "publicKey": "CSdCcCMvQ/15TFyBdirByGh/cINoJlRlbqltH5sU9NM=" + } + }, + { + "appendRole": { + "accountId": "btc_withdrawal_service@notary", + "roleName": "withdrawal" + } + }, + { + "appendRole": { + "accountId": "btc_withdrawal_service@notary", + "roleName": "signature_collector" + } + }, + { + "createAccount": { + "accountName": "test", + "domainId": "notary", + "publicKey": "CS5xsDGlGtrpJPfNlE8Dca6LhQJGnjJpOIUzTe3MYAE=" + } + }, + { + "appendRole": { + "accountId": "test@notary", + "roleName": "tester" + } + }, + { + "createAccount": { + "accountName": "test", + "domainId": "d3", + "publicKey": "iJ9riB4zG+IUh9t33PMsX409XoBm540v6sQjn+kdQW8=" + } + }, + { + "appendRole": { + "accountId": "test@d3", + "roleName": "tester" + } + }, + { + "createAccount": { + "accountName": "vacuumer", + "domainId": "notary", + "publicKey": "YU+qjFi+kKa8BtEEFk0JknDiQ9GLzgKlX23SVzKIeHY=" + } + }, + { + "appendRole": { + "accountId": "vacuumer@notary", + "roleName": "vacuumer" + } + }, + { + "createAccount": { + "accountName": "notaries", + "domainId": "notary", + "publicKey": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } + }, + { + "createAccount": { + "accountName": "btc_change_addresses", + "domainId": "notary", + "publicKey": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } + }, + { + "appendRole": { + "accountId": "notaries@notary", + "roleName": "notary_list_holder" + } + }, + { + "setAccountDetail": { + "accountId": "notaries@notary", + "key": "some_notary", + "value": "http://localhost:20000" + } + }, + { + "createAccount": { + "accountName": "gen_btc_pk_trigger", + "domainId": "notary", + "publicKey": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } + }, + { + "createAccount": { + "accountName": "admin", + "domainId": "notary", + "publicKey": "CS5xsDGlGtrpJPfNlE8Dca6LhQJGnjJpOIUzTe3MYAE=" + } + }, + { + "appendRole": { + "accountId": "admin@notary", + "roleName": "admin" + } + } + ], + "creatorAccountId": "notary@notary", + "quorum": 1 + } + } + } + ], + "txNumber": 1, + "height": "1", + "prevBlockHash": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } +} diff --git a/docker/iroha/keys/admin@notary.priv b/docker/iroha/keys/admin@notary.priv new file mode 100755 index 000000000..6f50dee45 --- /dev/null +++ b/docker/iroha/keys/admin@notary.priv @@ -0,0 +1 @@ +0f0ce16d2afbb8eca23c7d8c2724f0c257a800ee2bbd54688cec6b898e3f7e33 diff --git a/scripts/admin@test.pub b/docker/iroha/keys/admin@notary.pub old mode 100644 new mode 100755 similarity index 98% rename from scripts/admin@test.pub rename to docker/iroha/keys/admin@notary.pub index 1dfda5428..758c32b34 --- a/scripts/admin@test.pub +++ b/docker/iroha/keys/admin@notary.pub @@ -1 +1 @@ -889f6b881e331be21487db77dcf32c5f8d3d5e8066e78d2feac4239fe91d416f \ No newline at end of file +889f6b881e331be21487db77dcf32c5f8d3d5e8066e78d2feac4239fe91d416f diff --git a/docker/iroha/keys/node0.priv b/docker/iroha/keys/node0.priv new file mode 100755 index 000000000..901e6aa51 --- /dev/null +++ b/docker/iroha/keys/node0.priv @@ -0,0 +1 @@ +41209bd907789fd5a796ac6bdff908bac2f7abcf7a1d0b99a18290f285f6e965 diff --git a/docker/iroha/keys/node0.pub b/docker/iroha/keys/node0.pub new file mode 100755 index 000000000..94eb8428f --- /dev/null +++ b/docker/iroha/keys/node0.pub @@ -0,0 +1 @@ +d04da271b57fe63426ae1dc97f6952104037411fcf4f3b739dc217f45e5fc99b diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 11917cc56..000000000 --- a/jest.config.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - moduleFileExtensions: [ - 'js', - 'jsx', - 'json', - 'vue' - ], - transform: { - '^.+\\.vue$': 'vue-jest', - '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', - '^.+\\.jsx?$': 'babel-jest' - }, - moduleNameMapper: { - '^@/(.*)$': '