A terminal application to watch crypto prices!

cryptgo

Go Build Go License Check Go Report Card Go Reference Docker Image Version (latest semver) Mentioned in Awesome Go

Latest Stable Version: GitHub tag (latest SemVer)

Crytpgo is a TUI based application written purely in Go to monitor and observe cryptocurrency prices in real time!

logo

Installation

Using Go

go get -u github.com/Gituser143/cryptgo

Using Docker

Running Image

Set VERSION to a specific version for stable builds. Omitting VERSION uses the latest stable version or setting main as version provides the latest (in development) version.

# Pull Image
make docker-pull

# Pull specific version of image
VERSION=v1.1.1 make docker-pull

# Run Image
make docker-run

# Run specific version of image
VERSION=v1.1.1 make docker-run

# Run image with portfolio command
ARG=portfolio make docker-run

# Run image with help command
ARG=help make docker-run

Optionally, an alias can be created for ease of use:

alias cryptgo='docker run -u $(id -u):$(id -g) -v "$HOME:/home/appuser/" --rm -it bhargavsnv/cryptgo'

And run using:

cryptgo [flags]
# or
cryptgo [command]

Building Image locally

# Clone the repository
git clone https://github.com/Gituser143/cryptgo

# Navigate into repository
cd cryptgo

# Build image
make docker-build

# Run image
make docker-run

From Source:

Building requires Go to be installed.

# Clone the repository
git clone https://github.com/Gituser143/cryptgo

# Navigate into repository
cd cryptgo

# Build executable
make build

Make

# See all make targets
make help

What does cryptgo do?

Cryptgo helps you look at cryptocurrency values, details and track your crypto portfolio straight from your terminal!

It makes use of the API provided by CoinCap.io and CoinGecko to provide the required details!

Main Page

main-page

  • Here, the top 3 currencies (as ranked by Market Cap) are displayed with their graphs on top.

  • A table is provided with relevant information about other currencies.

  • cryptgo allows you to keep track of your favourite currencies by adding them to the favourites table.

  • A selected coin (from either the coin table or favourites) can be further inspected in detail.

Key-Bindings

Key-bindings can be found by pressing ?. This displays the help prompt.

  • Quit: q or <C-c>
  • Table Navigation
    • k and <Up>: up
    • j and <Down>: down
    • <C-u>: half page up
    • <C-d>: half page down
    • <C-b>: full page up
    • <C-f>: full page down
    • gg and <Home>: jump to top
    • G and <End>: jump to bottom
    • f: focus favourites table
    • F: focus interval table
  • Searching/Filtering
    • /: Open search box
    • Esc: Clear filter text
  • Sorting
    • Use column number to sort ascending.
    • Use to sort descending.
    • Eg: 1 to sort ascending on 1st Col and F1 for descending
  • Actions (Interval Table)
    • <c>: Select Currency (from popular list)
    • <C>: Select Currency (from full list)
    • e: Add/Edit coin to Portfolio
    • P: View portfolio
    • <s>: Star, save to favourites
    • <S>: UnStar,remove from favourites
    • <Enter>: View Coin Information
    • %: Select Duration for Percentage Change

Coin Page

coin-page

  • The coin page give more in depth details of a particular coin.

  • It can be navigated to from either the favourites or coin table.

  • The price history is displayed on top and can be viewed through different intervals, as provided by the Graph Interval table on the bottom left.

  • A live price is streamed in the price box and additional details are described in the details table.

Key-Bindings

Key-bindings can be found by pressing ?. This displays the help prompt.

  • Quit: q or <C-c>
  • Table Navigation
    • k and <Up>: up
    • j and <Down>: down
    • <C-u>: half page up
    • <C-d>: half page down
    • <C-b>: full page up
    • <C-f>: full page down
    • gg and <Home>: jump to top
    • G and <End>: jump to bottom
    • f: focus favourites table
    • F: focus interval table
  • Sorting
    • Use column number to sort ascending.
    • Use <F-column number> to sort descending.
    • Eg: 1 to sort ascending on 1st Col and F1 for descending
  • Actions (Interval Table)
    • <Enter>: Set Interval
    • <c>: Select Currency (from popular list)
    • <C>: Select Currency (from full list)

