GithubHelp home page GithubHelp logo

peterzen / kohola Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 22.68 MB

Multi platform dcrwallet frontend for power users

License: ISC License

Go 26.27% JavaScript 54.80% Shell 0.10% TypeScript 18.53% Dockerfile 0.04% SCSS 0.22% Batchfile 0.02% Objective-C 0.01% C 0.01%
decred dcrwallet

kohola's People

Contributors

bgptr avatar dependabot[bot] avatar peterzen avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kohola's Issues

WebKitNetworkProcess CPU consumption

After some startups,WebKitNetworkProcess eats 100% CPU. Can't always reproduce - it happens around 50% or so of the time, not after all startups.

May have something to do with a race condition in exchangeratebot/coingecko.go but needs further investigation/profiling.

32321 peter     20   0 82.425g  50980  37108 R  98.7  0.3   0:31.05 WebKitNetworkProcess

UTXO and transaction labeling

On the frontend, the user should be able to add labels to UTXOs and transactions (both on existing transactions and in the Receive dialog - in the latter case the label should be associated with the generated receive address and later linked to the incoming TX).

The labels should be stored in a local database which does not exist yet; perhaps LevelDB.

Implement mixing statistics

  • Hide CSPP transactions from Recent transactions table
  • Add separate Mixer stats tab to Privacy page
  • Implement denomination filter/date based grouping
  • Add mixing stats chart to Mixer stats

Market time frame selector warning

When the dropdown is changed, the below warning is logged:

2react-dom.development.js:89 Warning: Cannot update a component from inside the function body of a different component.
    in ExchangeRateChart (created by ConnectFunction)
    in ConnectFunction (created by Market)
    in div (created by CardBody)
    in CardBody (created by Market)
    in div (created by Card)
    in Card (created by Market)
    in div (created by Market)
    in div (created by Col)
    in Col (created by Market)
    in div (created by Row)
    in Row (created by Market)
    in div (created by Market)
    in Market (created by ConnectFunction)
    in ConnectFunction (created by Context.Consumer)
    in withRouter(Connect(Market)) (created by Context.Consumer)
    in Route (created by App)
    in Switch (created by App)
    in div (created by Container)
    in Container (created by App)
    in div (created by AppSidebar)
    in div (created by AppSidebar)
    in div (created by AppSidebar)
    in AppSidebar (created by ConnectFunction)
    in ConnectFunction (created by App)
    in main (created by App)
    in Router (created by ConnectedRouter)
    in ConnectedRouter (created by Context.Consumer)
    in ConnectedRouterWithContext (created by ConnectFunction)
    in ConnectFunction (created by App)
    in App (created by ConnectFunction)
    in ConnectFunction (created by HotExportedConnect(App))
    in AppContainer (created by HotExportedConnect(App))
    in HotExportedConnect(App)
    in Provider
    in AppContainer

Finalize Market section charts

The charts in the market section in a proof of concept state right now, they need to be fixed up:

  • Y axis values are off at the moment, probably due to the value normalization in frontend/src/features/market/marketSlice.ts. We probably need to adjust the displayed axis values through the recharts API
  • X axis labels currently show raw UNIX timestamps, these should be rendered as dates (resolution depending on the selected time frame setting)
  • Time frame should be selectable (for all charts) from a dropdown:
    • 1 day
    • 3 days
    • 7 days
    • 1 month

image

Ticketbuyer and mixer defaults are saved incorrectly

The TB and mixer default settings templates are currently not linked to an endpoint ID in the configuration. This leads to the wrong template to be loaded after the user switches to a different endpoint.

Solution: save the templates in the WalletPreferences object.

Disabling config file encryption

Should we let users disable the config file encryption?

image

Cons:

  • once a file changes in a filesystem that's being backed up (which $HOME usually is), TimeCapsule and other snapshot/backup schemes pick it up and back it up right away -> if a user disables the encryption by mistake, they will have to roll their wallet credentials over to undo the damage.

Pros:

  • ?

Should we let our users shoot themselves in the foot? If this is really needed, they can manually remove the config file and create a new one without the encryption turned on.

Coin control

Add UTXO selection ability to the Send transaction GUI flow

  • CreateRawTransaction implementation in dcrwallet
  • Implement GUI

systray crashes on application startup

