Git Product home page Git Product logo

kdx's Introduction

KDX

KDX is a dedicated desktop process manager for Kaspa node.

KDX offers a miniature console using which user can re-build the Kaspa stack, upgrading Kaspa to the latest version directly from GitHub. The build process is automated via a series of scripts that, if needed, fetch required tools (git, go, gcc) and build Kaspa on the host computer (the build includes various Kaspa utilities including txgen, wallet, kaspactl and others and can be executed against any specific Git branch). KDX console can also be used to migrate Kasparov database if building a version with an updated database schema.

KDX process configuration (available via a simple JSON editor) allows user to specify command-line arguments for executables, as such it is possible to configure KDX to run multiple instances of Kaspa or potentially run multiple networks simultaneously (provided Kaspa nodes do not pro-actively auto-discover each-other)

Like many desktop applications, KDX can run in the tray bar, out of the way.

KDX is built using NWJS and is compatible Windows, Linux and Mac OS X.

Building KDX

Pre-requisites

NOTE: KDX build process builds and includes latest Kaspa binaries from Git master branches. To build from specific branches, you can use --branch... flags (see below).

Generating KDX installers

npm install emanator@latest
git clone [email protected]:aspectron/kdx
cd kdx
# run emanate with one or multiple flags below
#  --portable   create a portable zipped application
#  --innosetup  generate Windows setup executable
#  --dmg        generate a DMG image for Mac OS X
#  --all        generate all OS compatible packages
# following flags can be used to reset the environment
#  --clean		clean build folders: purges cloned `GOPATH` folder
#  --reset		`--clean` + deletes downloaded/cached NWJS and NODE binaries
emanate [--portable | --innosetup | --dmg | --all]

DMG - Building DMG images on Mac OS requires sudo access in order to use system tools such as diskutil to generate images:

sudo emanate --dmg

To build the windows portable deployment, run the following command:

emanate --portable

To build the Windows installer, you need to install Innosetup and run:

emanate --innosetup

Emanator stores build files in the ~/emanator folder

Running KDX from development environment

In addition to Node.js, please download and install Latest NWJS SDK https://nwjs.io - make sure that nw executable is available in the system PATH and that you can run nw from command line.

On Linux / Darwin, as good way to install node and nwjs is as follows:

cd ~
mkdir bin
cd bin

#node - (must be 14.0+)
wget https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-x64.tar.xz
tar xvf node-v14.4.0-linux-x64.tar.xz
ln -s node-v14.4.0-linux-x64 node

#nwjs
wget https://dl.nwjs.io/v0.46.2/nwjs-sdk-v0.46.2-linux-x64.tar.gz
tar xvf nwjs-sdk-v0.46.2-linux-x64.tar.gz
ln -s nwjs-sdk-v0.46.2-linux-x64 nwjs

Once done add the following to ~/.bashrc

export PATH = /home/<user>/bin/node/bin:/home/<user>/bin/nwjs:$PATH

The above method allows you to deploy latest binaries and manage versions by re-targeting symlinks pointing to target folders.

Once you have node and nwjs working, you can continue with KDX.

KDX installation:

npm install emanator@latest
git clone [email protected]:aspectron/kdx
cd kdx
npm install
emanate --local-binaries
nw .

Building installers from specific Kaspa Git branches

--branch argument specifies common branch name for kaspa and kasparov, for example:

emanate --branch=v0.4.0-dev 

The branch for each repository can be overriden using --branch-<repo-name>=<branch-name> arguments as follows:

emanate --branch=v0.4.0-dev --branch-kaspad=v0.3.0-dev
emanate --branch-miningsimulator=v0.1.2-dev

NOTE: KDX build command in KDX console operates in the same manner and accepts --branch... arguments.

KDX Process Manager

Configuration

KDX runtime configuration is declared using a JSON object.

Each instance of the process is declared using it's type (for example: kaspad) and a unique identifier (kd0). Most process configuration objects support args property that allows passing arguments or configuration options directly to the process executable. Depending on the process type, the configuration is passed via command line arguments (kasparov*) or configuration file (kaspad).

Supported process types:

  • kaspad - Kaspa full node
  • kaspaminer - Kaspa sha256 miner

NOTE: For Kaspa, to specify multiple connection endpoints, you must use an array of addresses as follows: "args" : { "connect" : [ "peer-addr-port-a", "peer-addr-port-b", ...] }