Portfolio Page

portfolio-page

  • Cryptgo allows you to track your crypto portfolio through a separately defined page.

  • This page can be accessed with the command cryptgo portfolio.

Key-Bindings

  • Quit: q or <C-c>

  • Table Navigation

    • k and <Up>: up
    • j and <Down>: down
    • <C-u>: half page up
    • <C-d>: half page down
    • <C-b>: full page up
    • <C-f>: full page down
    • gg and <Home>: jump to top
    • G and <End>: jump to bottom
  • Sorting

    • Use column number to sort ascending.
    • Use <F-column number> to sort descending.
    • Eg: 1 to sort ascending on 1st Col and F1 for descending
  • Actions

    • c: Select Currency (from popular list)
    • C: Select Currency (from full list)
    • e: Add/Edit coin to Portfolio
    • <Enter>: View Coin Information

Mini Portfolio

portfolio

  • Cryptgo also allows you to view your holdings through a mini portfolio from other pages.

  • Coins can be added/modified/removed by pressing e on a coin in the main page. (Set Holding Amount as 0 to remove)

  • Holdings can be modified either through the main page or through the portfolio itself. The below image shows the edit box when modifying holdings.

edit-box

Utilities

Currency

Currency need not be fixed to USD $, other currencies can be selected from either the popular currency table (press c) or full currency table (press C).

Popular Currency Table

currency

Full Currency Table

currency-full

Search/Filtering

Coins can be filtered/searched based on an input substring. The search/filter box can be brought up on the main page (press /).

search

Change Percentage Interval

The Change Percentage on the main page can be modified too. A list of durations can be viewed and selected by pressing %, which brings up the below table.

change-duration

Change Graph Duration

The duration of the history graph on the coin page is modifiable. To list the possible durations and select one, press d in the coin page. that will bring up the following table.

history-duration


Contributing

Pull Requests and Issues are welcome!

Please check the issues page to see available issues to work on, or to even create some!


Credits

Multiple Design ideas, utilities, functions and practices have been adopted from:

Do check them out!

