Skip to content

Commit

Permalink
Merge pull request #12 from wrkzcoin/development
Browse files Browse the repository at this point in the history
Tx PoW + Add a required unlock height on transactions
  • Loading branch information
wrkzdev committed Sep 24, 2020
2 parents e389ef4 + d171f08 commit 3b18f0b
Show file tree
Hide file tree
Showing 111 changed files with 8,158 additions and 6,851 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
true,
{ "button": true, "submit": true, "reset": true }
],
"header/header": [2, "app/constants/header.js"],
"header/header": [2, "app/mainWindow/constants/header.js"],
"react/no-array-index-key": false,
"global-require": 0,
"flowtype/no-weak-types": "off"
"flowtype/no-weak-types": "off",
"import/prefer-default-export": false
}
}
85 changes: 64 additions & 21 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,38 @@ jobs:
os: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
- uses: actions/setup-node@v1.4.3
with:
node-version: '10.x'
node-version: '12.x'

- name: Setup MSBuild.exe
if: matrix.os == 'windows-latest'
uses: warrenbuckley/Setup-MSBuild@v1

# Fetch Dependencies
- name: Linux Dependencies
if: matrix.target != 'x86_64-pc-windows-msvc' && matrix.target != 'x86_64-apple-darwin'
run: |
sudo apt update
sudo apt install -y libusb-1.0-0-dev libudev-dev
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Setup Cache
uses: actions/cache@v1
uses: actions/cache@v1.2.0
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: node_modules
key: ${{ matrix.os }}-deps
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ matrix.target }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.target }}-yarn-
- name: Dependencies
run: yarn
run: yarn --network-concurrency 1 --network-timeout 300000

- name: Build aarch64
if: matrix.target == 'aarch64-unknown-linux-gnu'
Expand All @@ -77,28 +91,57 @@ jobs:
# Upload to AMZ
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7 # Or other version
python-version: 3.8 # Or other version
- name: Install awscli via pipx # Isolates dependencies
shell: bash
run: |
export PATH=~/.local/bin:$PATH
pip install --user pipx
pipx install awscli
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Upload S3
pip install --user pipx awscli-plugin-endpoint
- name: S3 Upload
env:
MINGW64_PATH: 'C:/Program Files/Git/mingw64/bin'
BINARY_DISCORD_HOOK: ${{ secrets.DISCORD_HOOK }}
BINARY_UPLOAD: 'https://wrkzcoin.s3.fr-par.scw.cloud/'
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }} # optional: defaults to us-east-1
AWS_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
SOURCE_DIR: 'release' # optional: defaults to entire repository
DEST_DIR: 'pluton'
COMMIT_SHA: ${{ github.sha }}
REPO: 'wrkz-wallet-pluton'
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
~/.local/bin/aws s3 cp "./release/${{ steps.before_deploy.outputs.file_name }}" "s3://wrkzcoin/pluton-wrkz-wallet/${{ matrix.target }}-${{ steps.before_deploy.outputs.file_name }}"
FILENAME="./${SOURCE_DIR}/${{ steps.before_deploy.outputs.file_name }}"
FILESIZE=$(ls -lah "$FILENAME" | awk '{ print $5}')
DATE_WITH_TIME=`date "+%Y%m%d-%H%M"`
SHA8=${COMMIT_SHA::8}
OUT_FILENAME="${DATE_WITH_TIME}-${COMMIT_SHA::8}-${{ matrix.target }}-${{ steps.before_deploy.outputs.file_name }}"
URL_FILE="\`\`\`${BINARY_UPLOAD}${DEST_DIR}/$OUT_FILENAME\`\`\`"
BUILD_CONTENT="$RUNNER_OS-${{ matrix.target }}-$SHA8 Size: $FILESIZE "$URL_FILE
if [ "$RUNNER_OS" == "Windows" ] || [ "$RUNNER_OS" == "macOS" ]; then
~/.local/bin/aws configure set aws_access_key_id ${AWS_ACCESS_KEY_ID}
~/.local/bin/aws configure set aws_secret_access_key ${AWS_SECRET_ACCESS_KEY}
~/.local/bin/aws configure set default.region ${AWS_REGION}
~/.local/bin/aws s3 cp "./${SOURCE_DIR}/${{ steps.before_deploy.outputs.file_name }}" "s3://${AWS_S3_BUCKET}/${DEST_DIR}/${OUT_FILENAME}" --no-progress --endpoint-url "${AWS_ENDPOINT}" --acl public-read
~/.local/bin/aws configure set aws_access_key_id null
~/.local/bin/aws configure set aws_secret_access_key null
~/.local/bin/aws configure set default.region null
elif [ "$RUNNER_OS" == "Linux" ]; then
aws s3 cp "./release/${{ steps.before_deploy.outputs.file_name }}" "s3://wrkzcoin/pluton-wrkz-wallet/${{ matrix.target }}-${{ steps.before_deploy.outputs.file_name }}"
elif [ "$RUNNER_OS" == "macOS" ]; then
~/.local/bin/aws s3 cp "./release/${{ steps.before_deploy.outputs.file_name }}" "s3://wrkzcoin/pluton-wrkz-wallet/${{ matrix.target }}-${{ steps.before_deploy.outputs.file_name }}"
aws configure set aws_access_key_id ${AWS_ACCESS_KEY_ID}
aws configure set aws_secret_access_key ${AWS_SECRET_ACCESS_KEY}
aws configure set default.region ${AWS_REGION}
aws s3 cp "./${SOURCE_DIR}/${{ steps.before_deploy.outputs.file_name }}" "s3://${AWS_S3_BUCKET}/${DEST_DIR}/${OUT_FILENAME}" --no-progress --endpoint-url "${AWS_ENDPOINT}" --acl public-read
aws configure set aws_access_key_id null
aws configure set aws_secret_access_key null
aws configure set default.region null
fi
if [ "$RUNNER_OS" == "Windows" ]; then
export PATH=$MINGW64_PATH:$PATH
fi
curl -H "Content-Type: application/json" -X POST -d "{\"username\": \"BuildBot-$RUNNER_OS-$REPO\", \"content\": \"$BUILD_CONTENT\"}" ${BINARY_DISCORD_HOOK}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ main.js.map

