Git Product home page Git Product logo

assignment's Introduction

Building

Source Code

Run the following assuming you are running go 1.11 or above

go get github.com/sadysnaat/assignment

this will install a binary assignment in your $GOBIN

Dockerfile

this package comes with a dockerfile to build the project do

docker build -t <image_name> .

this will generate the docker image

Command will require five options

wssURL := flag.String("wss-url", "wss://kovan.infura.io/ws/v3/6c6f87a10e12438f8fbb7fc7c762b37c", "websocket url for the subscription")
httpsURL := flag.String("https-url", "https://kovan.infura.io/v3/6c6f87a10e12438f8fbb7fc7c762b37c", "https url for indexer")
dbURL := flag.String("db-url", "root:my-secret-pw@tcp(localhost:32768)/assignment", "database uri")
apiHost := flag.String("api-host", "0.0.0.0", "api host")
apiPort := flag.String("api-port", "8081", "api port")

if you are running from docker you will need to provide -db-url in the option if indexer cannot connect to db it will panic

Preparing the database

database should have one user configured to able to login from different ip addresses. Docker networking on mac makes it difficult to test the connection

create a database with <database_name> use in -db-url root:my-secret-pw@tcp(localhost:32768)/<database_name>

Run store/blocks.sql store/transactions.sql in the same order

Database is ready to use.

Running the main binary

run

assignment -db-url="<user_name>:<password>@tcp(<host_name>:<port>)/<database_name>"

API Guide

Please refer API.md

Design

Please refer DESIGN.md

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.