Owner
Bhargav SNV
CSE Undergrad at PES University. Gopher, Cloud, Networks and Security enthusiast.
Bhargav SNV
Comments
  • Search functionality

    Search functionality

    This draft-pr addresses #3 and adds the following:

    • Opens basic search table on clicking <C-s>
    • Naive text input option
    • Shows a sorted list of symbols based on a searched string, if the string is a prefix of a key in coinIDMap and this symbol has a corresponding id for CoinGecko and CoinCap
    • Allows the user to scroll through the list and select a symbol, on which it redirects to its coin page
    • Shows basic error message on the incorrect query

    Todo

    • [ ] Add query based on the full name of the coin
    • [ ] Fix blinking "full" character bug ( only exists after one successful search and redirect )

    Comments

    @Gituser143 Tell me if this implementation looks good, or if you something else in mind. Also, for the search based on the name of the coin, is there a list of full names of coins pulled from the API?

  • Add Search Option

    Add Search Option

    Description

    Add functionality to be able to search for coins, either by name or symbol.

    Proposed Solution

    Add preferably a search window or shortcut to search for coins. Search can be done either naively, or through a regex maybe? (Unsure of how to search).

  • Add makefile and update CI to use make targets

    Add makefile and update CI to use make targets

    If you choose to merge this PR, then the README should probably be updated to show new make target too 😎

    Also, I know there was no issue for this, but I think it makes the user's life easier. All in the interest of Hacktoberfest 😄

  • Switch docker image to alpine

    Switch docker image to alpine

    What's changed

    • Added build step
    • Modified go build flags
      • Added ldflags to strip debugging information
      • Changed goos to linux
      • Disabled cgo at compile time
    • Changed final image to alpine
    • Added non privileged user

    Result:

    • Docker image size went from 960MB to 13.9MB
    • App no longer runs as root
    • The image only contains the basic alpine components and the compiled static binary of cryptgo.
  • fixed docker user volume permissions

    fixed docker user volume permissions

    As mentioned in my issue, here is a fix for the docker volume permissions. I have tried many things, but in order to keep the app working as a single binary, and to keep the container rootless, this is what I have come up with.

    In the dockerfile I set the HOME env to the home folder of our default user. In the run command I specified the -user flag so that the container runs with the user ID and group ID of the host system user. This way the app remains rootless, and GO recognizes and has write access to HOME. I chose not to remove "appuser" as the default user from the dockerfile for two reasons: 1) We would need to create the home folder anyway and 2) this way if the end user runs the container WITHOUT specifying a user, the app still will not run as root, but default to appuser. (Ofcourse then their changes will not be saved.)

    Fixes: #24

  • Save currency preference

    Save currency preference

    Once the currency in which the value is displayed is changed by the user, it should be saved in the config file so that the user doesn't have to reselect the option next time the application runs.

  • Add Github action to publish docker image

    Add Github action to publish docker image

    A github action should be setup to build and publish docker images of cryptgo. This will allow cryptgo to be run directly by pulling a docker image instead of building the image locally.

  • Docker User Permissions (Changes not saving)

    Docker User Permissions (Changes not saving)

    In my previous Pull Request I made an oversight. Because the container is not running as root anymore, it has no rights to write to $HOME, thus no changes are being saved. Im actively working on a solution, but thought I would open an issue regardless so that people are aware of this. Will submit a PR as soon as I found the best solution.

  • Add a `-p | --portfolio` command to view portfolio details directly

    Add a `-p | --portfolio` command to view portfolio details directly

    Format in mind

    image

    Action Functionalities required

    • Update portfolio holdings
    • Update currency
    • Navigate details table
    • Details table sorting

    Edit: Currently being worked on in the portfolio branch.

    Edit 2: Layout of page has been modified. Top 3 graphs have been replaced a 7 day portfolio value graph.

  • Add Portfolio functionality

    Add Portfolio functionality

    This PR fixes #4

    • Users can now view their portfolio by pressing P on either pages.
    • Coins can be added/removed/edited to the portfolio by pressing e on the coin.
    • Holdings can be edited from within the portfolio table too.
  • Migrate allcoin page to coingecko

    Migrate allcoin page to coingecko

    Fixes #5

    • Add display to select the duration for viewing the percentage change
    • Fetch map of Symbol to Id from coingecko
    • Fetch data for all coin page from coingecko
  • Gioui gui aspects.

    Gioui gui aspects.

    Look at networking to work out best way to reuse the current api for easy use on gio web and native apps.

    also use indexeddb for client storage / cache in gio web. Not sure what golang dB for gio native until I see the data. I suspect it’s time series data ?

  • Use consistent key-bindings for exit (and return navigation)

    Use consistent key-bindings for exit (and return navigation)

    Currently the following have mixed combinations of exit and return key-bindings:

    • Exit from main page (q and ^C)
    • Return from coin page to main page (Esc and q and ^C)
    • Exit from coin page (Not Set)
    • Return from widget to main page (Esc)
    • Exit from widget (q and ^C)

    A consistent mapping of q and ^C to quit and Esc to return could be implemented. Or maybe using all three to return to previous page and then exit from the main page.

  • Navigate to favourite coin page from an existing coin page

    Navigate to favourite coin page from an existing coin page

    Currently, the favourites table does not support navigation from within the coin page. It can only be navigated into from the main (all coin) page.

    If navigation functionality could be added to the favourites tables from within the coin page, it would be of huge convenience to users. They would not have to return to main page just to switch to a different favourite coin.

  • Add more details about coins through a different API

    Add more details about coins through a different API

    Description

    The current main page only displays 24 Hr Change %, more fine grained change, like 1 Hr, 2 Hr, 1 Week, etc. changes can be displayed on both the home and coin page.

    Proposed Solution

    Maybe looking into CoinGecko might be worth it. It has a Go Client too, which can be found here

