Code Monkey home page Code Monkey logo

goxdagwallet's Introduction

Cross Platform XDAG GUI Wallet

This is a cross-platform XDAG GUI wallet, especially for macOS and Linux, powered by fyne.

Fyne is a cross-platform GUI in Go inspired by Material Design.

The wallet can run on Windows, Linux, Mac now.

Mobile version is coming.

usage

  • usage: by command-line parameter -help
  • 3 run modes: gui(default), cli, server, by commnad-line parameter -mode
  • cli commands:
    • help -- display commands list
    • exit -- exit cli wallet
    • account -- display address of wallet account
    • balance -- display balance of wallet account
    • xfer V A R -- transfer V coins to address A with remark R
    • mnemonic -- display mnemonic of wallet account
    • export P -- export mnemonic to file P
  • jsonrpc server: by command-line parameter -mode server -ip <ip address> -port <port number>
    • method: Xdag.Unlock
      • params: ["<wallet password>"]
      • response: {"id":1,"result":"success","error":null}
    • method: Xdag.Lock
      • params: ["<wallet password>"]
      • response: {"id":1,"result":"success","error":null}
    • method: Xdag.Account
      • params: [""]
      • response: {"id":1,"result": "<wallet address>","error":null}
    • method: Xdag.Balance
      • params: [""]
      • response: {"id":1,"result": "<wallet balance>","error":null}
    • method: Xdag.Balance
      • params: ["<wallet address>"]
      • response: {"id":1,"result": "<balance of the address>","error":null}
    • method: Xdag.Transfer
      • params: [{"amount":"<amount>","address":"<to address>","remark":"<remark>"}]
      • response: {"id":1,"result": {"Status":"success","TxHash":"<transaction hash>"},"error":null}

repo structure

  • clib - a wrapper of XDAG Wallet C library
    • xDagWallet - XDAG wallet C library
  • wallet - golang XDAG wallet app
    • i18n - international strings
    • data - i18n config json, fonts
    • images - image and icon bundled in components/resource.go
    • component - ui of wallet window
    • config - wallet config
    • wallet_state - wallet state
    • xlog - wallet log
    • xdago - bip32,bip39,bip44
    • cli - command line mode
    • server - rpc server mode

build

enter /clib

build runtime library with CMakeLists.txt

need MingW64 in Windows

enter /wallet

$ go mod tidy

$ CGO_ENABLED=1 go build

in Windows

> CGO_ENABLED=1 go build -ldflags -H=windowsgui

in Mac

if library not found , go to /wallet/components/wallet_cgo.go

change the library path in code:

//#cgo darwin LDFLAGS: ....

deployment

enter /wallet

copy goXdagWallet(.exe), wallet-config.json and data folder to your deployment path.

Windows

also need copy libcrypto-1_1-x64.dll and libwinpthread-1.dll in MingW64's bin path to deployment path.

Linux and Mac

need install secp256k1 and openssl first

  • Ubuntu and Debian:

$ sudo apt-get install libsecp256k1-dev openssl libssl-dev

  • Fedora and Centos:

$ sudo yum install openssl openssl-devel

download and build from source

github.com/bitcoin-core/secp256k1.git

  • Manjaro and Arch linux:

$ sudo pacman libsecp256k1 openssl

  • Mac

$ brew install openssl

$ echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

$ source ~/.bash_profile

build secp256k1 from source

github.com/bitcoin-core/secp256k1.git

features

  • frequently transferred addresses list
  • history query filter and pagination

goxdagwallet's People

Contributors

swordlet avatar

Stargazers

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

Watchers

 avatar  avatar

goxdagwallet's Issues

Transactions not displayed and false amount.

Hi,
I have made just 2 quick transaction of 100XDAG each, at first i had 213 XDAG in my wallet.
TX is showed in the block explorer, but not in the wallet, and my total amount is now of 207 XDAG, when it should be 13XDAG...

