Bounties-Network / BountiesAPI

The caching layer of the Bounties Network
MIT License
44 stars 26 forks source link

Token Endpoint #5

Closed villanuevawill closed 6 years ago

villanuevawill commented 6 years ago

Description

We'd like to provide an endpoint that returns all tokens that have been used at least once in a contract. It should also return its associated token data.

We do not want to refactor or change the current structure (address is on the bounty, but pricing token data is a separate model) due to various reasons at this point. Feel free to disagree with that approach, but I've wanted to keep a separation of concerns between third party data and our internal data. For example, we may have a token as part of a contract that does not exist yet on coinmarketcap. Additionally, the address and decimals live on the bounty schema in the contract, so I want to keep things consistent.

Requirements

Related Info

Definition of Done

Reviewers

Review Requirements

gitcoinbot commented 6 years ago

This issue now has a funding of 0.1 ETH (53.77 USD @ $537.71/ETH) attached to it.

gitcoinbot commented 6 years ago

Work has been started on the 0.1 ETH (42.23 USD @ $422.33/ETH) funding by:

  1. @murduk

    Please work together and coordinate delivery of the issue scope. Gitcoin doesn't know enough about everyones skillsets / free time to say who should work on what, but we trust that the community is smart and well-intentioned enough to work together. As a general rule; if you start work first, youll be at the top of the above list ^^, and should have 'dibs' as long as you follow through.

    On the above list? Please leave a comment to let the funder and the other parties involved what you're working, with respect to this issue and your plans to resolve it. If you don't leave a comment, the funder may expire your submission at their discretion.

murduk commented 6 years ago

Hello, I would like to work on this.

villanuevawill commented 6 years ago

@murduk great! Any questions ahead of time, or make sense overall?

murduk commented 6 years ago

@villanuevawill Could you please help on this. I couldn't run it locally. I am not very familiar with docker.

npm ERR! Error while executing: npm ERR! /usr/bin/git ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git npm ERR! npm ERR! fatal: Could not read from remote repository. npm ERR! npm ERR! Please make sure you have the correct access rights npm ERR! and the repository exists. npm ERR! npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:

villanuevawill commented 6 years ago

@murduk are you using mac? I'd encourage you to install the actual docker for mac in the link. Otherwise, if you just run the create volume steps, then docker-compose up, you shouldn't have any issues as everything is already containerized. let me know.

murduk commented 6 years ago

@villanuevawill yes I am using a mac. Sorry this might be a very simple question but Could you explain how to "install the actual docker for mac in the link"?

villanuevawill commented 6 years ago

@murduk please follow instructions under Setup in the readme step-by-step.

https://docs.docker.com/docker-for-mac/install/#download-docker-for-mac

murduk commented 6 years ago

@villanuevawill I have already installed macos version of docker. I have installed stable version, should I try the edge one?

villanuevawill commented 6 years ago

You created the volumes, then just ran docker-compose up? If so, can you include a larger stack trace of the error?

murduk commented 6 years ago

Merts-MacBook-Pro:BountiesAPI mertozdag$ docker volume create psql_bounties ^[[Apsql_bounties Merts-MacBook-Pro:BountiesAPI mertozdag$ docker volume create redis_bounties redis_bounties Merts-MacBook-Pro:BountiesAPI mertozdag$ docker-compose up Building contract_subscriber Step 1/10 : FROM mhart/alpine-node:9.6.1 ---> 31b702b5bee0 Step 2/10 : ARG auto_build="true" ---> Using cache ---> 54fe275cbf39 Step 3/10 : ENV auto_build=$auto_build ---> Using cache ---> 744b37b9114a Step 4/10 : WORKDIR /usr/src/app ---> Using cache ---> da0b3952da1d Step 5/10 : COPY package*.json ./ ---> Using cache ---> f09bb93a0648 Step 6/10 : RUN apk update && apk upgrade && apk add --no-cache bash git openssh ---> Using cache ---> fe38448dc0ce Step 7/10 : run apk --no-cache add --virtual native-deps g++ gcc libgcc libstdc++ linux-headers make python && npm install --quiet node-gyp -g && npm install --quiet && apk del native-deps ---> Running in 5fc56aee90b0 fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz (1/20) Installing binutils-libs (2.28-r3) (2/20) Installing binutils (2.28-r3) (3/20) Installing gmp (6.1.2-r1) (4/20) Installing isl (0.18-r0) (5/20) Installing libgomp (6.4.0-r5) (6/20) Installing libatomic (6.4.0-r5) (7/20) Installing mpfr3 (3.1.5-r1) (8/20) Installing mpc1 (1.0.3-r1) (9/20) Installing gcc (6.4.0-r5) (10/20) Installing musl-dev (1.1.18-r3) (11/20) Installing libc-dev (0.7.1-r0) (12/20) Installing g++ (6.4.0-r5) (13/20) Installing linux-headers (4.4.6-r2) (14/20) Installing make (4.2.1-r0) (15/20) Installing libbz2 (1.0.6-r6) (16/20) Installing libffi (3.2.1-r4) (17/20) Installing gdbm (1.13-r1) (18/20) Installing sqlite-libs (3.21.0-r0) (19/20) Installing python2 (2.7.14-r2) (20/20) Installing native-deps (0) Executing busybox-1.27.2-r8.trigger OK: 231 MiB in 51 packages /usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-03-23T18_56_56_387Z-debug.log ERROR: Service 'contract_subscriber' failed to build: The command '/bin/sh -c apk --no-cache add --virtual native-deps g++ gcc libgcc libstdc++ linux-headers make python && npm install --quiet node-gyp -g && npm install --quiet && apk del native-deps' returned a non-zero code: 1 Merts-MacBook-Pro:BountiesAPI mertozdag$

villanuevawill commented 6 years ago

/usr/bin/git ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git Can you run that locally on your command line? What happens?

murduk commented 6 years ago

Operation timeout, probably firewall issue. I will try on a different network.

murduk commented 6 years ago

Works great now :) Thank you

villanuevawill commented 6 years ago

@murduk I'll do another round of review on this today. Sorry for the delay.

villanuevawill commented 6 years ago

@murduk in order to reward you, can you first put work submitted on gitcoin?

gitcoinbot commented 6 years ago

Work for 0.1 ETH (38.43 USD @ $384.26/ETH) has been submitted by:

  1. @murduk

    Submitters, please leave a comment to let the funder (and the other parties involved) that you've submitted you work. If you don't leave a comment, the funder may expire your submission at their discretion.

murduk commented 6 years ago

@villanuevawill Thank you :) I submitted the work

gitcoinbot commented 6 years ago

The funding of 0.1 ETH (39.47 USD @ $394.73/ETH) attached to this issue has been approved & issued to @murduk.