goroutine 0 [idle]:
runtime: unknown pc 0x7f4d3370e18b
stack: frame={sp:0x7f4d037fd650, fp:0x0} stack=[0x7f4d02ffdef0,0x7f4d037fdaf0)
0x00007f4d037fd550:  0x0000000000000000  0x0000000833bc6a46 
0x00007f4d037fd560:  0x00007f4cfc01b900  0x00007f4d357146d8 
0x00007f4d037fd570:  0xffffffff00000000  0x00007f4d037fd590 
0x00007f4d037fd580:  0x00007f4d037fd750  0x0000000000000004 
0x00007f4d037fd590:  0x0000000000000003  0x00007f4cfc01bc30 
0x00007f4d037fd5a0:  0x0000000000000100  0x0000000000000090 
0x00007f4d037fd5b0:  0x0000000000000008  0x00007f4cfc020840 
0x00007f4d037fd5c0:  0x00007f4d037fd770  0x00007f4d037fd760 
0x00007f4d037fd5d0:  0x0000000003cb8020  0x00007f4d33c91c23 
0x00007f4d037fd5e0:  0x0000000003d46b00  0x00007f4d037fd728 
0x00007f4d037fd5f0:  0x0000000000000060  0x0000000000000007 
0x00007f4d037fd600:  0x0000000003db8b20  0x00007f4d33c920f3 
0x00007f4d037fd610:  0x0000000000000001  0x00007f4cfc020950 
0x00007f4d037fd620:  0x00000000000003aa  0x0000000000000004 
0x00007f4d037fd630:  0x00007f4d037fd7e0  0x00007f4d037fd7d0 
0x00007f4d037fd640:  0x0000000003cb8020  0x00007f4d33c91c23 
0x00007f4d037fd650: <0x0000000000000000  0x0000000000000008 
0x00007f4d037fd660:  0x00007f4d037fd680  0x0000000000000008 
0x00007f4d037fd670:  0x00007f4cfc020940  0x00007f4d33bcfbea 
0x00007f4d037fd680:  0x0000000000000001  0x9d5feb2a7009ef00 
0x00007f4d037fd690:  0x00007f4c000003aa  0x0000000003cfd240 
0x00007f4d037fd6a0:  0x00007f4cfc00a100  0x00007f4d33b856e0 
0x00007f4d037fd6b0:  0x0000000003d37770  0x00007f4cfc020950 
0x00007f4d037fd6c0:  0x0000000000000001  0x00007f4d33b839c8 
0x00007f4d037fd6d0:  0xfffffffe7fffffff  0xffffffffffffffff 
0x00007f4d037fd6e0:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd6f0:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd700:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd710:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd720:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd730:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd740:  0xffffffffffffffff  0xffffffffffffffff 
runtime: unknown pc 0x7f4d3370e18b
stack: frame={sp:0x7f4d037fd650, fp:0x0} stack=[0x7f4d02ffdef0,0x7f4d037fdaf0)
0x00007f4d037fd550:  0x0000000000000000  0x0000000833bc6a46 
0x00007f4d037fd560:  0x00007f4cfc01b900  0x00007f4d357146d8 
0x00007f4d037fd570:  0xffffffff00000000  0x00007f4d037fd590 
0x00007f4d037fd580:  0x00007f4d037fd750  0x0000000000000004 
0x00007f4d037fd590:  0x0000000000000003  0x00007f4cfc01bc30 
0x00007f4d037fd5a0:  0x0000000000000100  0x0000000000000090 
0x00007f4d037fd5b0:  0x0000000000000008  0x00007f4cfc020840 
0x00007f4d037fd5c0:  0x00007f4d037fd770  0x00007f4d037fd760 
0x00007f4d037fd5d0:  0x0000000003cb8020  0x00007f4d33c91c23 
0x00007f4d037fd5e0:  0x0000000003d46b00  0x00007f4d037fd728 
0x00007f4d037fd5f0:  0x0000000000000060  0x0000000000000007 
0x00007f4d037fd600:  0x0000000003db8b20  0x00007f4d33c920f3 
0x00007f4d037fd610:  0x0000000000000001  0x00007f4cfc020950 
0x00007f4d037fd620:  0x00000000000003aa  0x0000000000000004 
0x00007f4d037fd630:  0x00007f4d037fd7e0  0x00007f4d037fd7d0 
0x00007f4d037fd640:  0x0000000003cb8020  0x00007f4d33c91c23 
0x00007f4d037fd650: <0x0000000000000000  0x0000000000000008 
0x00007f4d037fd660:  0x00007f4d037fd680  0x0000000000000008 
0x00007f4d037fd670:  0x00007f4cfc020940  0x00007f4d33bcfbea 
0x00007f4d037fd680:  0x0000000000000001  0x9d5feb2a7009ef00 
0x00007f4d037fd690:  0x00007f4c000003aa  0x0000000003cfd240 
0x00007f4d037fd6a0:  0x00007f4cfc00a100  0x00007f4d33b856e0 
0x00007f4d037fd6b0:  0x0000000003d37770  0x00007f4cfc020950 
0x00007f4d037fd6c0:  0x0000000000000001  0x00007f4d33b839c8 
0x00007f4d037fd6d0:  0xfffffffe7fffffff  0xffffffffffffffff 
0x00007f4d037fd6e0:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd6f0:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd700:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd710:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd720:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd730:  0xffffffffffffffff  0xffffffffffffffff 
0x00007f4d037fd740:  0xffffffffffffffff  0xffffffffffffffff 

