Code Monkey home page Code Monkey logo

crypto-ltp-example's Introduction

crypto-ltp-example

Simple example accessing crypto stock from rest api server

Prerequisite installation

Install Rust compiler

Use any suitable approach to Rust compiler. Then check it using command below

cargo --version

The output should be something like :

cargo 1.77.2 (e52e36006 2024-03-26)

Docker (with docker compose)

Install Docker + docker compose tools into your system

See how to install it from Docker guide/doc

Build docker image

docker build -t crypto-ltp-example:v1 .

docker build --no-cache -t crypto-ltp-example:v1 .

Run docker image

docker network create --driver bridge mynetwork

docker run -p 8080:8080 -it --network mynetwork crypto-ltp-example:v1

OR

docker run -p 8080:8080 -it --net=host crypto-ltp-example:v1

Testing REST API

Deployed application API is accessible by URL: http://127.0.0.1:8080/api/v1/ltp

Possible compile errors

Windows 10

failed to run custom build command for openssl-sys v0.9.102

The possible solution to build 'openssl' library is available by a link

Other possible errors

If you see below error in running docker container

ERROR crypto_ltp_example::routes::last_trade_price] Not fetched pair = "BTC/USD" due to error: Connect is failed: error sending request for url (https://api.kraken.com/0/public/Ticker?pair=BTCUSD)

There are number of reasons possible that prevent internal container code to access external internet (firewall, network settings). There is no one solution for all OS and situations, sorry.

crypto-ltp-example's People

Contributors

blandger avatar

Watchers

 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.