.idea
npm-debug.log.*
# Build
build/*
5 changes: 0 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@
".git": true,
".eslintcache": true,
"app/dist": true,
"app/main.prod.js": true,
"app/main.prod.js.map": true,
"bower_components": true,
"dll": true,
"release": true,
"node_modules": true,
"npm-debug.log.*": true,
"test/**/__snapshots__": true,
"yarn.lock": true
},
"files.exclude": {
"**/**.prod.*": true
}
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## v1.1.1

- fixes a bug where the "save as" command does not append the .wallet extension
- fixes a bug where the user could still save the wallet in the install directory by placing it in a subfolder, causing the wallet file to be wiped on wallet upgrade
- electron-builder updated for MacOS Catalina compatability
- updates GH builds to use latest OS and cache the dependencies
- upgrades the wallet backend to alleviate a bug that was (possibly) effecting sending transactions
- Slight configuration change in an attempt to make the sync process not effect the GUI responsiveness so much

## v1.1.0

- Adds a new method of making new wallets, which is much more interactive, and ensures the user backs up their seed before they use their wallet.
Expand Down
17 changes: 15 additions & 2 deletions app/Configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,21 @@ const Configure = new function() {
*/
this.scanCoinbaseTransactions = false;

/**
* Disable AutoOptimization by default
*/
this.enableAutoOptimization = false;

/**
* The minimum fee allowed for transactions, in ATOMIC units
*/
this.minimumFee = 50000;

/**
* Fee per byte height
*/
this.feePerByteHeight = 832000;

/**
* Mapping of height to mixin maximum and mixin minimum
*/
Expand All @@ -98,7 +108,10 @@ const Configure = new function() {
/* At height of 658,500 */
new MixinLimit(658500, 1, 3, 1),

], 3 /* Default mixin of 3 before block 440,000 */);
/* At height of 1,000,100 */
new MixinLimit(1000000, 1, 1, 1),

], 1 /* Default mixin of 3 before block 440,000 */);

/**
* The length of a standard address for your coin
Expand All @@ -122,7 +135,7 @@ const Configure = new function() {
/**
* Amount of blocks to request from the daemon at once
*/
this.blocksPerDaemonRequest = 50;
this.blocksPerDaemonRequest = 40;

/**
* User agent string
Expand Down
41 changes: 41 additions & 0 deletions app/MessageRelayer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (C) 2019 ExtraHash
//
// Please see the included LICENSE file for more information.
import { ipcMain, IpcMainEvent } from 'electron';

export default class MessageRelayer {
mainWindow: BrowserWindow;

backendWindow: BrowserWindow;

constructor(mainWindow, backendWindow) {
this.mainWindow = mainWindow;
this.backendWindow = backendWindow;

ipcMain.on(
'fromBackend',
(event: IpcMainEvent, messageType: string, data: any) => {
const message = { messageType, data };
this.mainWindow.send('fromBackend', message);
}
);

ipcMain.on(
'fromFrontend',
(event: IpcMainEvent, messageType: string, data: any) => {
const message = { messageType, data };
this.backendWindow.send('fromFrontend', message);
}
);
}

sendToBackend(messageType: string, data: any) {
const message = { messageType, data };
this.backendWindow.send('fromMain', message);
}

sendToFrontend(messageType: string, data: any) {
const message = { messageType, data };
this.mainWindow.send('fromMain', message);
}
}
Binary file modified app/app.icns
Binary file not shown.
Loading

0 comments on commit 3b18f0b

Please sign in to comment.