diff --git a/dash-cli/README.md b/dash-cli/README.md new file mode 100644 index 0000000..be52a6e --- /dev/null +++ b/dash-cli/README.md @@ -0,0 +1,9 @@ +--- +title: dash-cli (alias) +homepage: https://webinstall.dev/dashcore +tagline: | + `dash-cli` (dash daemon) is an alias for `dashcore` (the dash suite) +alias: dashcore +--- + +See [Dash Core](/dashcore). diff --git a/dash-cli/install.ps1 b/dash-cli/install.ps1 new file mode 100644 index 0000000..0187d67 --- /dev/null +++ b/dash-cli/install.ps1 @@ -0,0 +1,3 @@ +echo "'dash-cli@$Env:WEBI_TAG' is an alias for 'dashcore@$Env:WEBI_VERSION'" +IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" } +curl.exe -fsSL "$Env:WEBI_HOST/dashcore@$Env:WEBI_VERSION" | powershell diff --git a/dash-cli/install.sh b/dash-cli/install.sh new file mode 100644 index 0000000..6b77914 --- /dev/null +++ b/dash-cli/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +set -u + +function __redirect_alias_dashcore() { + echo "'dash-cli@${WEBI_TAG:-}' (project) is an alias for 'dashcore@${WEBI_VERSION:-}' (command)" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/dashcore@${WEBI_VERSION:-}" | bash +} + +__redirect_alias_dashcore diff --git a/dash-cli/releases.js b/dash-cli/releases.js new file mode 100644 index 0000000..0b9481a --- /dev/null +++ b/dash-cli/releases.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../dashcore/releases.js'); diff --git a/dash-qt/README.md b/dash-qt/README.md new file mode 100644 index 0000000..fae1ecd --- /dev/null +++ b/dash-qt/README.md @@ -0,0 +1,9 @@ +--- +title: dash-qt (alias) +homepage: https://webinstall.dev/dashcore +tagline: | + `dash-qt` (dash daemon) is an alias for `dashcore` (the dash suite) +alias: dashcore +--- + +See [Dash Core](/dashcore). diff --git a/dash-qt/install.ps1 b/dash-qt/install.ps1 new file mode 100644 index 0000000..daccad0 --- /dev/null +++ b/dash-qt/install.ps1 @@ -0,0 +1,3 @@ +echo "'dash-qt@$Env:WEBI_TAG' is an alias for 'dashcore@$Env:WEBI_VERSION'" +IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" } +curl.exe -fsSL "$Env:WEBI_HOST/dashcore@$Env:WEBI_VERSION" | powershell diff --git a/dash-qt/install.sh b/dash-qt/install.sh new file mode 100644 index 0000000..a6933ed --- /dev/null +++ b/dash-qt/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +set -u + +function __redirect_alias_dashcore() { + echo "'dash-qt@${WEBI_TAG:-}' (project) is an alias for 'dashcore@${WEBI_VERSION:-}' (command)" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/dashcore@${WEBI_VERSION:-}" | bash +} + +__redirect_alias_dashcore diff --git a/dash-qt/releases.js b/dash-qt/releases.js new file mode 100644 index 0000000..0b9481a --- /dev/null +++ b/dash-qt/releases.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../dashcore/releases.js'); diff --git a/dash-wallet/README.md b/dash-wallet/README.md new file mode 100644 index 0000000..f3830d2 --- /dev/null +++ b/dash-wallet/README.md @@ -0,0 +1,9 @@ +--- +title: dash-wallet (alias) +homepage: https://webinstall.dev/dashcore +tagline: | + `dash-wallet` (dash daemon) is an alias for `dashcore` (the dash suite) +alias: dashcore +--- + +See [Dash Core](/dashcore). diff --git a/dash-wallet/install.ps1 b/dash-wallet/install.ps1 new file mode 100644 index 0000000..26354af --- /dev/null +++ b/dash-wallet/install.ps1 @@ -0,0 +1,3 @@ +echo "'dash-wallet@$Env:WEBI_TAG' is an alias for 'dashcore@$Env:WEBI_VERSION'" +IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" } +curl.exe -fsSL "$Env:WEBI_HOST/dashcore@$Env:WEBI_VERSION" | powershell diff --git a/dash-wallet/install.sh b/dash-wallet/install.sh new file mode 100644 index 0000000..5388360 --- /dev/null +++ b/dash-wallet/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +set -u + +function __redirect_alias_dashcore() { + echo "'dash-wallet@${WEBI_TAG:-}' (project) is an alias for 'dashcore@${WEBI_VERSION:-}' (command)" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/dashcore@${WEBI_VERSION:-}" | bash +} + +__redirect_alias_dashcore diff --git a/dash-wallet/releases.js b/dash-wallet/releases.js new file mode 100644 index 0000000..0b9481a --- /dev/null +++ b/dash-wallet/releases.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../dashcore/releases.js'); diff --git a/dash/README.md b/dash/README.md new file mode 100644 index 0000000..bf765ad --- /dev/null +++ b/dash/README.md @@ -0,0 +1,9 @@ +--- +title: Dash (alias) +homepage: https://webinstall.dev/dashcore +tagline: | + `dash` (digital cash) is an alias for `dashcore` (the dash suite) +alias: dashcore +--- + +See [Dash Core](/dashcore). diff --git a/dash/install.ps1 b/dash/install.ps1 new file mode 100644 index 0000000..4639310 --- /dev/null +++ b/dash/install.ps1 @@ -0,0 +1,3 @@ +echo "'dash@$Env:WEBI_TAG' is an alias for 'dashcore@$Env:WEBI_VERSION'" +IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" } +curl.exe -fsSL "$Env:WEBI_HOST/dashcore@$Env:WEBI_VERSION" | powershell diff --git a/dash/install.sh b/dash/install.sh new file mode 100644 index 0000000..cf25155 --- /dev/null +++ b/dash/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +set -u + +function __redirect_alias_dashcore() { + echo "'dash@${WEBI_TAG:-}' (project) is an alias for 'dashcore@${WEBI_VERSION:-}' (command)" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/dashcore@${WEBI_VERSION:-}" | bash +} + +__redirect_alias_dashcore diff --git a/dash/releases.js b/dash/releases.js new file mode 100644 index 0000000..0b9481a --- /dev/null +++ b/dash/releases.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../dashcore/releases.js'); diff --git a/dashcore/README.md b/dashcore/README.md new file mode 100644 index 0000000..84b348b --- /dev/null +++ b/dashcore/README.md @@ -0,0 +1,40 @@ +--- +title: Dash Core +homepage: https://github.com/dashpay/dash +tagline: | + foobar: An example that doesn't exist. +--- + +To update or switch versions, run `webi dashcore@stable` (or `@v0.17`, `@beta`, +etc). + +### Files + +These are the files / directories that are created and/or modified with this +install: + +```txt +~/.config/envman/PATH.env +~/.local/bin/ +~/.local/opt/dashcore/ +~/Library/Saved Application State/org.dash.Dash-Qt.savedState +~/Library//Preferences/org.dash.Dash-Qt.plist +``` + +## Cheat Sheet + +> _Dash Core_ is a suite of tools for _Dash_, the international digital +> currency. + +The tools include: + +- `dash-qt` the _Desktop Wallet_ for sending and receiving payments +- `dash-cli` the _Command Line Wallet_ +- [`dashd`](/dashd) the ledger and transaction service +- `dash-tx` the transaction debugger + +To open the Dash Desktop Wallet: + +```bash +dash-qt +``` diff --git a/dashcore/install.ps1 b/dashcore/install.ps1 new file mode 100644 index 0000000..24f6493 --- /dev/null +++ b/dashcore/install.ps1 @@ -0,0 +1,56 @@ +#!/usr/bin/env pwsh + +################## +# Install dashcore # +################## + +# Every package should define these variables +$pkg_cmd_name = "dashd" + +$pkg_dst_cmd = "$Env:USERPROFILE\.local\opt\dashcore\bin\dashd.exe" +$pkg_dst_dir = "$Env:USERPROFILE\.local\opt\dashcore" +$pkg_dst = "$pkg_dst_cmd" + +$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\dashcore-v$Env:WEBI_VERSION\bin\dashd.exe" +$pkg_src_bin = "$Env:USERPROFILE\.local\opt\dashcore-v$Env:WEBI_VERSION\bin" +$pkg_src_dir = "$Env:USERPROFILE\.local\opt\dashcore-v$Env:WEBI_VERSION" +$pkg_src = "$pkg_src_cmd" + +New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | out-null +$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE" + +# Fetch archive +IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) +{ + echo "Downloading dashcore from $Env:WEBI_PKG_URL to $pkg_download" + & curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part" + & move "$pkg_download.part" "$pkg_download" +} + +IF (!(Test-Path -Path "$pkg_src_dir")) +{ + echo "Installing dashcore" + + # TODO: create package-specific temp directory + # Enter tmp + pushd .local\tmp + + # Remove any leftover tmp cruft + Remove-Item -Path ".\dashcore*" -Recurse -ErrorAction Ignore + + # Unpack archive file into this temporary directory + # Windows BSD-tar handles zip. Imagine that. + echo "Unpacking $pkg_download" + & tar xf "$pkg_download" + + # Settle unpacked archive into place + echo "Install Location: $pkg_src_cmd" + Move-Item -Path ".\dashcore*" -Destination "$pkg_src_dir" + + # Exit tmp + popd +} + +echo "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'" +Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore | out-null +Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse diff --git a/dashcore/install.sh b/dashcore/install.sh new file mode 100644 index 0000000..5f7d7a2 --- /dev/null +++ b/dashcore/install.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# shellcheck disable=SC2034 +# "'pkg_cmd_name' appears unused. Verify it or export it." + +function __init_dashcore() { + set -e + set -u + + ################## + # Install dashcore # + ################## + + # Every package should define these 6 variables + pkg_cmd_name="dashd" + + pkg_dst_cmd="$HOME/.local/opt/dashcore/bin/dashd" + pkg_dst_dir="$HOME/.local/opt/dashcore" + pkg_dst="$pkg_dst_dir" + + pkg_src_cmd="$HOME/.local/opt/dashcore-v$WEBI_VERSION/bin/dashd" + pkg_src_dir="$HOME/.local/opt/dashcore-v$WEBI_VERSION" + pkg_src="$pkg_src_dir" + + # pkg_install must be defined by every package + pkg_install() { + # mv ./dashcore-* ~/.local/opt/dashcore-v0.17.0 + mv ./dashcore-* "${pkg_src_dir}" + } + + # pkg_get_current_version is recommended, but not required + pkg_get_current_version() { + # 'dashd --version' has output in this format: + # Dash Core Daemon version v0.17.0.3 + # This trims it down to just the version number: + # 0.17.0 + dashd --version 2> /dev/null | + head -n 1 | + cut -d ' ' -f 5 | + sed 's:^v::' + } + +} + +__init_dashcore diff --git a/dashcore/releases.js b/dashcore/releases.js new file mode 100644 index 0000000..8f3e9b4 --- /dev/null +++ b/dashcore/releases.js @@ -0,0 +1,28 @@ +'use strict'; + +var github = require('../_common/github.js'); +var owner = 'dashpay'; +var repo = 'dash'; + +module.exports = function (request) { + return github(request, owner, repo).then(function (all) { + all.releases = all.releases.filter(function (rel) { + return !rel.name.endsWith('.asc'); + }); + all.releases.forEach(function (rel) { + if (rel.name.includes('osx64')) { + rel.os = 'macos'; + } + }); + return all; + }); +}; + +if (module === require.main) { + module.exports(require('@root/request')).then(function (all) { + all = require('../_webi/normalize.js')(all); + // just select the first 5 for demonstration + all.releases = all.releases.slice(0, 5); + console.info(JSON.stringify(all, null, 2)); + }); +} diff --git a/dashd/README.md b/dashd/README.md new file mode 100644 index 0000000..ba934f1 --- /dev/null +++ b/dashd/README.md @@ -0,0 +1,9 @@ +--- +title: dashd (alias) +homepage: https://webinstall.dev/dashcore +tagline: | + `dashd` (dash daemon) is an alias for `dashcore` (the dash suite) +alias: dashcore +--- + +See [Dash Core](/dashcore). diff --git a/dashd/install.ps1 b/dashd/install.ps1 new file mode 100644 index 0000000..1d981b8 --- /dev/null +++ b/dashd/install.ps1 @@ -0,0 +1,3 @@ +echo "'dashd@$Env:WEBI_TAG' is an alias for 'dashcore@$Env:WEBI_VERSION'" +IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" } +curl.exe -fsSL "$Env:WEBI_HOST/dashcore@$Env:WEBI_VERSION" | powershell diff --git a/dashd/install.sh b/dashd/install.sh new file mode 100644 index 0000000..d074cb5 --- /dev/null +++ b/dashd/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +set -u + +function __redirect_alias_dashcore() { + echo "'dashd@${WEBI_TAG:-}' (project) is an alias for 'dashcore@${WEBI_VERSION:-}' (command)" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/dashcore@${WEBI_VERSION:-}" | bash +} + +__redirect_alias_dashcore diff --git a/dashd/releases.js b/dashd/releases.js new file mode 100644 index 0000000..0b9481a --- /dev/null +++ b/dashd/releases.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../dashcore/releases.js');