Giter Club home page Giter Club logo

gctviewer's Introduction

gctviewer

Connect to GoCryptoTrader using its gRPC interface

Introduction

GCTViewer is a multi-platform gRPC based app that acts as a visual interface to GoCryptoTrader. GoCryptoTrader is a cryptocurrency trading bot supporting multiple exchanges written in Golang.

GCTViewer is created to experiment with mobile platforms, gRPC and GoCryptoTrader. It is at this point in no way designed or intended to be used beyond experimentation.

Screenshot

Getting Started

This project is a starting point for building a Flutter application on top of GoCryptoTrader.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Preparation

Install and configure Dart and Flutter following their official guides:

Do not forget to run flutter doctor and be sure to setup a mobile phone emulator as described in the Flutter manual.

Compiling, configuring and running

Retrieve and prepare GCTViewer as follows:

git clone https://github.com/Talta/gctviewer.git
cd gctviewer
flutter pub get

Configuration

To connect GCTViewer to GoCryptoTrader, it needs to be configured with GoCryptoTrader's connection details as specified in GoCryptoTrader's remoteControl section in its config.json. A sample configuration file is provided in assets/cfg/config_sample.json. Copy this file to assets/cfg/config.json and edit the connection details.

cp ./assets/cfg/config_sample.json ./assets/cfg/config.json

GCTViewer also needs to be provided the TLS public key for connecting to GoCryptoTrader's gRPC channel. Copy the TLS certificate from GoCryptoTrader's config folder to GCTViewer's config.

Assuming the default GoCryptoTrader config folder is used, the certificate file is copied as follows:

cp ~/.gocryptotrader/tls/cert.pem ./assets/cfg/cert.pem

Running

One way to run the app is through an emulator connected to Flutter. Identify a device ID to use in the emulator:

flutter emulators
flutter emulators --launch <emulator-ID>

Run GCTViewer on an attached device:

flutter devices
flutter run -d <device-ID> lib/main.dart

Alternatively, the gctview folder can be opened as a project in Android Studio or in Visual Studio Code, after which the emulator and the app can be run through the IDE.

Protobuf

Optionally, update the protocol buffer Dart code by generating the Dart files based on GoCryptoTrader's .proto file. See:

Note that in addition to GoCryptoTrader's protobuffer files, GCTViewer needs Google's timestamp protobuffer files.

Install the Dart plugin for the protoc compiler:

git clone https://github.com/dart-lang/protobuf/ dart-lang_protobuf
cd dart-lang_protobuf/protoc_plugin
pub install

And optionally:

pub global activate protoc_plugin

Compile updated dart include files, and move them to the GCTViewer source tree ./lib/model/grpc/:

protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --dart_out=grpc:$GCTVIEWERPATH/lib/model/grpc/ rpc.proto

The Dart plugin for the protoc compiler does not include the needed include files for timestamps, as documented here on Github. Although unlikely the include files need updating soon, a manual process is available. E.g.:

protoc -I=$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --dart_out=grpc:$GCTVIEWERPATH/lib/model/grpc/ /usr/include/google/protobuf/timestamp.proto

Links

GCTViewer is written while exploring the many excellent Flutter and Dart tutorials by the Flutter and Dart teams:

Dart has a gRPC plugin, with limited support from its creators. There are however some excellent community provided tutorials and examples to exploit its possibilities and work around the limitations.

gctviewer's People

Contributors

taltam avatar

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.