Wallet adress : k+ccOPhuqH5dnWiz0ILFayIS4r/cFTcW

Thanks for your work.

Unable to backup a wallet where you havent set up a password

Hi,

i have an old wallet that is use usually for some test, where i havent setup a password, if i backup it by copying files in the folder of this new version, i cannot open it as i havent setup a password, ths wallet stay stuck to ask a password...

Static build for Linux?

Could you build wallet for Linux as static?

I have Linux Mint 19.3 (Ubuntu 18.04 based) and I cannot start the wallet:

$ ./goXdagWallet 
./goXdagWallet: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./goXdagWallet)
./goXdagWallet: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./goXdagWallet)

cannot create a new wallet - linux ubuntu 22.04

simply downloaded the linux version. run the command to start the wallet. Click create . type password. Once more. It says
"password incorrect" on a fresh install . Same issue. remove files and redo it.

[suggest] improve transfer panel

Just a small suggestion, in the "transfer" panel I find that a "max" button is missing to put the maximum amount, and also the isplay of the amount of the current wallet. Thanks.

BUG : Old wallet get account balance failed

Title
Old address get account balance failed in xdagj wallet ,cannot transfer xdag

Software information (please complete the following information)

  • OS version : windows11
  • XDAGJ version : 060 062 063 064 065 066

Describe the bug
My address is "BXcU4+fYPwM0mHNQ863rLDTmnwu+GpaT", when I use XDAGJ version : 060 062 063 064 065 066
image

My wallet is useable when I used version 053, but 053 cannot connect to mine pool now
And I change version 053/054/056 wallet-config.json, change "pool_address": "https://mainnet-rpc.xdagj.org", but the error is came out : [ERROR]wallet_cgo.go:141: Cann't resolve host.

I try to transfer to new account , but that cannot happen with balance get fail
image

Anyone can help me ?
image

Connecting pool...

Hello,
I have had my Wallet stuck at "connecting pool..." for about 2 weeks now.
I was in 0.5.1 but I have the same problem importing my wallet in 0.5.4.
same problem when importing on another PC ( Win11, Win10 )

[Suggest] Browsing files / default folder

When browsing files (for import old wallet for example), the default place is still personal folder.

Should be more usefull if goXdagWallet open its own folder. More logical.

Thanks @swordlet for make this possible !

Suggest - Compare local time with NTP time before any transfert

Regularly, internal clock synchronization problems block transfers.

There should be a way to check if the time on the computer is the same as the NTP time before any tx, and warn user if time isn't sync.

Here is an example of a check proposed by ChatGPT:

package main

import (
	"fmt"
	"net"
	"time"

	"github.com/beevik/ntp"
)

func compareTimeWithNTPServer(ntpServer string) (time.Duration, time.Duration, error) {
	startTime := time.Now()

	// Get the current time from the NTP server
	ntpTime, err := ntp.Time(ntpServer)
	if err != nil {
		return 0, 0, err
	}

	endTime := time.Now()

	// Calculate the round-trip request time
	requestTime := endTime.Sub(startTime)

	// Calculate the difference between system time and NTP server time
	timeDifference := ntpTime.Sub(endTime)

	return requestTime, timeDifference, nil
}

func main() {
	ntpServer := "pool.ntp.org"

	requestTime, timeDifference, err := compareTimeWithNTPServer(ntpServer)
	if err != nil {
		fmt.Println("Error comparing clocks:", err)
		return
	}

	fmt.Println("Request Time:", requestTime)
	fmt.Println("Difference between system time and NTP server time:", timeDifference)
}

In this example, we use the github.com/beevik/ntp library to interact with the NTP server and obtain the current time. Make sure to install this library by running the command go get github.com/beevik/ntp before running the code.

The compareTimeWithNTPServer function takes the NTP server name as a parameter and returns the round-trip request time (requestTime), the difference between system time and NTP server time (timeDifference), and any potential errors.

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.