Default Configuration File

{
	"kaspad:kd0": {
		"args": {
			"rpclisten": "0.0.0.0:16210",
			"listen": "0.0.0.0:16211",
			"profile": 7000,
			"rpcuser": "user",
			"rpcpass": "pass"
		}
	},
	"kaspad:kd1": {
		"args": {
			"rpclisten": "0.0.0.0:16310",
			"listen": "0.0.0.0:16311",
			"profile": 7001,
			"connect": "0.0.0.0:16211",
			"rpcuser": "user",
			"rpcpass": "pass"
		}
	},
	"simulator:sim0": {
        "blockdelay" : 2000,
		"peers": [ "127.0.0.1:16310" ]
	},
	"pgsql:db0": {
		"port": 18787
	},
	"mqtt:mq0": {
		"port": 18792
	},
	"kasparovsyncd:kvsd0": {
		"args": {
			"rpcserver": "localhost:16310",
			"dbaddress": "localhost:18787"
			"mqttaddress": "localhost:18792",
			"mqttuser" : "user",
			"mqttpass" : "pass"
		}
	},
	"kasparovd:kvd0": {
		"args": {
			"listen": "localhost:11224",
			"rpcserver": "localhost:16310",
			"dbaddress": "localhost:18787"
		}
	}
}

Data Storage

KDX stores it's configuration file as ~/.kdx/config.json. Each configured process data is stored in <datadir>/<process-type>-<process-identifier> where datadir is a user-configurable location. The default datadir location is ~/.kdx/data/. For example, kaspad process with identifier kd0 will be stored in ~/.kdx/data/kaspad-kd0/ and it's logs in ~/.kdx/data/kaspad-kd0/logs/kaspad.log

Kaspa Binaries

KDX can run Kaspa from 2 locations - an integrated bin folder that is included with KDX redistributables and ~/.kdx/bin folder that is created during the Kaspa build process.

KDX Console

KDX Console provides following functionality:

  • Upgrading kasparov using migrate command
  • start and stop controls stack runtime
  • Kaspad RPC command execution
  • Use of test wallet app (KDX auto-configures kasparov address)
  • Rebuilding Kaspa software stack from within the console

Using Kaspad RPC

Kaspad RPC can be accessed via KDX Console using the process identifier. For example:

$ kd0 help
$ kd0 getinfo

Note that RPC methods are case insensitive.

To supply RPC call arguments, you must supply and array of JSON-compliant values (numbers, double-quote-enclosed strings and 'true'/'false'). For example:

$ kd0 getblock "000000b22ce2fcea335cbaf5bc5e4911b0d4d43c1421415846509fc77ec643a7"
{
  "hash": "000000b22ce2fcea335cbaf5bc5e4911b0d4d43c1421415846509fc77ec643a7",
  "confirmations": 83,
  "size": 673,
  "blueScore": 46241,
  ...
}

kdx's People

Contributors

aspect avatar benrod3k avatar hlxeasy avatar n15a avatar sunliwen avatar supertypo avatar surinder83singh avatar thesheepcat avatar ykris45 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kdx's Issues

mkdirp is not a function

Describe the bug
Building results in error message "TypeError: mkdirp is not a fuction"

To Reproduce
Follow build instructions.

Expected behavior
No fatal error messages.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS:
$ lsb_release -a 
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.04
Release:	23.04
Codename:	lunar

Additional context

$ npm install emanator@latest
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

added 222 packages in 2s

25 packages are looking for funding
  run `npm fund` for details

$ git clone https://github.com/aspectron/kdx.git
Cloning into 'kdx'...
remote: Enumerating objects: 5655, done.
remote: Counting objects: 100% (1366/1366), done.
remote: Compressing objects: 100% (532/532), done.
remote: Total 5655 (delta 834), reused 1346 (delta 822), pack-reused 4289
Receiving objects: 100% (5655/5655), 20.59 MiB | 11.99 MiB/s, done.
Resolving deltas: 100% (3449/3449), done.
$ cd kdx/
$ find ~/Downloads/ -name emanate
/home/trash/Downloads/kdx/node_modules/emanator/emanate
/home/trash/Downloads/kdx/node_modules/.bin/emanate
$ /home/trash/Downloads/kdx/node_modules/emanator/emanate --all
_  _ ___  _  _ 
|_/  |  \  \/  
| \_ |__/ _/\_ 
               
