README.md
1<h3 align="center">
2 <br />
3 <img src="https://user-images.githubusercontent.com/168240/39561871-51cda852-4e5d-11e8-926b-7692d43143e8.png" alt="logo" width="400" />
4 <br />
5 <br />
6 <br />
7</h3>
8
9# cointop
10
11> Coin tracking for hackers
12
13[![License](http://img.shields.io/badge/license-Apache-blue.svg)](https://raw.githubusercontent.com/miguelmota/cointop/master/LICENSE)
14[![Build Status](https://travis-ci.org/miguelmota/cointop.svg?branch=master)](https://travis-ci.org/miguelmota/cointop)
15[![Go Report Card](https://goreportcard.com/badge/github.com/miguelmota/cointop?)](https://goreportcard.com/report/github.com/miguelmota/cointop)
16[![GoDoc](https://godoc.org/github.com/miguelmota/cointop?status.svg)](https://godoc.org/github.com/miguelmota/cointop)
17[![Mentioned in Awesome Terminals](https://awesome.re/mentioned-badge.svg)](https://github.com/k4m4/terminals-are-sexy)
18[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](#contributing)
19
20[`cointop`](https://github.com/miguelmota/cointop) is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time.
21
22The interface is inspired by [`htop`](https://en.wikipedia.org/wiki/Htop) and shortcut keys are inspired by [`vim`](https://en.wikipedia.org/wiki/Vim_(text_editor)).
23
24<img src="https://user-images.githubusercontent.com/168240/39569578-7ce9f3b6-4e7a-11e8-82a9-8a18b91b1bd5.png" alt="cointop screenshot" width="880" />
25
26<img src="https://user-images.githubusercontent.com/168240/39569662-bcbdbcc0-4e7a-11e8-8a8f-8ff45868a8ae.png" alt="help menu" width="880" />
27
28<img src="https://user-images.githubusercontent.com/168240/41806841-043c0ca6-767a-11e8-9c51-df9fc64b3b5c.png" alt="currency convert menu" width="880" />
29
30In action
31
32<img src="https://user-images.githubusercontent.com/168240/39569570-75b1547c-4e7a-11e8-8eac-552abaa431f0.gif" alt="screencast" width="880" />
33
34## Table of Contents
35
36- [Features](#features)
37- [Installing](#installing)
38- [Updating](#updating)
39- [Getting started](#getting-started)
40 - [Navigation](#navigation)
41 - [Favorites](#favorites)
42 - [Portfolio](#portfolio)
43 - [Search](#search)
44 - [Base Currency](#base-currency)
45- [Shortcuts](#shortcuts)
46- [Colorschemes](#colorschemes)
47- [Config](#config)
48- [SSH server](#ssh-server)
49- [FAQ](#faq)
50- [Mentioned in](#mentioned-in)
51- [Contributing](#contributing)
52- [Development](#development)
53- [Tip Jar](#tip-jar)
54- [License](#license)
55
56## Features
57
58- Quick sort shortcuts
59- Custom key bindings configuration
60- Vim inspired shortcut keys
61- Fast pagination
62- Charts for coins and global market graphs
63- Quick chart date range change
64- Fuzzy searching for finding coins
65- Currency conversion
66- Save and view favorite coins
67- Portfolio tracking of holdings
68- 256-color support
69- Custom colorschemes
70- Help menu
71- Offline cache
72- Supports multiple coin stat APIs
73- Auto-refresh
74- Works on macOS, Linux, and Windows
75- It's very lightweight; can be left running indefinitely
76
77## Installing
78
79There are multiple ways you can install cointop depending on the platform you're on.
80
81### From source (always latest and recommeded)
82
83Make sure to have [go](https://golang.org/) (1.12+) installed, then do:
84
85```bash
86go get github.com/miguelmota/cointop
87```
88
89Make sure `$GOPATH/bin` is added to the `$PATH` variable.
90
91Now you can run cointop:
92
93```bash
94cointop
95```
96
97### Binary (all platforms)
98
99You can download the binary from the [releases](https://github.com/miguelmota/cointop/releases) page.
100
101```bash
102curl -o- https://raw.githubusercontent.com/miguelmota/cointop/master/install.sh | bash
103```
104
105```bash
106wget -qO- https://raw.githubusercontent.com/miguelmota/cointop/master/install.sh | bash
107```
108
109### Homebrew (macOS)
110
111cointop is available via [Homebrew](https://formulae.brew.sh/formula/cointop) for macOS:
112
113```bash
114brew install cointop
115```
116
117Run
118
119```bash
120cointop
121```
122
123### Snap (Ubuntu)
124
125cointop is available as a [snap](https://snapcraft.io/cointop) for Linux users.
126
127```bash
128sudo snap install cointop --stable
129```
130
131Running snap:
132
133```bash
134sudo snap run cointop
135```
136
137Note: snaps don't work in Windows WSL. See this [issue thread](https://forum.snapcraft.io/t/windows-subsystem-for-linux/216).
138
139### Copr (Fedora)
140
141cointop is available as a [copr](https://copr.fedorainfracloud.org/coprs/miguelmota/cointop/) package.
142
143First, enable the respository
144
145```bash
146sudo dnf copr enable miguelmota/cointop -y
147```
148
149Install cointop
150
151```bash
152sudo dnf install cointop
153```
154
155Run
156
157```bash
158cointop
159```
160
161### AUR (Arch Linux)
162
163cointop is available as an [AUR](https://aur.archlinux.org/packages/cointop) package.
164
165```bash
166git clone https://aur.archlinux.org/cointop.git
167cd cointop
168makepkg -si
169```
170
171Using [yay](https://github.com/Jguer/yay)
172
173```bash
174yay -S cointop
175```
176
177### Flatpak (Linux)
178
179cointop is available as a [Flatpak](https://flatpak.org/) package via the [Flathub](https://flathub.org/apps/details/com.github.miguelmota.Cointop) registry.
180
181Add the flathub repository (if not done so already)
182
183```bash
184sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
185```
186
187Install cointop flatpak
188
189```bash
190sudo flatpak install flathub com.github.miguelmota.Cointop
191```
192
193Run cointop flatpak
194
195```bash
196flatpak run com.github.miguelmota.Cointop
197```
198
199### FreshPorts (FreeBSD / OpenBSD)
200
201cointop is available as a [FreshPort](https://www.freshports.org/finance/cointop/) package.
202
203```bash
204sudo pkg install cointop
205```
206
207### Windows (PowerShell / WSL)
208
209Install [Go](https://golang.org/doc/install) and [git](https://git-scm.com/download/win), then:
210
211```powershell
212go get -u github.com/miguelmota/cointop
213```
214
215You'll need additional font support for Windows. Please see the [wiki](https://github.com/miguelmota/cointop/wiki/Windows-Command-Prompt-and-WSL-Font-Support) for instructions.
216
217### Docker
218
219cointop is available on [Docker Hub](https://hub.docker.com/r/cointop/cointop).
220
221```bash
222docker run -it cointop/cointop
223```
224
225### Binaries
226
227You can find pre-built binaries on the [releases](https://github.com/miguelmota/cointop/releases) page.
228
229## Updating
230
231To update make sure to use the `-u` flag if installed via Go.
232
233```bash
234go get -u github.com/miguelmota/cointop
235```
236
237### Homebrew (macOS)
238
239```bash
240brew uninstall cointop && brew install cointop
241```
242
243### Snap (Ubuntu)
244
245Use the `refresh` command to update snap.
246
247```bash
248sudo snap refresh cointop
249```
250
251### Copr (Fedora)
252
253```bash
254sudo dnf update cointop
255```
256
257### AUR (Arch Linux)
258
259```bash
260yay -S cointop
261```
262
263### Flatpak (Linux)
264
265```bash
266sudo flatpak uninstall com.github.miguelmota.Cointop
267sudo flatpak install flathub com.github.miguelmota.Cointop
268```
269
270## Getting started
271
272Just run the `cointop` command to get started:
273
274```bash
275$ cointop
276```
277
278To see all the available commands and options run `help` flag:
279
280```bash
281$ cointop --help
282```
283
284### Navigation
285
286- Easiest way to navigate up and down is using the arrow keys <kbd>↑</kbd> and <kbd>↓</kbd>, respectively
287- To go the next and previous pages, use <kbd>→</kbd> and <kbd>←</kbd>, respectively
288- To go to the top and bottom of the page, use <kbd>g</kbd> and <kbd>G</kbd> (Shift+g), respectively
289- Check out the rest of [shortcut](#shortcuts) keys for vim-inspired navigation
290
291### Favorites
292
293- To toggle a coin as a favorite, press <kbd>Space</kbd> on the highlighted coin
294- To view all your favorite coins, press <kbd>F</kbd> (Shift+f)
295- To exit out of the favorites view, press <kbd>F</kbd> (Shift+f) again or <kbd>q</kbd>
296
297### Portfolio
298
299<img src="https://user-images.githubusercontent.com/168240/50439364-a78ade00-08a6-11e9-992b-af63ef21100d.png" alt="portfolio screenshot" width="880" />
300
301- To add a coin to your portfolio, press <kbd>e</kbd> on the highlighted coin
302- To edit the holdings of coin in your portfolio, press <kbd>e</kbd> on the highlighted coin
303- To view your portfolio, press <kbd>P</kbd> (Shift+p)
304- To exit out of the portfolio view press, <kbd>P</kbd> (Shift+p) again or <kbd>q</kbd>
305
306### Search
307
308- To search for coins, press <kbd>/</kbd> then enter the search query and hit <kbd>Enter</kbd>
309
310### Base Currency
311
312- To change the currency, press <kbd>c</kbd> then enter the character next to the desired currency
313
314## Shortcuts
315
316List of default shortcut keys:
317
318Key|Action
319----|------|
320<kbd>↑</kbd>|Move up
321<kbd>↓</kbd>|Move down
322<kbd>→</kbd>|Go to next page
323<kbd>←</kbd>|Go to previous page
324<kbd>Page Up</kbd>|Jump page up
325<kbd>Page Down</kbd>|Jump page down
326<kbd>Home</kbd>|Go to first line of page
327<kbd>End</kbd>|Go to last line of page
328<kbd>Enter</kbd>|Toggle chart for highlighted coin
329<kbd>Esc</kbd>|Quit view
330<kbd>Space</kbd>|Toggle coin as favorite
331<kbd>Tab</kbd>|Move down or next page
332<kbd>Ctrl</kbd>+<kbd>c</kbd>|Quit application
333<kbd>Ctrl</kbd>+<kbd>d</kbd>|Jump page down (vim inspired)
334<kbd>Ctrl</kbd>+<kbd>f</kbd>|Search
335<kbd>Ctrl</kbd>+<kbd>n</kbd>|Go to next page
336<kbd>Ctrl</kbd>+<kbd>p</kbd>|Go to previous page
337<kbd>Ctrl</kbd>+<kbd>r</kbd>|Force refresh data
338<kbd>Ctrl</kbd>+<kbd>s</kbd>|Save config
339<kbd>Ctrl</kbd>+<kbd>u</kbd>|Jump page up (vim inspired)
340<kbd>Ctrl</kbd>+<kbd>j</kbd>|Increase chart height
341<kbd>Ctrl</kbd>+<kbd>k</kbd>|Decrease chart height
342<kbd>Alt</kbd>+<kbd>↑</kbd>|Sort current column in ascending order
343<kbd>Alt</kbd>+<kbd>↓</kbd>|Sort current column in descending order
344<kbd>Alt</kbd>+<kbd>←</kbd>|Sort column to the left
345<kbd>Alt</kbd>+<kbd>→</kbd>|Sort column to the right
346<kbd>F1</kbd>|Show help|
347<kbd>F5</kbd>|Force refresh data|
348<kbd>0</kbd>|Go to first page (vim inspired)
349<kbd>1</kbd>|Sort table by *[1] hour change*
350<kbd>2</kbd>|Sort table by *[2]4 hour change*
351<kbd>7</kbd>|Sort table by *[7] day change*
352<kbd>a</kbd>|Sort table by *[a]vailable supply*
353<kbd>b</kbd>|Sort table by *[b]alance*
354<kbd>c</kbd>|Show currency convert menu
355<kbd>C</kbd>|Show currency convert menu
356<kbd>e</kbd>|Show portfolio edit holdings menu
357<kbd>E</kbd> (Shift+e)|Show portfolio edit holdings menu
358<kbd>f</kbd>|Toggle coin as favorite
359<kbd>F</kbd> (Shift+f)|Toggle show favorites
360<kbd>g</kbd>|Go to first line of page (vim inspired)
361<kbd>G</kbd> (Shift+g)|Go to last line of page (vim inspired)
362<kbd>h</kbd>|Go to previous page (vim inspired)
363<kbd>h</kbd>|Sort table by *[h]oldings* (portfolio view only)
364<kbd>H</kbd> (Shift+h)|Go to top of table window (vim inspired)
365<kbd>j</kbd>|Move down (vim inspired)
366<kbd>k</kbd>|Move up (vim inspired)
367<kbd>l</kbd>|Go to next page (vim inspired)
368<kbd>L</kbd> (Shift+l)|Go to last line of visible table window (vim inspired)
369<kbd>m</kbd>|Sort table by *[m]arket cap*
370<kbd>M</kbd> (Shift+m)|Go to middle of visible table window (vim inspired)
371<kbd>n</kbd>|Sort table by *[n]ame*
372<kbd>o</kbd>|[o]pen link to highlighted coin (visits the API's coin page)
373<kbd>p</kbd>|Sort table by *[p]rice*
374<kbd>P</kbd> (Shift+p)|Toggle show portfolio
375<kbd>r</kbd>|Sort table by *[r]ank*
376<kbd>s</kbd>|Sort table by *[s]ymbol*
377<kbd>t</kbd>|Sort table by *[t]otal supply*
378<kbd>u</kbd>|Sort table by *last [u]pdated*
379<kbd>v</kbd>|Sort table by *24 hour [v]olume*
380<kbd>q</kbd>|Quit view
381<kbd>$</kbd>|Go to last page (vim inspired)
382<kbd>?</kbd>|Show help|
383<kbd>/</kbd>|Search (vim inspired)|
384<kbd>]</kbd>|Next chart date range|
385<kbd>[</kbd>|Previous chart date range|
386<kbd>}</kbd>|Last chart date range|
387<kbd>{</kbd>|First chart date range|
388<kbd>\></kbd>|Go to next page|
389<kbd>\<</kbd>|Go to previous page|
390<kbd>\\</kbd>|Toggle table fullscreen|
391
392## Colorschemes
393
394cointop supports custom colorschemes (themes).
395
396<img src="https://user-images.githubusercontent.com/168240/59164231-165b9c80-8abf-11e9-98cf-915ee37407ff.gif" alt="cointop colorschemes" width="880" />
397
398To use standard colorschemes, clone the [colors](https://github.com/cointop-sh/colors) repository into the config directory:
399
400
401```bash
402$ cd ~/.config/cointop
403$ git clone git@github.com:cointop-sh/colors.git
404```
405
406Then edit your config `~/.config/cointop/config.toml` and set the colorscheme you want to use:
407
408```toml
409colorscheme = "<colorscheme>"
410```
411
412The colorscheme name is the name of the colorscheme TOML file.
413
414For example, if you have `matrix.toml` in `~/.cointop/colors/` then the `colorscheme` property should be set to:
415
416```toml
417colorscheme = "matrix"
418```
419
420Alternatively, you can run cointop with the `--colorscheme` flag to set the colorscheme:
421
422```bash
423$ cointop --colorscheme matrix
424```
425
426To create your own colorscheme; simply copy an existing [colorscheme](https://github.com/cointop-sh/colors/blob/master/cointop.toml), rename it, and customize the colors.
427
428## Config
429
430The first time you run cointop, it'll create a config file in:
431
432```
433~/.config/cointop/config.toml
434```
435
436You can then configure the actions you want for each key:
437
438(default `~/.config/cointop/config.toml`)
439
440```toml
441currency = "USD"
442default_view = ""
443api = "coingecko"
444colorscheme = "cointop"
445refresh_rate = 60
446
447[shortcuts]
448 "$" = "last_page"
449 0 = "first_page"
450 1 = "sort_column_1h_change"
451 2 = "sort_column_24h_change"
452 7 = "sort_column_7d_change"
453 "?" = "help"
454 "/" = "open_search"
455 "[" = "previous_chart_range"
456 "\\" = "toggle_table_fullscreen"
457 "]" = "next_chart_range"
458 "{" = "first_chart_range"
459 "}" = "last_chart_range"
460 "<" = "previous_page"
461 ">" = "next_page"
462 C = "show_currency_convert_menu"
463 E = "show_portfolio_edit_menu"
464 G = "move_to_page_last_row"
465 H = "move_to_page_visible_first_row"
466 L = "move_to_page_visible_last_row"
467 M = "move_to_page_visible_middle_row"
468 O = "open_link"
469 P = "toggle_portfolio"
470 a = "sort_column_available_supply"
471 "alt+down" = "sort_column_desc"
472 "alt+left" = "sort_left_column"
473 "alt+right" = "sort_right_column"
474 "alt+up" = "sort_column_asc"
475 down = "move_down"
476 left = "previous_page"
477 right = "next_page"
478 up = "move_up"
479 c = "show_currency_convert_menu"
480 b = "sort_column_balance"
481 "ctrl+c" = "quit"
482 "ctrl+d" = "page_down"
483 "ctrl+f" = "open_search"
484 "ctrl+j" = "enlarge_chart"
485 "ctrl+k" = "shorten_chart"
486 "ctrl+n" = "next_page"
487 "ctrl+p" = "previous_page"
488 "ctrl+r" = "refresh"
489 "ctrl+s" = "save"
490 "ctrl+u" = "page_up"
491 e = "show_portfolio_edit_menu"
492 end = "move_to_page_last_row"
493 enter = "toggle_row_chart"
494 esc = "quit"
495 f = "toggle_favorite"
496 F = "toggle_show_favorites"
497 F1 = "help"
498 g = "move_to_page_first_row"
499 h = "previous_page"
500 home = "move_to_page_first_row"
501 j = "move_down"
502 k = "move_up"
503 l = "next_page"
504 m = "sort_column_market_cap"
505 n = "sort_column_name"
506 o = "open_link"
507 p = "sort_column_price"
508 pagedown = "page_down"
509 pageup = "page_up"
510 q = "quit_view"
511 Q = "quit_view"
512 r = "sort_column_rank"
513 s = "sort_column_symbol"
514 space = "toggle_favorite"
515 tab = "move_down_or_next_page"
516 t = "sort_column_total_supply"
517 u = "sort_column_last_updated"
518 v = "sort_column_24h_volume"
519
520[favorites]
521
522[portfolio]
523
524[coinmarketcap]
525 pro_api_key = ""
526```
527
528You may specify a different config file to use by using the `--config` flag:
529
530```bash
531cointop --config="/path/to/config.toml"
532```
533
534## List of actions
535
536This are the action keywords you may use in the config file to change what the shortcut keys do.
537
538Action|Description
539----|------|
540`first_chart_range`|Select first chart date range (e.g. 24H)
541`first_page`|Go to first page
542`enlarge_chart`|Increase chart height
543`help`|Show help
544`hide_currency_convert_menu`|Hide currency convert menu
545`last_chart_range`|Select last chart date range (e.g. All Time)
546`last_page`|Go to last page
547`move_to_page_first_row`|Move to first row on page
548`move_to_page_last_row`|Move to last row on page
549`move_to_page_visible_first_row`|Move to first visible row on page
550`move_to_page_visible_last_row`|Move to last visible row on page
551`move_to_page_visible_middle_row`|Move to middle visible row on page
552`move_up`|Move one row up
553`move_down`|Move one row down
554`move_down_or_next_page`|Move one row down or to next page if at last row
555`move_up_or_previous_page`|Move one row up or to previous page if at first row
556`next_chart_range`|Select next chart date range (e.g. 3D → 7D)
557`next_page`|Go to next page
558`open_link`|Open row link
559`open_search`|Open search field
560`page_down`|Move one row down
561`page_up`|Scroll one page up
562`previous_chart_range`|Select previous chart date range (e.g. 7D → 3D)
563`previous_page`|Go to previous page
564`quit`|Quit application
565`quit_view`|Quit view
566`refresh`|Do a manual refresh on the data
567`save`|Save config
568`shorten_chart`|Decrease chart height
569`show_currency_convert_menu`|Show currency convert menu
570`show_favorites`|Show favorites
571`sort_column_1h_change`|Sort table by column *1 hour change*
572`sort_column_24h_change`|Sort table by column *24 hour change*
573`sort_column_24h_volume`|Sort table by column *24 hour volume*
574`sort_column_7d_change`|Sort table by column *7 day change*
575`sort_column_asc`|Sort highlighted column by ascending order
576`sort_column_available_supply`|Sort table by column *available supply*
577`sort_column_balance`|Sort table by column *balance*
578`sort_column_desc`|Sort highlighted column by descending order
579`sort_column_holdings`|Sort table by column *holdings*
580`sort_column_last_updated`|Sort table by column *last updated*
581`sort_column_market_cap`|Sort table by column *market cap*
582`sort_column_name`|Sort table by column *name*
583`sort_column_price`|Sort table by column *price*
584`sort_column_rank`|Sort table by column *rank*
585`sort_column_symbol`|Sort table by column *symbol*
586`sort_column_total_supply`|Sort table by column *total supply*
587`sort_left_column`|Sort the column to the left of the highlighted column
588`sort_right_column`|Sort the column to the right of the highlighted column
589`toggle_row_chart`|Toggle the chart for the highlighted row
590`toggle_favorite`|Toggle coin as favorite
591`toggle_show_currency_convert_menu`|Toggle show currency convert menu
592`toggle_show_favorites`|Toggle show favorites
593`toggle_portfolio`|Toggle portfolio view
594`toggle_show_portfolio`|Toggle show portfolio view
595`show_portfolio_edit_menu`|Show portfolio edit holdings menu
596`toggle_table_fullscreen`|Toggle table fullscreen
597
598## SSH Server
599
600Run SSH server:
601
602```bash
603cointop server -p 2222
604```
605
606SSH into server to see cointop:
607
608```bash
609ssh localhost -p 2222
610```
611
612SSH demo:
613
614```bash
615ssh cointop.sh
616```
617
618Passing arguments to SSH server:
619
620```bash
621ssh cointop.sh -t cointop --colorscheme synthwave
622```
623
624Using docker to run SSH server:
625
626```bash
627docker run -p 2222:22 -v ~/.ssh:/keys --entrypoint cointop -it cointop/cointop server -k /keys/id_rsa
628```
629
630## FAQ
631
632Frequently asked questions:
633
634- Q: Where is the data from?
635
636 - A: By default, the data is from [CoinGecko](https://www.coingecko.com/). Data from [CoinMarketCap](https://coinmarketcap.com/) is another option.
637
638- Q: What APIs does it support?
639
640 - A: APIs currently supported are [CoinMarketCap](https://coinmarketcap.com/) and [CoinGecko](https://www.coingecko.com/).
641
642- Q: What coins does this support?
643
644 - A: This supports any coin supported by the API being used to fetch coin information.
645
646- Q: How do I set the API to use?
647
648 - A: You can use the `--api` flag, eg. `--api coingecko`. You can also set the API choice in the config file.
649
650 ```toml
651 api = "coingecko"
652 ```
653
654 Options are: `coinmarketcap`, `coingecko`
655
656- Q: How do I change the colorscheme (theme)?
657
658 - A: You can use the `--colorscheme` flag, eg. `--colorscheme matrix`. You can also set the colorscheme choice in the config file.
659
660 ```toml
661 colorscheme = "<colorscheme>"
662 ```
663
664 For more instructions, visit the [colors](https://github.com/cointop-sh/colors) repository.
665
666- Q: How do I create a custom colorscheme?
667
668 - A: Copy an existing [colorscheme](https://github.com/cointop-sh/colors/blob/master/cointop.toml) to `~/.config/cointop/colors/` and customize the colors. Then run cointop with `--colorscheme <colorscheme>` to use the colorscheme.
669
670- Q: Where is the config file located?
671
672 - A: The default configuration file is located under `~/.config/cointop/config.toml`
673
674 Note: Previous versions of cointop used `~/.cointop/config` or `~/.cointop/config.toml` as the default config filepath. Cointop will use those config filepaths respectively if they exist.
675
676- Q: What format is the configuration file in?
677
678 - A: The configuration file is in [TOML](https://en.wikipedia.org/wiki/TOML) format.
679
680- Q: Will you be supporting more coin API's in the future?
681
682 - A: Yes supporting more coin APIs is planned.
683
684- Q: How often is the data polled?
685
686 - A: Data gets polled once 60 seconds by default. You can press <kbd>Ctrl</kbd>+<kbd>r</kbd> to force refresh. You can configure the refresh rate with the flag `--refresh-rate <seconds>`
687
688- Q: How can I change the refresh rate?
689
690 - A: Run cointop with the flag `--refresh-rate 60` where the value is the number of seconds that it will fetch for data. You can also set the refresh rate in the config file:
691
692 ```toml
693 refresh_rate = 60
694 ```
695
696- Q: I ran cointop for the first time and don't see any data?
697
698 - A: Running cointop for the first time will fetch the data and populate the cache which may take a few seconds.
699
700- Q: I'm no longer seeing any data!
701
702 - A: Run cointop with the `--clean` flag to delete the cache. If you're still not seeing any data, then please [submit an issue](https://github.com/miguelmota/cointop/issues/new).
703
704- Q: How do I get a CoinMarketCap Pro API key?
705
706- A: Create an account on [CoinMarketCap](https://pro.coinmarketcap.com/signup) and visit the [Account](https://pro.coinmarketcap.com/account) page to copy your Pro API key.
707
708- Q: How do I add my CoinMarketCap Pro API key?
709
710 - A: Add the API key in the cointop config file:
711
712 ```toml
713 [coinmarketcap]
714 pro_api_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
715 ```
716
717 Alternatively, you can export the environment variable `CMC_PRO_API_KEY` containing the API key in your `~/.bashrc`
718
719 ```bash
720 export CMC_PRO_API_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
721 ```
722
723 You may also set the API key on start:
724
725 ```bash
726 cointop --coinmarketcap-api-key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
727 ```
728
729- Q: I can I add my own API to cointop?
730
731 - A: Fork cointop and add the API that implements the API [interface](https://github.com/miguelmota/cointop/blob/master/cointop/common/api/interface.go) to [`cointop/cointop/common/api/impl/`](https://github.com/miguelmota/cointop/tree/master/cointop/common/api/impl). You can use the CoinGecko [implementation](https://github.com/miguelmota/cointop/blob/master/cointop/common/api/impl/coingecko/coingecko.go) as reference.
732
733- Q: I installed cointop without errors but the command is not found.
734
735 - A: Make sure your `GOPATH` and `PATH` is set correctly.
736
737 ```bash
738 export GOPATH=$HOME/go
739 export PATH=$PATH:$GOPATH/bin
740 ```
741
742- Q: How do I search?
743
744 - A: The default key to open search is <kbd>/</kbd>. Type the search query after the `/` in the field and hit <kbd>Enter</kbd>.
745
746- Q: How do I exit search?
747
748 - A: Press <kbd>ESC</kbd> to exit search.
749
750- Q: Does this work on the Raspberry Pi?
751
752 - A: Yes, cointop works on the Rasperry Pi including the RPi Zero.
753
754- Q: How do I add/remove a favorite?
755
756 - A: Press the <kbd>f</kbd> key to toggle a coin as a favorite.
757
758- Q: How do I view all my favorites?
759
760 - A: Press <kbd>F</kbd> (Shift+f) to toggle view all your favorites.
761
762- Q: How do I save my favorites?
763
764 - A: Favorites are autosaved when setting them. You can also press <kbd>ctrl</kbd>+<kbd>s</kbd> to manually save your favorites to the config file.
765
766- Q: What does the yellow asterisk in the row mean?
767
768 - A: The yellow asterisk or star means that you've selected that coin to be a favorite.
769
770- Q: My favorites aren't being saved?
771
772 - A: Try running cointop with `--clean` flag to clear the cache which might be causing the problem.
773
774- Q: How do I add a coin to my portfolio?
775
776 - Press <kbd>e</kbd> on the highlighted coin to enter holdings and add to your portfolio.
777
778- Q: How do I edit the holdings of a coin in my portfolio?
779
780 - Press <kbd>e</kbd> on the highlighted coin to edit the holdings.
781
782- Q: How do I remove a coin in my portfolio?
783
784 - Press <kbd>e</kbd> on the highlighted coin to edit the holdings and set the value to any empty string (blank value). Set it to `0` if you want to keep the coin without a value.
785
786- Q: How do I view my portfolio?
787
788 - A: Press <kbd>P</kbd> (Shift+p) to toggle view your portfolio.
789
790- Q: How do I save my portfolio?
791
792 - A: Your portfolio is autosaved after you edit holdings. You can also press <kbd>ctrl</kbd>+<kbd>s</kbd> to manually save your portfolio holdings to the config file.
793
794- Q: I'm getting question marks or weird symbols instead of the correct characters.
795
796 - A: Make sure that your terminal has the encoding set to UTF-8 and that your terminal font supports UTF-8.
797
798 You can also try running cointop with the following environment variables:
799
800 ```bash
801 LANG=en_US.utf8 TERM=xterm-256color cointop
802 ```
803
804 If you're on Windows (PowerShell, Command Prompt, or WSL), please see the [wiki](https://github.com/miguelmota/cointop/wiki/Windows-Command-Prompt-and-WSL-Font-Support) for font support instructions.
805
806- Q: How do I install Go on Ubuntu?
807
808 - A: There's instructions on installing Go on Ubuntu in the [wiki](https://github.com/miguelmota/cointop/wiki/Installing-Go-on-Ubuntu).
809
810- Q: I'm getting errors installing the snap in Windows WSL.
811
812 - A: Unfortunately Windows WSL doesn't support `snapd` which is required for snaps to run. See this [issue thread](https://forum.snapcraft.io/t/windows-subsystem-for-linux/216).
813
814- Q: How do I fix my GOPATH on Windows?
815
816 - A: Go to Control Panel -> Under _System_ click _Edit the system environment variables_ -> then click the _Environment Variables..._ button -> check the `GOPATH` variable.
817
818 Check the environment variable in PowerShell:
819
820 ```bash
821 $ Get-ChildItem Env:GOPATH
822
823 Name Value
824 ---- -----
825 GOPATH C:\Users\alice\go
826 ```
827
828- Q: How do I manually build the cointop executable on Windows?
829
830 - A: Here's how to build the executable and run it:
831
832 ```powershell
833 > md C:\Users\Josem\go\src\github.com\miguelmota -ea 0
834 > git clone https://github.com/miguelmota/cointop.git
835 > go build -o cointop.exe main.go
836 > cointop.exe
837 ```
838
839- Q: How do I show the help menu?
840
841 - A: Press <kbd>?</kbd> to toggle the help menu. Press <kbd>q</kbd> to close help menu.
842
843- Q: I'm getting the error: `new gocui: termbox: error while reading terminfo data: EOF` when trying to run.
844
845 - A: Try setting the environment variable `TERM=screen-256color`
846
847- Q: Does cointop work inside an emacs shell?
848
849 - A: Yes, but it's slightly buggy.
850
851- Q: My shortcut keys are messed or not correct.
852
853 - A: Delete the cointop config directory and rerun cointop.
854
855 ```bash
856 rm -rf ~/.cointop
857 ```
858
859- Q: How do I display the chart for the highlighted coin?
860
861 - A: Press <kbd>Enter</kbd> to toggle the chart for the highlighted coin.
862
863- Q: How do I change the chart date range?
864
865 - A: Press <kbd>]</kbd> to cycle to the next date range.
866
867 Press <kbd>[</kbd> to cycle to the previous date range.
868
869 Press <kbd>{</kbd> to select the first date range.
870
871 Press <kbd>}</kbd> to selected the last date range.
872
873- Q: What chart date ranges are supported?
874
875 - A: Supported date ranges are `All Time`, `YTD`, `1Y`, `6M`, `3M`, `1M`, `7D`, `3D`, `24H`.
876
877 <sup><sub>YTD = Year-to-date<sub></sup>
878
879- Q: How do I change the fiat currency?
880
881 - A: Press <kbd>c</kbd> to show the currency convert menu, and press the corresponding key to select that as the fiat currency.
882
883- Q: Which currencies can I convert to?
884
885 - A: The supported fiat currencies for conversion are `AUD`, `BRL`, `CAD`, `CFH`, `CLP`, `CNY`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `HUF`, `IDR`, `ILS`, `INR`, `JPY`, `KRW`, `MXN`, `MYR`, `NOK`, `NZD`, `PLN`, `PHP`, `PKR`, `RUB`, `SEK`, `SGD`, `THB`, `TRY`, `TWD`, `USD`, `VND`, and `ZAR`.
886
887 The supported crypto currencies for conversion are `BTC` and `ETH`.
888
889 Please note that some APIs may have limited support for certain conversion formats.
890
891- Q: How do I save the selected currency to convert to?
892
893 - A: The selected currency conversion is autosaved. You can also press <kbd>ctrl</kbd>+<kbd>s</kbd> to manually save the selected currency conversion.
894
895- Q: What does saving do?
896
897 - A: The save command (<kbd>ctrl</kbd>+<kbd>s</kbd>) saves your selected currency, selected favorite coins, and portfolio coins to the cointop config file.
898
899- Q: The data isn't refreshing!
900
901 - A: The coin APIs have rate limits, so make sure to keep manual refreshes to a minimum. If you've hit the rate limit then wait about half an hour to be able to fetch the data again. Keep in mind that some coin APIs, such as CoinMarketCap, update prices every 5 minutes so constant refreshes aren't necessary.
902
903- Q: How do I quit the application?
904
905 - A: Press <kbd>ctrl</kbd>+<kbd>c</kbd> to quit the application.
906
907- Q: How do I quit the open view/window?
908
909 - A: Press <kbd>q</kbd> to quit the open view/window.
910
911- Q: How do I set the favorites view to be the default view?
912
913 - A: In the config file, set `default_view = "favorites"`
914
915- Q: How do I set the portfolio view to be the default view?
916
917 - A: In the config file, set `default_view = "portfolio"`
918
919- Q: How do I set the table view to be the default view?
920
921 - A: In the config file, set `default_view = "default"`
922
923- Q: How can use a different config file other than the default?
924
925 - A: Run cointop with the `--config` flag, eg `cointop --config="/path/to/config.toml"`, to use the specified file as the config.
926
927- Q: I'm getting the error `open /dev/tty: no such device or address`.
928
929 -A: Usually this error occurs when cointop is running as a daemon or slave which means that there is no terminal allocated, so `/dev/tty` doesn't exist for that process. Try running it with the following environment variables:
930
931 ```bash
932 DEV_IN=/dev/stdout DEV_OUT=/dev/stdout cointop
933 ```
934
935- Q: I can only view the first page, why isn't the pagination is working?
936
937 - A: Sometimes the coin APIs will make updates and break things. If you see this problem please [submit an issue](https://github.com/miguelmota/cointop/issues/new).
938
939- Q: How can run cointop with just the table?
940
941 - A: Run cointop with the `--only-table` flag.
942
943 <img width="880" alt="table view only" src="https://user-images.githubusercontent.com/168240/60208658-b0387e80-980d-11e9-8819-8039fb11218f.png" />
944
945- Q: How do I toggle the table to go fullscreen?
946
947 - A: Press <kbd>\\</kbd> to toggle the table fullscreen mode.
948
949- Q: How can I hide the top marketbar?
950
951 - A: Run cointop with the `--hide-marketbar` flag.
952
953- Q: How can I hide the chart?
954
955 - A: Run cointop with the `--hide-chart` flag.
956
957- Q: How can I hide the bottom statusbar?
958
959 - A: Run cointop with the `--hide-statusbar` flag.
960
961- Q: How can I delete the cache?
962
963 - A: Run `cointop clean` to delete the cache files. Cointop will generate new cache files after fetching data.
964
965- Q: How can I reset cointop?
966
967 - A: Run the command `cointop reset` to delete the config files and cache. Cointop will generate a new config when starting up. You can run `cointop --reset` to reset before running cointop.
968
969- Q: What is the size of the binary?
970
971 - A: The Go build size is ~8MB but packed with UPX it's only a ~3MB executable binary.
972
973- Q: How much memory does cointop use?
974
975 -A: Cointop uses ~15MB of memory so you can run it on a Raspberry Pi Zero if you wanted to (one reason why cointop was built using Go instead of Node.js or Python).
976
977- Q: How does cointop differ from [rate.sx](https://rate.sx/)?
978
979 - A: *rate.sx* is great for one-off queries or fetching data for bash scripts because it doesn't require installing anything. Cointop differs in that it is interactive and also supports more currencies.
980
981- Q: How can I get just the coin price with cointop?
982
983 - A: Use the `cointop price` command. Here are some examples:
984
985 ```bash
986 $ cointop price --coin ethereum
987 $277.76
988
989 $ cointop price -c ethereum --currency btc
990 Ƀ0.02814
991
992 $ cointop -c ethereum -f eur
993 €245.51
994
995 $ cointop price -c ethereum -f usd --api coinmarketcap
996 $276.37
997 ```
998
999- Q: Does cointop do mining?
1000
1001 - A: Cointop does not do any kind of mining.
1002
1003
1004- Q: How can I run the cointop SSH server on port 22?
1005
1006 - A: Port 22 is a privileged port so you need to run with `sudo`:
1007
1008 ```bash
1009 sudo cointop server -p 22
1010 ```
1011
1012- Q: Why doesn't the version number work when I install with `go get`?
1013
1014 - A: The version number is read from the git tag during the build process but this requires the `GO111MODULE` environment variable to be set in order for Go to read the build information:
1015
1016 ```bash
1017 GO111MODULE=on go get github.com/miguelmota/cointop
1018 ```
1019
1020## Mentioned in
1021
1022Cointop has been mentioned in:
1023
1024- [Ubuntu Twitter](https://twitter.com/ubuntu/status/985947962311311360?lang=en)
1025- [Ubuntu Podcast](https://ubuntupodcast.org/2018/04/12/s11e06-six-feet-over-it/)
1026- [Ubuntu Facebook](https://www.facebook.com/ubuntulinux/photos/coin-tracking-for-hackers-cointop-is-a-fast-and-easy-to-use-command-line-applica/10156147393253592/)
1027- [Terminals Are Sexy](https://github.com/k4m4/terminals-are-sexy#tools-and-plugins)
1028- [The Changelog News](https://changelog.com/news/cointop-coin-tracking-for-hackers-rAzZ)
1029
1030## Contributing
1031
1032Pull requests are welcome!
1033
1034For contributions please create a new branch and submit a pull request for review.
1035
1036## Development
1037
1038### Go
1039
1040Running cointop from source
1041
1042```bash
1043make run
1044```
1045
1046### Update vendor dependencies
1047
1048```bash
1049make deps
1050```
1051
1052### Homebrew
1053
1054Installing from source
1055
1056```bash
1057make brew/build
1058```
1059
1060### Flatpak
1061
1062Install the freedesktop runtime (if not done so already)
1063
1064```bash
1065sudo flatpak install flathub org.freedesktop.Platform//1.6 org.freedesktop.Sdk//1.6
1066```
1067
1068Install golang extension
1069
1070```bash
1071sudo flatpak install flathub org.freedesktop.Sdk.Extension.golang
1072```
1073
1074Building flatpak package
1075
1076```bash
1077make flatpak/build
1078```
1079
1080### Copr
1081
1082Install dependencies
1083
1084```bash
1085make copr/install/cli
1086make rpm/install/deps
1087make rpm/dirs
1088```
1089
1090Build package
1091
1092```bash
1093make rpm/cp/specs
1094make rpm/download
1095make rpm/build
1096make copr/build
1097```
1098
1099### Snap
1100
1101Building snap
1102
1103```bash
1104make snap/build
1105```
1106
1107### Deployment
1108
1109See this [wiki](https://github.com/miguelmota/cointop/wiki/Deployment).
1110
1111### Tip Jar
1112
1113[![BTC Tip Jar](https://img.shields.io/badge/BTC-tip-yellow.svg?logo=bitcoin&style=flat)](https://www.blockchain.com/btc/address/3KdMW53vUMLPEC33xhHAUx4EFtvmXQF8Kf) `3KdMW53vUMLPEC33xhHAUx4EFtvmXQF8Kf`
1114
1115[![ETH Tip Jar](https://img.shields.io/badge/ETH-tip-blue.svg?logo=ethereum&style=flat)](https://etherscan.io/address/0x0072cdd7c3d9963ba69506ECf50e16E963B35bb1) `0x0072cdd7c3d9963ba69506ECf50e16E963B35bb1`
1116
1117Thank you for tips!
1118
1119Follow on twitter [@cointop_sh](https://twitter.com/cointop_sh)
1120
1121## License
1122
1123Released under the [Apache 2.0](./LICENSE) license.
1124