goroutine 7 [syscall]:
runtime.cgocall(0xe59fb0, 0xc000054780)
	/usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc000054758 sp=0xc000054720 pc=0x48a13c
github.com/getlantern/systray._Cfunc_nativeLoop()
	_cgo_gotypes.go:121 +0x48 fp=0xc000054780 sp=0xc000054758 pc=0xcc6348
github.com/getlantern/systray.nativeLoop(...)
	/home/user/go/pkg/mod/github.com/getlantern/[email protected]/systray_nonwindows.go:23
github.com/getlantern/systray.Run(0xc00015a000, 0x0)
	/home/user/go/pkg/mod/github.com/getlantern/[email protected]/systray.go:78 +0x1f fp=0xc0000547a0 sp=0xc000054780 pc=0xcc5a9f
github.com/peterzen/kohola/walletgui.InitSystray({0x1333b48, 0xc000032700})
	/home/user/Work/decred/cspp_fiddle/kohola/app/walletgui/systray.go:16 +0x53 fp=0xc0000547c0 sp=0xc0000547a0 pc=0xdba8b3
main.main·dwrap·5()
	/home/user/Work/decred/cspp_fiddle/kohola/app/main.go:32 +0x2a fp=0xc0000547e0 sp=0xc0000547c0 pc=0xe51a4a
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0000547e8 sp=0xc0000547e0 pc=0x4ef3e1
created by main.main
	/home/user/Work/decred/cspp_fiddle/kohola/app/main.go:32 +0x11a

goroutine 1 [syscall, locked to thread]:
github.com/webview/webview._Cfunc_webview_run(0x3df4570)
	_cgo_gotypes.go:230 +0x45
github.com/webview/webview.(*webview).Run.func1(0x884a26)
	/home/user/go/pkg/mod/github.com/webview/[email protected]/webview.go:171 +0x3a
github.com/webview/webview.(*webview).Run(0xefa920)
	/home/user/go/pkg/mod/github.com/webview/[email protected]/webview.go:171 +0x19
github.com/peterzen/kohola/webview.(*webviewUI).Run(0x10a38f5)
	/home/user/Work/decred/cspp_fiddle/kohola/app/webview/webview.go:37 +0x22
main.startUI({0x1333b48, 0xc000032700})
	/home/user/Work/decred/cspp_fiddle/kohola/app/main.go:53 +0x242
main.main()
	/home/user/Work/decred/cspp_fiddle/kohola/app/main.go:34 +0x129

goroutine 26 [select]:
github.com/peterzen/kohola/walletgui.onReady.func1()
	/home/user/Work/decred/cspp_fiddle/kohola/app/walletgui/systray.go:28 +0x78
created by github.com/peterzen/kohola/walletgui.onReady
	/home/user/Work/decred/cspp_fiddle/kohola/app/walletgui/systray.go:26 +0xfd

rax    0x0
rbx    0x7f4d037fe700
rcx    0x7f4d3370e18b
rdx    0x0
rdi    0x2
rsi    0x7f4d037fd650
rbp    0x7f4ceb3fa340
rsp    0x7f4d037fd650
r8     0x0
r9     0x7f4d037fd650
r10    0x8
r11    0x246
r12    0x7f4ceb5e8690
r13    0x7f4ceb5f9030
r14    0x7f4d39a951e0
r15    0x3dc2140
rip    0x7f4d3370e18b
rflags 0x246
cs     0x33
fs     0x0
gs     0x0