[19:09:38] selecting go version go1.16.0
/home/trash/Downloads/kdx/node_modules/emanator/lib/modules/go.js:93
			mkdirp(folder);
			^

TypeError: mkdirp is not a function
    at /home/trash/Downloads/kdx/node_modules/emanator/lib/modules/go.js:93:4
    at new Promise (<anonymous>)
    at Object.go (/home/trash/Downloads/kdx/node_modules/emanator/lib/modules/go.js:87:10)
    at /home/trash/Downloads/kdx/kdx/.emanate:59:28
    at /home/trash/Downloads/kdx/kdx/.emanate:301:3
    at Emanate.emanate (/home/trash/Downloads/kdx/node_modules/emanator/emanate:148:70)
    at Emanate.main (/home/trash/Downloads/kdx/node_modules/emanator/emanate:106:15)

Node.js v18.13.0

uninstalling KDX

I am uninstalling KDX and removing "Data Folder" but then, after installing KDX again, it is not asking for "Recover Wallet" but for Wallet encryption key. Can I totally remove all KDX components so it will forget my Wallet?

miner feature

I can create 4 miners and each one will be use CPU at full and that is the behavior I expect when I am not using my computer.
In case I want to use my computer, I want to be able to temporary disable number of miners by simply checking checkbox on KDX and not editing the "Service Configuration" by hand and restarting everything.
Can such feature can be added?
Thanks
image

Wallet total and Transaction Total do not match

I was trying to balance my transactions against the KDX Wallet total and they do not match. The difference appears to be two missing node award transactions, or the Wallet total is wrong. That Wallet total is greater than the transaction total. Let me know if you need more information. I've also looked at the transactions in KDX Wallet compared to Kaspa Blockchain Explorer. There is lots of discrepancy. I cannot trust the KDX Wallet at the moment.

Thanks

Rand

Make a link between KDX wallet and Kaspa Explorer

Could you team up with https://explorer.kaspa.org/ so that there would be a way for them to link all our address together so that we could see all our transaction at the same place? Having to check for EACH address indivudally is impossible since there is a new address for each transaction... This way, they could also work on a .CSV export option that owuld be complete!

can't receive kas

Withdrawing coins from exchanges and web wallets to desktop wallets, I couldn’t receive them, which caused me to lose a lot of kas. What’s the reason?

Wallet

KDX Wallet "SEND" Funds: I am trying to send funds from my HD Wallet to my manually generated public address. I did a transaction with "SEND" button and nothing happens for a hour - nor funds increased on reception nor funds decreased on KDX HD Wallet. How much time it should take? The node is fully synchronized.

Chinese Sinicization

Part of the Chinese localization has not been completed, and we will continue after waiting for the arrival of other parts of i18n.

AppImage

Please release an Linux AppImage. AppImages are easy to download, install and run and work for any Linux distro.

update to the latest Kaspad version

Can we get an update for the latest Kaspad version? v0.12.6
There has been a lot of nodes going offline and it looks like it's due to a version mismatch between nodes running pure Kaspad and KDX. making the KDX nodes crash.

Wallet Transferring funds delay

Every time i type additional digit in amount the "SEND" window refreshing something on network (fees?) and button "SEND" is disabled. It is better to do a refresh only when focus leaving the input line.

Storage rate is wrong

In the beginning of the sync process the storage rate is 50 TB/year. This is very misleading because it doesn't take pruning into account, and it creates the wrong impression that the hard disk requirements are very high.

KDX Lock Function

Can we add a way to lock the KDX gui wallet without closing it and reopening the application?
If running a node and you unlock the wallet you have no way of locking it again.

Cannot Install Wallet On Recent Mac OS X Versions.

After downloading wallet software from the KDX website, it cannot be installed on MacOS X.

The error message is "kdx.app cannot be opened because the developer cannot be verified. macOS cannot verify that this app is free from malware."

Apparently, KDX developers must go through Apple's official verification process. Apple introduced a developer ID system and app review process to reduce the risk of viruses infecting macOS. Before any app can get on the App Store, both the program and the creator are reviewed and approved by Apple.

So, if one tries to install an app from an unverified developer, or an app from a registered developer, but one that hasn’t been reviewed, they’ll see a corresponding error message.

Add a visual change when the "copy" icon by the Receive Address string is clicked in the Wallet UI tab