Simple Crypto API for Go

cryptogo Simple cryptography API in Go Hashes: hash.MD5Bytes, hash.MD5Base64, hash.MD5Hex calculates an MD5 chechsum of the input byte array as a byte

Nov 10, 2021
A command line Crypto-currency ticker made using golang and WazirX Api
A command line Crypto-currency ticker made using golang and WazirX Api

░█████╗░██████╗░██╗░░░██╗██████╗░████████╗███████╗██╗░░██╗ ██╔══██╗██╔══██╗╚██╗░██╔╝██╔══██╗╚══██╔══╝██╔════╝╚██╗██╔╝ ██║░░╚═╝██████╔╝░╚████╔╝░██████╔

Feb 6, 2022
a modern crypto messaging format

saltpack a modern crypto messaging format https://saltpack.org/ saltpack is a streamlined, modern solution, designed with simplicity in mind. It is ea

Dec 22, 2022
An easy to setup local crypto wallet based on Geth

CryptoWallet An easy to setup local crypto wallet based on Geth To run. go run CrytoWallet This will expose a set a api's. To Create new Wallet curl

Oct 15, 2021
Real time crypto VWAP calculator
Real time crypto VWAP calculator

VWAP calculator A realtime VWAP calculator of crypto currencies. It uses coinbase as its default provider for real time data over websocket. Design Th

Oct 31, 2022
ECIES implementation forked of the `crypto/ecies` package from Ethereum

# NOTE This implementation is direct fork of Kylom's implementation. I claim no authorship over this code apart from some minor modifications. Please

Dec 7, 2021
A tiny Crypto Project with REST API

Goal ⚽ Golang으로 아무 쓸모 없는 블록체인을 한땀 한땀 만들어보면서 BTC나 ETH에 적용된 블록체인 기법 이해해보기! Special Thanks to Nico! Current... ??️ Work ?? 자세한 내용은 issue와 PR을 확인하세요. Now

Dec 30, 2021
Xk6-crypto-x509 - A k6 extension to encrypt data with a PEM Public Key

xk6-crypto-x509 A k6 extension to encrypt data with a PEM Public Key This is a k

Jan 5, 2022
InductiveDifferentiation - A Trading Experiment With The Crypto Market

A Trading Experiment With The Crypto Market The program was proposed and owned b

Apr 10, 2022
Easy to use crypto library with multiple algorithms

crypka Crypka is library, which abstracts away crypto, so one can easily do: Swap cryptosystems by swapping algorithm object in one place Easily and s

Mar 6, 2022
Coinbase - You can use this to retrieve the current price for an crypto currency

whats-this You can use this to retrieve the current price for an crypto currency

Sep 29, 2022
Crypto-project - Personal project for learning TLS

crypto-project My personal attempt to implement this cipher suite using the Go l

Feb 14, 2022
Feb 14, 2022
Block-top - Tool to watch block production

block top Continuously watch the block production from one or many (or all) lead

Jan 24, 2022
A fast and lightweight interactive terminal based UI application for tracking cryptocurrencies 🚀
A fast and lightweight interactive terminal based UI application for tracking cryptocurrencies 🚀

cointop is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time.

Jan 6, 2023
Frontier Chain is a blockchain application built using Cosmos SDK and Tendermint.

Frontier Chain Frontier Chain is a blockchain application built using Cosmos SDK and Tendermint. Setup Initialize the blockchain with one validator no

Jul 12, 2022
The Fabric Smart Client is a new Fabric Client that lets you focus on the business processes and simplifies the development of Fabric-based distributed application.

Fabric Smart Client The Fabric Smart Client (FSC, for short) is a new Fabric client-side component whose objective is twofold. FSC aims to simplify th

Dec 14, 2022