Exchange rate fetcher

In the app back-end, implement a background process that continuously fetches DCR-BTC, DCR-USD and potentially, other fiat pairs from a set of (configurable) exchanges.

The exchange API endpoints should be configurable in the frontend Settings page.

The implementation may use the dcrrates server but this is TBD - though if it is an overkill in terms of resources used.

Starting point: https://github.com/decred/dcrdata/blob/master/exchanges/bot.go

Webview implementation

For self contained, cross platform builds that do not require Chrome to be installed, Webview should be implemented, in addition to the existing lorca approach. The current Lorca implementation should ideally be kept, and there would be an abstraction layered developed so that the use of lorca vs webview can be decided at build time. (Lorca is much faster to develop with so we want to keep that.)

https://github.com/zserge/webview

  • Implement abstraction layer - *ExportAPI Go functions
  • Add Webview layer

Cross platform systray menu

Implement an OS native systray menu using https://github.com/getlantern/systray

The menu items in the first iteration should be:

  • Show window
  • Quit

Show window should bring the main window to the focus, Quit should exit the app.

  • Initialization in main.go
  • Find out how to control desktop windows in a cross platform way (i.e. how to focus the Webview window)
  • Update build dependencies in README, build scripts, Dockerfile

Store RPC client cert in configuration file

At the moment, the configuration stores the full pathname to the rpc client cert. This should be changed so that the cert blob is directly stored in the config file so that it does not have to lay around in the file system unprotected (=>with the config file being encrypted that will also protect the cert.)

This should enable the user to paste in the cert (which they obtained through an SSH session from the server so that the cert never has to leave that machine).

  • The existing file browse option should be kept also, except that instead of populating cert_file_name, appconfig.go / SetConfig would read the cert contents.

Implement config file encryption

The app configuration JSON file should be encrypted using a user provided passphrase, if the user chooses to enable this. The encryption process should happen in the backend and be transparent to the frontend.

Wallet and account totals component UX design

The wallet and account totals component needs to be redesigned into something that makes sense. (The existing layout is a placeholder.)

It should:

  • give the user a friendly way to see totals (in DCR as well as alternative currencies)
  • display the ratios of the values in various states (locked, spendable etc) as a pie chart
  • display sparkline charts of key exchange rates - DCR/BTC, DRC/USD - at the end of the day there should ideally be a single chart so as not to make the layout too busy

image

image

Implement SweepAccount command

  • Add sweepAccount func to walletapi.go (constructTransaction is a good starting template to use)
  • Add bind code to ExportWalletAPI
  • Implement frontend middleware in lorca.ts
  • Add redux reducers/actions in src/features/transactions
  • Implement GUI as a modal (ConstructTxDialog is a good starting point as SweepAccount has similar inputs. The modal should be accessible from a (to be added) Tools menu, similarly to that on the Staking page (StakingToolsMenu.tsx):
    image

API doc: https://github.com/decred/dcrwallet/blob/master/rpc/documentation/api.md#sweepaccount

De-duplicate TX notification toasts

TX notifications are displayed more than once, due to dcrwallet sending multiple unminedTx messages.

processTransactionNotification should only process those messages that are actually informative (for instance, it should not send notifications for the 0 DCR transactions that are associated with ticket purchases. There are also 2 notifications when sending funds.)

The duplicated messages dcrwallet is sending are correct; but processTransactionNotification should know better which ones to notify the user about.

https://github.com/peterzen/dcrwalletgui/blob/a0d1cb395a2b89afa52bb099d217bf2f9ab8382e/frontend/src/features/app/fixtures/Toasts.tsx#L16

Darkmode vs encrypted setup

When the config file encryption is enabled, the dark mode activates only after the passphrase prompt. To fix that, the theme config option should be cached within the browser window itself (localStorage, cookie, etc).

The cache needs to work in production mode when the webview renderer is used (

w := webview.New(false)
); the flag set to true . (The webview might not have the same localStorage ability as Lorca UI)

Native OS notifications

Implement desktop notifications using beeep:

https://github.com/gen2brain/beeep

  • Add protobuf messages in dcrwallet.proto
  • Implement Lorca endpoints inwalletgui/notifications.go
  • Implement TS middleware in appbackend.ts
  • Implement sendDesktopNotification redux action in features/app/appSlice.ts
  • Send TX notifications from frontend/src/features/transactions/actions.ts:75

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.