Is your feature request related to a problem? Please describe.
When I am ready to copy the current/next receive address on the Wallet tab of KDX, I press the "copy" icon (2 stacked pages) at the end of the receive address string, but it doesn't change color or appear to be "pressed" in any way. There's no visual confirmation that the address was copied to the clipboard. This makes me always want to press it again to ensure the copy action worked.

Describe the solution you'd like
I would like to see a visual change, logically equivalent to a "button press" that shows that the copy action happened, so that I am confident that the address is in my clipboard and I can paste it someplace else.

Describe alternatives you've considered
Clicking it twice to be really sure. Then after I paste elsewhere, visually confirming the pasted string matches the Receive Address string on the wallet tab.

Additional context
Add any other context or screenshots about the feature request here.

[Proposal] New macOS icon

Big Sur updated its system icons to resemble iOS (rounded corners aka "squircles").

The current KDX icon looks pretty out of place in the macOS dock:

Original

Screenshot 2022-09-10 at 16 26 00

Here are a couple ideas for potential new icons that match the look of the OS:

Variant A

Screenshot 2022-09-10 at 16 32 23

Variant B

Screenshot 2022-09-10 at 16 36 26

Happy to discuss these and potentially put forward a PR with an updated PSD/PNG/ICNS.

KDX + LoLminer can run together full node?

Hi!!
Nice app! I made my wallet here xD
Is it possible to run on windows KDX for full node + lolminer (because more options eg. dual mining ETH+Kaspa).
I tried to make it work but have no idea which settings to use, does it need to download and run something else as well? (eg. kaspad).
Atm I made Lolminer to work but not full node on my pc :/ just a pool.

Blank page after creating Wallet

Node synced, try to create wallet set password and password confirmation, after that i got blank page.

Linux fedora 5.18.17-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 11 14:36:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
nw.js v0.67.1
Node v18.7.0

Feature request: balance over time

Hi,

It would be very useful to have a "balance over time" feature in KDX.
Not only for keeping track of your balance growth, but also for tax purposes.
If we could also export transactions, with times of entry and balance over time to CSV or Excel that would extremely useful.
Is this possible to implement?
See screenshot from Radiant wallet for inspiration, you can see balance after every transaction.
This makes tax calculations so much easier.

image

Linux version

Is anyway to get Linux version? or build normally?

Receive address changed in KDX

Describe the bug
My balance is showing up correctly, but the receive address changed somehow.

To Reproduce
Not sure, I only noticed the change

Expected behavior
The receive address should not change.

Screenshots
Here is a screenshot of the wallet as it is showing up right now
image

But the balance is actually from another address
image

Not sure what happened here, I haven't updated the application. I did delete the full kaspad folder at one point but that should not matter I guess.

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu 22]
  • Wallet version: [e.g. 2.12.10]

Additional info
I just recreated the wallet using the 12 words, and this gives me the same result. It shows the right balance for my old receive address but it still shows the wrong receive address.

API error (100): Rejected transaction

Can someone please help, i cant send from wallet, all my funds are stuck, this happened after i tried to send some kaspa to the krc wallet kasware

API error (100): Rejected transaction 7d02c783f6f474a2cbd4ef9bfbb6015daa626e138494c9d51a30acc10cad15f0: output (a8768548e965a5a7a52a0488534cf18cf6b508d3096476c5e868e687388b0012, 1) already spent by transaction 2edc3a7e7e5f817271d48a4515edeebbee40400a0d5ee3d9e3b5f68bf51f637d in the memory pool
{"mass":1151,"satoshis":4688904664601,"utxoCount":1,"utxos":[{"address":"kaspa:qqpjfs5gp543njms2xhj2277zm2hl4rclr3wv6zca3aanh942z6ucemqyygt3","txId":"a8768548e965a5a7a52a0488534cf18cf6b508d3096476c5e868e687388b0012","outputIndex":1,"script":"32 0x0324c2880d2b19cb7051af252bde16d57fd478f8e2e66858ec7bd9dcb550b5cc OP_CHECKSIG","satoshis":4688904664601,"blockDaaScore":"76971568","scriptPublicKeyVersion":0,"id":"a8768548e965a5a7a52a0488534cf18cf6b508d3096476c5e868e687388b00121","signatureOPCount":1,"mass":1151,"isCoinbase":false,"scriptPubKey":"200324c2880d2b19cb7051af252bde16d57fd478f8e2e66858ec7bd9dcb550b5ccac"}]}

