Browse Source

Search/Replace for dragonx

pull/1/head
fekt 1 month ago
parent
commit
74c901a945
  1. 6
      Cargo.lock
  2. 10
      Makefile
  3. 36
      README.md
  4. 13
      bip39bug.md
  5. 4
      cli/Cargo.toml
  6. 6
      cli/src/lib.rs
  7. 6
      cli/src/main.rs
  8. 4
      lib/Cargo.toml
  9. 10
      lib/src/lightclient.rs
  10. 6
      lib/src/lightwallet.rs
  11. 72
      mkrelease.sh
  12. 6
      util/build.sh

6
Cargo.lock

@ -1924,7 +1924,7 @@ dependencies = [
]
[[package]]
name = "silentdragonlite-cli"
name = "silentdragonxlite-cli"
version = "1.1.1"
dependencies = [
"byteorder",
@ -1935,12 +1935,12 @@ dependencies = [
"log4rs",
"rustyline",
"shellwords",
"silentdragonlitelib",
"silentdragonxlitelib",
"tiny-bip39",
]
[[package]]
name = "silentdragonlitelib"
name = "silentdragonxlitelib"
version = "0.1.0"
dependencies = [
"base58",

10
Makefile

@ -1,22 +1,22 @@
.PHONY: format help
# Help system from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.DEFAULT_GOAL := help
# Copyright (c) 2019-2022 Jahway603 & The Hush Developers
# Copyright (c) 2019-2024 Jahway603 & The Hush Developers
# Released under the GPLv3
#
# Hush Silentdragonlite-cli Makefile
PROJECT_NAME := "silentdragonlite-cli"
# DragonX Silentdragonlite-cli Makefile
PROJECT_NAME := "silentdragonxlite-cli"
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
about: ## Display release info
printf "Hush Silentdragonlite-cli Makefile by jahway603\n"
printf "DragonX Silentdragonlite-cli Makefile by jahway603\n"
build: ## Build the release
./util/build.sh
cp `pwd`/target/release/$(PROJECT_NAME) .
printf "Hush silentdragonlite-cli is ready for you\n"
printf "DragonX silentdragonxlite-cli is ready for you\n"
clean: ## Clean the repo
cargo clean

36
README.md

@ -1,12 +1,12 @@
# SilentDragonLite CLI
# SilentDragonXLite CLI
`silentdragonlite-cli` is a command line SilentDragonLite light client. To use it, download the latest binary from the releases page and run `./silentdragonlite-cli` or compile it yourself as documented below.
`silentdragonxlite-cli` is a command line SilentDragonXLite light client. To use it, download the latest binary from the releases page and run `./silentdragonxlite-cli` or compile it yourself as documented below.
This will launch the interactive prompt. Type `help` to get a list of commands
## Running in non-interactive mode:
You can also run `silentdragonlite-cli` in non-interactive mode by passing the command you want to run as an argument. For example, `silentdragonlite-cli addresses` will list all wallet addresses and exit.
Run `silentdragonlite-cli help` to see a list of all commands.
You can also run `silentdragonxlite-cli` in non-interactive mode by passing the command you want to run as an argument. For example, `silentdragonxlite-cli addresses` will list all wallet addresses and exit.
Run `silentdragonxlite-cli help` to see a list of all commands.
## Privacy
* While all the keys and transaction detection happens on the client, the server can learn what blocks contain your shielded transactions.
@ -14,17 +14,17 @@ Run `silentdragonlite-cli help` to see a list of all commands.
* Also remember that t-addresses don't provide any privacy protection.
## Notes:
* If you want to run your own server, please see [SilentDragonLite-cli lightwalletd](https://git.hush.is/hush/lightwalletd), and then run `./silentdragonlite-cli --server http://127.0.0.1:9067`. You might also need to pass `--dangerous` if you are using a self-signed TLS certificate.
* If you want to run your own server, please see [SilentDragonXLite-cli lightwalletd](https://git.hush.is/hush/lightwalletd), and then run `./silentdragonxlite-cli --server http://127.0.0.1:9067`. You might also need to pass `--dangerous` if you are using a self-signed TLS certificate.
* The log file is in `~/.silentdragonlite/silentdragonlite-cli.debug.log`. Wallet is stored in `~/.silentdragonlite/silentdragonlite-cli.dat`
* The log file is in `~/.silentdragonxlite/silentdragonxlite-cli.debug.log`. Wallet is stored in `~/.silentdragonxlite/silentdragonxlite-cli.dat`
### Note Management
silentdragonlite does automatic note and utxo management, which means it doesn't allow you to manually select which address to send outgoing transactions from. It follows these principles:
silentdragonxlite does automatic note and utxo management, which means it doesn't allow you to manually select which address to send outgoing transactions from. It follows these principles:
* Defaults to sending shielded transactions, even if you're sending to a transparent address
* Sapling funds need at least 2 confirmations before they can be spent
* Can select funds from multiple shielded addresses in the same transaction
* Will automatically shield your transparent funds at the first opportunity
* When sending an outgoing transaction to a shielded address, silentdragonlite can decide to use the transaction to additionally shield your transparent funds (i.e., send your transparent funds to your own shielded address in the same transaction)
* When sending an outgoing transaction to a shielded address, silentdragonxlite can decide to use the transaction to additionally shield your transparent funds (i.e., send your transparent funds to your own shielded address in the same transaction)
## Compiling from source
@ -61,10 +61,10 @@ The above avoids piping the output of curl to bash (bad idea) and avoids using b
Run the following commands to compile on your computer.
```shell script
git clone https://git.hush.is/hush/silentdragonlite-cli
cd silentdragonlite-cli
git clone https://git.hush.is/dragonx/silentdragonxlite-cli
cd silentdragonxlite-cli
cargo build --release
./target/release/silentdragonlite-cli
./target/release/silentdragonxlite-cli
```
#### Or build with make
@ -77,23 +77,23 @@ make build
```
## Options
Here are some CLI arguments you can pass to `silentdragonlite-cli`. Please run `silentdragonlite-cli --help` for the full list.
Here are some CLI arguments you can pass to `silentdragonxlite-cli`. Please run `silentdragonxlite-cli --help` for the full list.
* `--server`: Connect to a custom SilentDragonLite lightwalletd server.
* Example: `./silentdragonlite-cli --server 127.0.0.1:9067`
* Example: `./silentdragonlite-cli --server lite.hush.is`
* `--server`: Connect to a custom SilentDragonXLite lightwalletd server.
* Example: `./silentdragonxlite-cli --server 127.0.0.1:9067`
* Example: `./silentdragonxlite-cli --server lite.dragonx.is`
* `--seed`: Restore a wallet from a seed phrase. **Note** that this will fail if there is an existing wallet. Delete (or move) any existing wallet to restore from the 24-word seed phrase
* Example: `./silentdragonlite-cli --seed "twenty four words seed phrase"`
* Example: `./silentdragonxlite-cli --seed "twenty four words seed phrase"`
* `--recover`: Attempt to recover the seed phrase from a corrupted wallet
* `-n, --nosync`: By default, Silentdragonlite-cli will sync the wallet at startup, so use this option to prevent the automatic sync at startup
### Support
For support or other questions, join us on [Telegram](https://hush.is/telegram), or toot at our [Mastodon](https://fosstodon.org/@myhushteam) or join our [Telegram Support](https://hush.is/telegram_support) or [file an issue](https://git.hush.is/hush/silentdragonlite-cli/issues).
For support or other questions, join us on [Telegram](https://dragonx.is/telegram) or [file an issue](https://git.hush.is/dragonx/silentdragonxlite-cli/issues).
## Copyright
Copyright The Hush Developers 2019-2022
Copyright The Hush Developers 2019-2024
## License

13
bip39bug.md

@ -1,13 +0,0 @@
## silentdragonlite-cli BIP39 derivation bug
In v1.0 of silentdragonlite-cli, there was a bug that incorrectly derived HD wallet keys after the first key. That is, the first key, address was correct, but subsequent ones were not.
The issue was that the 32-byte seed was directly being used to derive then subsequent addresses instead of the 64-byte pkdf2(seed). The issue affected both t and z addresses.
Note that no funds are at risk. The issue is that, if in the future, you import the seed into a different wallet, you might not see all your addresses in the new wallet, so it's better to fix it now.
## Fix
If you start a wallet that has this bug, you'll be notified.
The bug can be automatically fixed by the wallet by running the `fixbip39bug` command. Just start `silentdragonlite-cli` and type `fixbip39bug`.
If you have any funds in the incorrect addresses, they'll be sent to yourself, and the correct addresses re-derived.

4
cli/Cargo.toml

@ -1,5 +1,5 @@
[package]
name = "silentdragonlite-cli"
name = "silentdragonxlite-cli"
version = "1.1.1"
edition = "2018"
@ -14,5 +14,5 @@ http = "0.2"
byteorder = "1"
tiny-bip39 = "0.6.2"
silentdragonlitelib = { path = "../lib/" }
silentdragonxlitelib = { path = "../lib/" }

6
cli/src/lib.rs

@ -4,7 +4,7 @@ use std::sync::mpsc::{channel, Sender, Receiver};
use log::{info, error};
use silentdragonlitelib::{commands,
use silentdragonxlitelib::{commands,
lightclient::{LightClient, LightClientConfig},
};
@ -69,11 +69,11 @@ pub fn report_permission_error() {
eprintln!("HOME: {}", home);
eprintln!("Executable: {}", current_executable.display());
if home == "/" {
eprintln!("User {} must have permission to write to '{}.silentdragonlite/' .",
eprintln!("User {} must have permission to write to '{}.silentdragonxlite/' .",
user,
home);
} else {
eprintln!("User {} must have permission to write to '{}/.silentdragonlite/' .",
eprintln!("User {} must have permission to write to '{}/.silentdragonxlite/' .",
user,
home);
}

6
cli/src/main.rs

@ -1,5 +1,5 @@
use silentdragonlitelib::lightclient::{self, LightClientConfig};
use silentdragonlite_cli::{configure_clapapp,
use silentdragonxlitelib::lightclient::{self, LightClientConfig};
use silentdragonxlite_cli::{configure_clapapp,
report_permission_error,
startup,
start_interactive,
@ -10,7 +10,7 @@ use log::error;
pub fn main() {
// Get command line arguments
use clap::{App, Arg};
let fresh_app = App::new("SilentDragonLite CLI");
let fresh_app = App::new("SilentDragonXLite CLI");
let configured_app = configure_clapapp!(fresh_app);
let matches = configured_app.get_matches();

4
lib/Cargo.toml

@ -1,7 +1,7 @@
[package]
name = "silentdragonlitelib"
name = "silentdragonxlitelib"
version = "0.1.0"
edition = "2018"
edition = "2024"
[features]
default = ["embed_params"]

10
lib/src/lightclient.rs

@ -42,9 +42,9 @@ use crate::ANCHOR_OFFSET;
mod checkpoints;
pub const DEFAULT_SERVER: &str = "https://lite.hush.land";
pub const WALLET_NAME: &str = "silentdragonlite-wallet.dat";
pub const LOGFILE_NAME: &str = "silentdragonlite-wallet.debug.log";
pub const DEFAULT_SERVER: &str = "https://lite.dragonx.is";
pub const WALLET_NAME: &str = "silentdragonxlite-wallet.dat";
pub const LOGFILE_NAME: &str = "silentdragonxlite-wallet.debug.log";
#[derive(Clone, Debug)]
pub struct WalletStatus {
@ -153,10 +153,10 @@ impl LightClientConfig {
} else {
if cfg!(target_os="macos") || cfg!(target_os="windows") {
zcash_data_location = dirs::data_dir().expect("Couldn't determine app data directory!");
zcash_data_location.push("silentdragonlite");
zcash_data_location.push("silentdragonxlite");
} else {
zcash_data_location = dirs::home_dir().expect("Couldn't determine home directory!");
zcash_data_location.push(".silentdragonlite");
zcash_data_location.push(".silentdragonxlite");
};
match &self.chain_name[..] {

6
lib/src/lightwallet.rs

@ -2281,10 +2281,10 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64
let mut builder = Builder::new(height);
// A note on t addresses
// Funds received by t-addresses can't be explicitly spent in silentdragonlite.
// silentdragonlite will lazily consolidate all t address funds into your shielded addresses.
// Funds received by t-addresses can't be explicitly spent in silentdragonxlite.
// silentdragonxlite will lazily consolidate all t address funds into your shielded addresses.
// Specifically, if you send an outgoing transaction that is sent to a shielded address,
// silentdragonlite will add all your t-address funds into that transaction, and send them to your shielded
// silentdragonxlite will add all your t-address funds into that transaction, and send them to your shielded
// address as change.
let tinputs: Vec<_> = self.get_utxos().iter()
.filter(|utxo| utxo.unconfirmed_spent.is_none()) // Remove any unconfirmed spends

72
mkrelease.sh

@ -41,71 +41,71 @@ cd ..
cargo build --release
#macOS
rm -rf target/macOS-silentdragonlite-cli-v$APP_VERSION
mkdir -p target/macOS-silentdragonlite-cli-v$APP_VERSION
cp target/release/silentdragonlite-cli target/macOS-silentdragonlite-cli-v$APP_VERSION/
rm -rf target/macOS-silentdragonxlite-cli-v$APP_VERSION
mkdir -p target/macOS-silentdragonxlite-cli-v$APP_VERSION
cp target/release/silentdragonxlite-cli target/macOS-silentdragonxlite-cli-v$APP_VERSION/
# For Windows and Linux, build via docker
docker run --rm -v $(pwd)/:/opt/silentdragonlite-cli rustbuild:latest bash -c "cd /opt/silentdragonlite-cli && cargo build --release && cargo build --release --target armv7-unknown-linux-gnueabihf && cargo build --release --target aarch64-unknown-linux-gnu && SODIUM_LIB_DIR='/opt/libsodium-win64/lib/' cargo build --release --target x86_64-pc-windows-gnu"
docker run --rm -v $(pwd)/:/opt/silentdragonxlite-cli rustbuild:latest bash -c "cd /opt/silentdragonxlite-cli && cargo build --release && cargo build --release --target armv7-unknown-linux-gnueabihf && cargo build --release --target aarch64-unknown-linux-gnu && SODIUM_LIB_DIR='/opt/libsodium-win64/lib/' cargo build --release --target x86_64-pc-windows-gnu"
# Now sign and zip the binaries
# macOS
gpg --batch --output target/macOS-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli.sig --detach-sig target/macOS-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli
gpg --batch --output target/macOS-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli.sig --detach-sig target/macOS-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli
cd target
cd macOS-silentdragonlite-cli-v$APP_VERSION
gsha256sum silentdragonlite-cli > sha256sum.txt
cd macOS-silentdragonxlite-cli-v$APP_VERSION
gsha256sum silentdragonxlite-cli > sha256sum.txt
cd ..
zip -r macOS-silentdragonlite-cli-v$APP_VERSION.zip macOS-silentdragonlite-cli-v$APP_VERSION
zip -r macOS-silentdragonxlite-cli-v$APP_VERSION.zip macOS-silentdragonxlite-cli-v$APP_VERSION
cd ..
#Linux
rm -rf target/linux-silentdragonlite-cli-v$APP_VERSION
mkdir -p target/linux-silentdragonlite-cli-v$APP_VERSION
cp target/release/silentdragonlite-cli target/linux-silentdragonlite-cli-v$APP_VERSION/
gpg --batch --output target/linux-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli.sig --detach-sig target/linux-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli
rm -rf target/linux-silentdragonxlite-cli-v$APP_VERSION
mkdir -p target/linux-silentdragonxlite-cli-v$APP_VERSION
cp target/release/silentdragonxlite-cli target/linux-silentdragonxlite-cli-v$APP_VERSION/
gpg --batch --output target/linux-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli.sig --detach-sig target/linux-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli
cd target
cd linux-silentdragonlite-cli-v$APP_VERSION
gsha256sum silentdragonlite-cli > sha256sum.txt
cd linux-silentdragonxlite-cli-v$APP_VERSION
gsha256sum silentdragonxlite-cli > sha256sum.txt
cd ..
zip -r linux-silentdragonlite-cli-v$APP_VERSION.zip linux-silentdragonlite-cli-v$APP_VERSION
zip -r linux-silentdragonxlite-cli-v$APP_VERSION.zip linux-silentdragonxlite-cli-v$APP_VERSION
cd ..
#Windows
rm -rf target/Windows-silentdragonlite-cli-v$APP_VERSION
mkdir -p target/Windows-silentdragonlite-cli-v$APP_VERSION
cp target/x86_64-pc-windows-gnu/release/silentdragonlite-cli.exe target/Windows-silentdragonlite-cli-v$APP_VERSION/
gpg --batch --output target/Windows-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli.sig --detach-sig target/Windows-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli.exe
rm -rf target/Windows-silentdragonxlite-cli-v$APP_VERSION
mkdir -p target/Windows-silentdragonxlite-cli-v$APP_VERSION
cp target/x86_64-pc-windows-gnu/release/silentdragonxlite-cli.exe target/Windows-silentdragonxlite-cli-v$APP_VERSION/
gpg --batch --output target/Windows-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli.sig --detach-sig target/Windows-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli.exe
cd target
cd Windows-silentdragonlite-cli-v$APP_VERSION
gsha256sum silentdragonlite-cli.exe > sha256sum.txt
cd Windows-silentdragonxlite-cli-v$APP_VERSION
gsha256sum silentdragonxlite-cli.exe > sha256sum.txt
cd ..
zip -r Windows-silentdragonlite-cli-v$APP_VERSION.zip Windows-silentdragonlite-cli-v$APP_VERSION
zip -r Windows-silentdragonxlite-cli-v$APP_VERSION.zip Windows-silentdragonxlite-cli-v$APP_VERSION
cd ..
#Armv7
rm -rf target/Armv7-silentdragonlite-cli-v$APP_VERSION
mkdir -p target/Armv7-silentdragonlite-cli-v$APP_VERSION
cp target/armv7-unknown-linux-gnueabihf/release/silentdragonlite-cli target/Armv7-silentdragonlite-cli-v$APP_VERSION/
gpg --batch --output target/Armv7-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli.sig --detach-sig target/Armv7-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli
rm -rf target/Armv7-silentdragonxlite-cli-v$APP_VERSION
mkdir -p target/Armv7-silentdragonxlite-cli-v$APP_VERSION
cp target/armv7-unknown-linux-gnueabihf/release/silentdragonxlite-cli target/Armv7-silentdragonxlite-cli-v$APP_VERSION/
gpg --batch --output target/Armv7-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli.sig --detach-sig target/Armv7-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli
cd target
cd Armv7-silentdragonlite-cli-v$APP_VERSION
gsha256sum silentdragonlite-cli > sha256sum.txt
cd Armv7-silentdragonxlite-cli-v$APP_VERSION
gsha256sum silentdragonxlite-cli > sha256sum.txt
cd ..
zip -r Armv7-silentdragonlite-cli-v$APP_VERSION.zip Armv7-silentdragonlite-cli-v$APP_VERSION
zip -r Armv7-silentdragonxlite-cli-v$APP_VERSION.zip Armv7-silentdragonxlite-cli-v$APP_VERSION
cd ..
#AARCH64
rm -rf target/aarch64-silentdragonlite-cli-v$APP_VERSION
mkdir -p target/aarch64-silentdragonlite-cli-v$APP_VERSION
cp target/aarch64-unknown-linux-gnu/release/silentdragonlite-cli target/aarch64-silentdragonlite-cli-v$APP_VERSION/
gpg --batch --output target/aarch64-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli.sig --detach-sig target/aarch64-silentdragonlite-cli-v$APP_VERSION/silentdragonlite-cli
rm -rf target/aarch64-silentdragonxlite-cli-v$APP_VERSION
mkdir -p target/aarch64-silentdragonxlite-cli-v$APP_VERSION
cp target/aarch64-unknown-linux-gnu/release/silentdragonxlite-cli target/aarch64-silentdragonxlite-cli-v$APP_VERSION/
gpg --batch --output target/aarch64-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli.sig --detach-sig target/aarch64-silentdragonxlite-cli-v$APP_VERSION/silentdragonxlite-cli
cd target
cd aarch64-silentdragonlite-cli-v$APP_VERSION
gsha256sum silentdragonlite-cli > sha256sum.txt
cd aarch64-silentdragonxlite-cli-v$APP_VERSION
gsha256sum silentdragonxlite-cli > sha256sum.txt
cd ..
zip -r aarch64-silentdragonlite-cli-v$APP_VERSION.zip aarch64-silentdragonlite-cli-v$APP_VERSION
zip -r aarch64-silentdragonxlite-cli-v$APP_VERSION.zip aarch64-silentdragonxlite-cli-v$APP_VERSION
cd ..

6
util/build.sh

@ -3,7 +3,7 @@
# Distributed under the GPLv3 software license, see the accompanying
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
# Purpose: Script to build Hush silentdragonlite on x86 64-bit arch
# Purpose: Script to build Hush silentdragonxlite on x86 64-bit arch
## Usage: ./util/build.sh
# Check if rustc is installed on system and exits if it is not
@ -46,5 +46,5 @@ if [ $? -ne 0 ]; then
fi
echo ""
echo "Hush silentdragonlite-cli is now compiled for you. Enjoy and reach out if you need support."
echo "For options, run ./silentdragonlite --help"
echo "Hush silentdragonxlite-cli is now compiled for you. Enjoy and reach out if you need support."
echo "For options, run ./silentdragonxlite --help"

Loading…
Cancel
Save