title | date | draft |
---|---|---|
Frequently asked questions |
2020-01-01 00:00:00 +0000 |
false |
By default, the data is from CoinGecko. Data from CoinMarketCap is another option.
APIs currently supported are CoinMarketCap and CoinGecko.
This supports any coin supported by the API being used to fetch coin information. There is, however, a limit on the number of coins that
cointop fetches by default. You can increase this by passing --max-pages
and --per-page
arguments on the command line.
You can use the --api
flag, eg. --api coingecko
. You can also set the API choice in the config file.
api = "coingecko"
Options are: coinmarketcap
, coingecko
You can use the --colorscheme
flag, eg. --colorscheme matrix
. You can also set the colorscheme choice in the config file.
colorscheme = "<colorscheme>"
For more instructions, visit the colors repository.
Copy an existing colorscheme to ~/.config/cointop/colors/
and customize the colors. Then run cointop with --colorscheme <colorscheme>
to use the colorscheme.
You can use any of the 250-odd X11 colors by name. See https://en.wikipedia.org/wiki/X11_color_names (use lower-case and without spaces). You can also include 24-bit colors by using the #rrggbb hex code.
You can also define values in the colorscheme file, and reference them from throughout the file, using the following syntax:
define_base03 = "#002b36"
menu_header_fg = "$base03"
Change the background color options in the colorscheme file to default
to use the system default color, eg. base_bg = "default"
The default configuration file is located under ~/.config/cointop/config.toml
However it may vary depending on your operating system since the config directory is determinedby by os.UserConfigDir()
.
On Unix systems, the default config path is $XDG_CONFIG_HOME/cointop/config.toml
On macOS (darwin), the default config path is $HOME/Library/Application Support/cointop/config.toml
On Windows, the default config path is %AppData%\cointop\config.toml
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.
The configuration file is in TOML format.
Yes supporting more coin APIs is planned.
Data gets polled once 60 seconds by default. You can press Ctrl+r to force refresh. You can configure the refresh rate with the flag --refresh-rate <seconds>
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:
refresh_rate = 60
Running cointop for the first time will fetch the data and populate the cache which may take a few seconds.
Run cointop with the --clean
flag to delete the cache. If you're still not seeing any data, then please submit an issue.
Create an account on CoinMarketCap and visit the Account page to copy your Pro API key.
Add the API key in the cointop config file:
[coinmarketcap]
pro_api_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Alternatively, you can export the environment variable CMC_PRO_API_KEY
containing the API key in your ~/.bashrc
export CMC_PRO_API_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
You may also set the API key on start:
cointop --coinmarketcap-api-key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Fork cointop and add the API that implements the API interface to cointop/cointop/common/api/impl/
. You can use the CoinGecko implementation as reference.
Make sure your GOPATH
and PATH
is set correctly.
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
The default key to open search is /. Type the search query after the /
in the field and hit Enter.
Each search starts from the current cursor position. To search for the same term again, hit / then Enter.
The default behaviour will start to search by symbol first, then it will continues searching by name if there is no result. To search by only symbol, type the search query after /s:
. To search by only name, type the search query after /n:
.
Press Esc to exit search.
Yes, cointop works on the Rasperry Pi including the RPi Zero.
Press the f key to toggle a coin as a favorite.
Press F (Shift+f) to toggle view all your favorites.
Favorites are autosaved when setting them. You can also press ctrl+s to manually save your favorites to the config file.
The yellow asterisk *
star means that you've selected that coin to be a favorite.
Try running cointop with --clean
flag to clear the cache which might be causing the problem.
Press e on the highlighted coin to enter holdings and add to your portfolio.
This dialog supports basic expressions including +
-
*
/
etc.
Press e on the highlighted coin to edit the holdings.
Press e 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.
Press P (Shift+p) to toggle view your portfolio.
Your portfolio is autosaved after you edit holdings. You can also press ctrl+s to manually save your portfolio holdings to the config file.
Currently there is no UI for this. If you want to include the cost of your coins in the Portfolio screen, you will need to edit your config.toml
Each coin consists of four values: coin name, coin amount, cost-price, cost-currency.
For example, the following configuration includes 100 ALGO at USD1.95 each; and 0.1 BTC at AUD50100.83 each.
holdings = [["Algorand", "100", "1.95", "USD"], ["Bitcoin", "0.1", "50100.83", "AUD"]]
With this configuration, four new columns are useful:
cost_price
the price and currency that the coins were purchased atcost
the cost (in the current currency) of the coinspnl
the PNL of the coins (current value vs original cost)pnl_percent
the PNL of the coins as a fraction of the original cost
With the holdings above, and the currency set to GBP (British Pounds) cointop will look something like this:
You can run cointop with the --hide-portfolio-balances
flag to hide portfolio balances or use the keyboard shortcut Ctrl+space on the portfolio page to toggle hide/show.
Make sure that your terminal has the encoding set to UTF-8 and that your terminal font supports UTF-8.
You can also try running cointop with the following environment variables:
LANG=en_US.utf8 TERM=xterm-256color cointop
If you're on Windows (PowerShell, Command Prompt, or WSL), please see the wiki for font support instructions.
There's instructions on installing Go on Ubuntu in the wiki.
Unfortunately Windows WSL doesn't support snapd
which is required for snaps to run. See this issue thread.
Go to Control Panel -> Under System click Edit the system environment variables -> then click the Environment Variables... button -> check the GOPATH
variable.
Check the environment variable in PowerShell:
$ Get-ChildItem Env:GOPATH
Name Value
---- -----
GOPATH C:\Users\alice\go
Here's how to build the executable and run it:
> md C:\Users\Josem\go\src\github.com\cointop-sh -ea 0
> git clone https://github.com/cointop-sh/cointop.git
> go build -o cointop.exe main.go
> cointop.exe
Press ? to toggle the help menu. Press q to close help menu.
I'm getting the error: new gocui: termbox: error while reading terminfo data: EOF
or the error termbox: error while reading terminfo data: termbox: unsupported terminal
when trying to run.
Try setting the environment variable TERM=screen-256color
when starting cointop. E.g. TERM=screen-256color cointop
Yes, but it's slightly buggy.
Delete the cointop config directory and rerun cointop.
rm -rf ~/.cointop
Press Enter to toggle the chart for the highlighted coin.
Press ] to cycle to the next date range.
Press [ to cycle to the previous date range.
Press { to select the first date range.
Press } to selected the last date range.
Supported date ranges are All Time
, YTD
, 1Y
, 6M
, 3M
, 1M
, 7D
, 3D
, 24H
.
YTD = Year-to-date
Press Ctrl+j to increase the chart height.
Press Ctrl+k to decrease the chart height.
Press c to show the currency convert menu, and press the corresponding key to select that as the fiat currency.
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
.
The supported crypto currencies for conversion are BTC
and ETH
.
Please note that some APIs may have limited support for certain conversion formats.
The selected currency conversion is autosaved. You can also press ctrl+s to manually save the selected currency conversion.
Cointop uses the LC_MONETARY
and LC_NUMERIC
environment variables to format
currency and numeric values.
For example, to see cointop display currency with Bengalese numbers
and numeric values in arabic run /usr/bin/env LC_MONETARY=bn LC_NUMERIC=ar cointop
.
For more information about how to check and configure your locale settings see
locale(1)
and
locale(5)
.
The save command (ctrl+s) saves your selected currency, selected favorite coins, and portfolio coins to the cointop config file.
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.
Press ctrl+c to quit the application.
Press q to quit the open view/window.
In the config file, set default_view = "favorites"
In the config file, set default_view = "portfolio"
In the config file, set default_view = "default"
In the config file, set default_chart_range = "3M"
Supported date ranges are All Time
, YTD
, 1Y
, 6M
, 3M
, 1M
, 7D
, 3D
, 24H
.
In the config file, set columns
value in one of the favorites, portfolio, table sections. The list of available columns can be seen on the help menu - look for "sort_column_XXX".
For example:
[table]
columns = ["rank", "name", "symbol", "price", "1h_change", "24h_change", "7d_change", "24h_volume", "market_cap", "available_supply", "total_supply", "last_updated"]
Supported columns relating to price change are 1h_change
, 24h_change
, 7d_change
, 30d_change
, 1y_change
There is a setting at the top-level of the configuration file called compact_notation=true
which changes the marketbar values market cap
, volume
and portfolio total value
.
The same setting can be applied at in the [table]
section to impact the 24h_volume
, market_cap
, total_supply
, available_supply
columns in the main coin view; and in the [favorites]
section to change the same columns. The setting also changes the column names to be shorter.
Run cointop with the --config
flag, eg cointop --config="/path/to/config.toml"
, to use the specified file as the config.
Alternatively, you can set the config file path via the environment variable COINTOP_CONFIG
, eg export COINTOP_CONFIG="/path/to/config.toml"
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:
DEV_IN=/dev/stdout DEV_OUT=/dev/stdout cointop
Sometimes the coin APIs will make updates and break things. If you see this problem please submit an issue.
Run cointop with the --only-table
flag.
<img width="880" alt="table view only" src="https://user-images.githubusercontent.com/168240/60208658-b0387e80-980d-11e9-8819-8039fb11218f.png" />
Press \ to toggle the table fullscreen mode.
Run cointop with the --hide-marketbar
flag.
Run cointop with the --hide-chart
flag.
Run cointop with the --hide-statusbar
flag.
Use the keys < to scroll the table to the left and < to scroll the table to the right.
Run cointop clean
to delete the cache files. Cointop will generate new cache files after fetching data.
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.
Make sure to not manually set TERM
in your ~/.bashrc
, ~/.zshrc
, or any where else. The TERM
environment variable should be automatically set by your terminal, otherwise this may cause the terminal emulator to send escape codes when these keys are pressed. See this Arch wiki for more info.
Use the cointop price
command. Here are some examples:
The Go build size is ~8MB but packed with UPX it's only a ~3MB executable binary.
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).
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.
Use the cointop price
command. Here are some examples:
$ cointop price --coin ethereum
$277.76
$ cointop price -c ethereum --currency btc
Ƀ0.02814
$ cointop -c ethereum -f eur
€245.51
$ cointop price -c ethereum -f usd --api coinmarketcap
$276.37
Cointop does not do any kind of cryptocurrency mining.
Port 22 is a privileged port so you need to run with sudo
:
sudo cointop server -p 22
No, there's no tracking on the public SSH server instance. It's running the same code that you see on the public repo.
The public SSH instance is for demo use or short-term usage and will disconnect users after an idle timeout to allow other users to try it out.
Generate the SSH key if the host machine doesn't have one:
$ ssh-keygen
Make sure the host key flag points to the location of the SSH key:
cointop server -k ~/.ssh/id_rsa [...]
Use the following flag when connecting to the SSH server:
ssh -oHostKeyAlgorithms=+ssh-rsa cointop.sh
You can also add this config to the ~/.ssh/config
file so you don't have to use the flag every time:
Host cointop.sh
HostName cointop.sh
HostKeyAlgorithms=+ssh-rsa
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:
GO111MODULE=on go get github.com/cointop-sh/cointop
Cointop creates a logfile at /tmp/cointop.log
. Normally nothing is written to this, but if you set the environment variable
DEBUG=1
cointop will write a lot of output describing its operation. Furthermore, if you also set DEBUG_HTTP=1
it will
emit lots about every HTTP request that cointop makes to coingecko (backend). Developers may ask for this information
to help diagnose any problems you may experience.
DEBUG=1 DEBUG_HTTP=1 cointop
If you set environment variable DEBUG_FILE
you can explicitly provide a logfile location, rather than /tmp/cointop.log