{"transaction":{"version":0,"inputs":[{"previousOutpoint":{"transactionId":"a8768548e965a5a7a52a0488534cf18cf6b508d3096476c5e868e687388b0012","index":1},"signatureScript":"41df3d302a094391fd43144d85070a6c5cbafbe7327027d3c3cc733cea5944ad4305267a1a4701ef5e9fe4db43e102c55629c983d8b5080182d725bb21c5f934ef01","sequence":0,"sigOpCount":1}],"outputs":[{"amount":9900000000,"scriptPublicKey":{"scriptPublicKey":"20a5349c732978bba9e161b113a3b2643310e8ec2d8ec3d7175bab6b40e0a9ed17ac","version":0}},{"amount":4678904664601,"scriptPublicKey":{"scriptPublicKey":"20ef1a8cc43d95c8a11c4d665dedb04660dec35b559c1ba6c6e4280a01289f8c6fac","version":0}}],"lockTime":0,"payloadHash":"0000000000000000000000000000000000000000000000000000000000000000","subnetworkId":"0000000000000000000000000000000000000000","fee":100000000}}

New Kaspa wallet soon

There is no feature list for the kaspa wallet

Can it create new address for new transactions (for privacy reasons)??

Round up Feature for devfund.

Can we add a roundup donation option to kas wallet? For example if I send 1900 kas if I select a round up feature it will round up to 2000kas, sending 100kas to devfund and 1900kas to my target address. And if you are feeling generous you can select target amount to donate and input any amount you want.

KDX v2.12.3 kd0 status box always showing yellow "connecting" even though it is synched

Describe the bug
After installing KDX 2.12.3, I have kdx running over some time, the log message showing
""2023-05-14 21:25:41.058 [INF] PROT: Accepted block e042af0482bc5a7d2f8cff4afb997daf0e0e936a7a88039ed6fa19377032ac89 via relay
2023-05-14 21:25:41.095 [INF] PROT: Accepted block 1be3b5ee7c8447b92c58f614eca4bf3a7b274cede83e0a304dcc5002409699d7 via relay
2023-05-14 21:25:41.443 [INF] PROT: Accepted block 67b381634514eaa5a21a4e361b2415ab6b5829d2af71df8becedb8485e794e4b via relay
2023-05-14 21:25:43.970 [INF] CMGR: Connecting to [2402:800:6374:bd0b:24a4:91bc:fe96:2147]:16111
2023-05-14 21:25:44.384 [INF] BDAG: Processed 15 blocks and 0 headers in the last 10.86s (29 transactions, 2023-05-14 21:25:47.872 -0600 MDT)
2023-05-14 21:25:44.384 [INF] PROT: Accepted block 952998ed0fb430c15ea0cab3092b199e3879570c6dd39d13022d61784f4e0389 via relay"
And I can see it connected to p2p address as well. I use kaspactl can use rpc port to query block information correctly. But from the KDX Kaspa tab, the status is always connecting. I tried to downgrade to v2.12.2, same thing.

To Reproduce
Steps to reproduce the behavior:

  1. windows 10, download the exe, remove the .kdx folder, and the ones under AppData
  2. run kdx
    3 See error

Expected behavior
After block syched, I should see connected, and number peers, DAG status, difficulty, etc.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: windows 11 pro. 10.0.22621 Build22621
  • Wallet version: v2.12.3

Additional context
Add any other context about the problem here.

Enhancement Request: add a "lock" button on the KDX UI Wallet Tab, so you can hide your balance but leave KDX running and sync'd

As a home wallet/node user, I want to keep my laptops running KDX live continuously. I occasionally want to be able to see my balance or next receive address, but be able to re-lock the wallet without having to exit KDX and re-start it, so that I reduce the risk of someone seeing my balance or sending funds if they broke in and saw the laptop and the KDX UI.

Describe the solution you'd like
Place a "lock" button on the wallet tab, preferably at the top of the column of green buttons, just above the "Compound Transactions" button.
The effect of the button would be to return the wallet to the screen where you can enter a password to open a wallet or create a new wallet.

Describe alternatives you've considered
The only way I've found to lock the wallet is to exit KDX on my Mac or PC, (after stopping the background process), then restarted it to keep it running & sync'd, but locked.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.