Git Product home page Git Product logo

data-service's People

Contributors

alex01t avatar dvshur avatar leetwinski avatar pavel-prokhorov avatar shmidt-i avatar stuffy-idler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

data-service's Issues

Very old transfers not found in transfers endpoint

Hi!

First of, thank you for developing this awesome service! It increases transparency and makes digging into the blockchain very easy.

I'm trying out multiple queries, and noticed a problem:

When I'm querying https://api.wavesplatform.com/v0/transactions/transfer?recipient=XXX

The earliest transactions I can get start at 2017-01-16.
However, I know for sure that for that particular address, there exists some earlier transfers. When I query a particular tx (from 2016) by id, it correctly shows up:

https://api.wavesplatform.com/v0/transactions/all/XXX

Just wanted to let you know :)

Keep up the great work guys!

endpoints outside of /v0

The latest clients makes calls to an API 1 level above /v0/ for example;

https://api.wavesplatform.com/assets/search/bitcoin

and
https://api.wavesplatform.com/candles/WAVES/Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck?timeStart=1532080038877&timeEnd=1534758438879&interval=223m

But these are not handled by the service. Is there another service thats not published here, or is this code out of date? I'm service this repo on the /v0/ path

cc @dvshur

[BUG] Candles not calculating?

Describe the bug
The following URL shows transactions happening today (24th Sept)

https://api.wavesplatform.com/v0/transactions/exchange?matcher=3PJe4pG5fRwZh5EPwvtyQHCMpG7NVp7HBwh&amountAsset=5siW5tqvYLnfgeXttU7F9dZ3xrE8UHVtpqT9Ye71GBuJ&sort=desc&limit=100

and when reviewing candles service for the same time period all is null;

https://api.wavesplatform.com/v0/candles/6VFYAjvphuUyxmgPNAU1uEGcom8oLqJN4eu7jY2ihyV4/5siW5tqvYLnfgeXttU7F9dZ3xrE8UHVtpqT9Ye71GBuJ?matcher=3PJe4pG5fRwZh5EPwvtyQHCMpG7NVp7HBwh&timeStart=1598270400000&interval=12h

To Reproduce
Review both URLs

Expected behavior
There should be candles generated for the dates where transactions happened. And the value of those should be correct.

Matcher: 3PJe4pG5fRwZh5EPwvtyQHCMpG7NVp7HBwh

Can't run Docker and NodeJS

Hi team ,

I have run this cmd - ( docker run -p=:3000 --env-file=variables.env wavesplatform/data-service )

I got following error ( PFA )

Screenshot from 2019-10-22 16-46-30

And also i have run node js cmd - ( export $(cat variables.env | xargs) && NODE_ENV=production node src/index.js )

But the index.js file doesn't exist.

I am struggling on last 2 days.

So kindly provide solution ASAP.

Error: Cannot find module 'folktale/Maybe'

i follow read.me file and get this error :

root@:~/data-service# npm install 
npm WARN optional Skipping failed optional dependency /sane/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]

root@:~/data-service# export $(cat variables.env | xargs) &&
 NODE_ENV=production node src/index.js
module.js:549
    throw err;
    ^

Error: Cannot find module 'folktale/Maybe'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/root/data-service/src/utils/db/index.js:1:77)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

data by invokeScript isn’t available by AP

Issue Report - data by invokeScript isn’t available by API:

https://wavesexplorer.com/testnet/address/3N4GgQWCckqUn1H9y8rNRyCXZPkgKTNKznT

data: several key-value pairs generated by call of invokeScript

dapp address: 3N4GgQWCckqUn1H9y8rNRyCXZPkgKTNKznT

Results doesn’t contain invokeScript data
https://api.testnet.wavesplatform.com/v0/docs/#/transactions/searchTxsData

Issue 1: SCRIPT-transactions cannot be found by GET /transactions/data/

After generation of several “classical” data transactions - all transactions and data were found by API

Issue 2: SCRIPT-transactions cannot be found by GET /transactions/all/
https://api.testnet.wavesplatform.com/v0/docs/#/transactions/searchTxsAll

Issue 3: script and invokescript transactions are invisible for GET /transactions/all/ for sender (invokeTransaction caller)
https://wavesexplorer.com/testnet/address/3Mt9UZD5iajUxsfo7aTw11F8GTNQZHJKAUP

P.S.: Interesting that waves explorer works fine and I can see all key-value data pairs even generated by invokeScript

[BUG] Prototype Override Protection Bypass

Prototype Override Protection Bypass
Vulnerable module: qs
Introduced through: [email protected]
Detailed paths
Introduced through: data-service@wavesplatform/data-service#7f17ec615f4a24958b074bfbdaeb6582cc22d1a9 › [email protected][email protected]
Overview
qs is a querystring parser that supports nesting and arrays, with a depth limit.

By default qs protects against attacks that attempt to overwrite an object's existing prototype properties, such as toString(), hasOwnProperty(),etc.

From qs documentation:

By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use plainObjects as mentioned above, or set allowPrototypes to true which will allow user input to overwrite those properties. WARNING It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.

Overwriting these properties can impact application logic, potentially allowing attackers to work around security controls, modify data, make the application unstable and more.

In versions of the package affected by this vulnerability, it is possible to circumvent this protection and overwrite prototype properties and functions by prefixing the name of the parameter with [ or ]. e.g. qs.parse("]=toString") will return {toString = true}, as a result, calling toString() on the object will throw an exception.

Example:

qs.parse('toString=foo', { allowPrototypes: false })
// {}

qs.parse("]=toString", { allowPrototypes: false })
// {toString = true} <== prototype overwritten

[BUG] - Data Inconsistancy

When calling the following endpoint the 'close' number is 2.55;

https://api.wavesplatform.com/v0/candles/WAVES/6VFYAjvphuUyxmgPNAU1uEGcom8oLqJN4eu7jY2ihyV4?matcher=3P4vjfsebcfiv3oNTdFyXqGpFAnwY2c74HD&timeStart=1578484800000&interval=12h&timeEnd=1578562500000

{"__type":"list","data":[{"__type":"candle","data":{"time":"2020-01-08T12:00:00.000Z","open":2.55,"close":2.55,"high":2.6,"low":2.51,"volume":2576,"quoteVolume":6553.28,"weightedAveragePrice":2.54,"maxHeight":1875505,"txsCount":4}},{"__type":"candle","data":{"time":"2020-01-09T00:00:00.000Z","open":null,"close":null,"high":null,"low":null,"volume":null,"quoteVolume":null,"weightedAveragePrice":null,"maxHeight":null,"txsCount":0}}]}

But when I list transactions in date order decending the most recent tx price is 2.51

https://api.wavesplatform.com/v0/transactions/exchange?matcher=3P4vjfsebcfiv3oNTdFyXqGpFAnwY2c74HD&timeStart=1578484800000&timeEnd=1578562500000&sort=desc&limit=100

{"__type":"list","isLastPage":true,"lastCursor":"MjAyMC0wMS0wOFQxMjowMjoxNi43ODVaOjpIOW9Yd1cxNDhDc2JMc0ZqOG5yWGRuVUpxYUNlRUJMZUJXN014WlhTUUNweDo6ZGVzYw==","data":[{"__type":"transaction","data":{"id":"EqHxcWRJwZAAqNRqjS83ozkpAhgBqa6r48JSWDvS2FeR","timestamp":"2020-01-08T14:16:43.762Z","height":1875505,"type":7,"version":2,"proofs":["VCdNpbVhSpwWVCDiJPskp244zA2ynTjBNcA8YnndBUdikxHXgN98jujBEcynzdE3N5gMSpknAXv3o3MyrNs6cru"],"fee":0.003,"sender":"3P4vjfsebcfiv3oNTdFyXqGpFAnwY2c74HD","senderPublicKey":"4gHpbhVJeuHrb6yv5RuPYBEXn6MJdx4ZbjEqtmjx6mdQ","buyMatcherFee":0.003,"sellMatcherFee":0.003,"price":2.51,"am...

The expected result would be that the candles service returns the last trade price in this case with a close of 2.51

[BUG] Unit tests all are relative to executing time-zone. Only works if local machine running is UTC+3

Describe the bug
A clear and concise description of what the bug is.

When running the test in the project, the tests in sql.test.js that involve date time require the runner to be in UTC+3 to be successful.

To Reproduce
Steps to reproduce the behavior:

  1. Set timezone to UTC+4
  2. Run jest tests on sql.test.js
  3. Observe that the timestamps expected are +3

image

Expected behavior
A clear and concise description of what you expected to happen.

Regardless of what time-zone the tests are run in, the outcome should be the same

Additional context
Running using vscode Jest Runner

[FEATURE REQUEST] Add old directives to save backward compatibility.

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is.
Ex. I'm always frustrated when

[waves-lite-client cann't loading the market candles.]

Describe the solution you'd like

A clear and concise description of what you want to happen.

I want to you realize the backward compatibility of this API with old API: https://github.com/PyWaves/WavesDataFeed, and make your api compatible with this.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

I just see in client-side waves-lite-client
the following link: https://marketdata.wavesplatform.com
and there is another API.
There is warning, about this old api is deprecated, but this API is working good.
I see here: https://forum.wavesplatform.com/t/marketdata-deprecation-migration-guide/11050
the guide to migration, and I see here https://api.wavesplatform.com/v0/docs/
the API with another directives.
This API working, as default, on https://waves.exchange/
but this API not woking in client-side waves-lite-client.
Then, I go here: https://api.wavesplatform.com/v0/ and I see there the link to this project.
After this, I decided to create this issue.

Additional context

Add any other context about the feature request here.

As you can see, DATAFEED API on https://marketdata.wavesplatform.com
using another directives, like: /symbols, /markets, /tickers, /ticker, /candles, etc...
But many from this not available in new API.
So, you can add this, to save the backward compatibility.

Best regards.

[BUG] Passing Build Issue

Describe the bug
When running the repository from tag v0.28.0 there are test issues and build issues.

Am I doing something wrong?
image

To Reproduce
Steps to reproduce the behavior:

  1. Download git
  2. runnpm install
  3. run npm run buiild
  4. See error

Expected behavior
Project can build
Tests all pass

Please complete as much of the following information as you can:

  • Git version v0.28.0

[FEATURE REQUEST] Support tx 18 InvokeScript the same way as regular invokeScript

Is your feature request related to a problem? Please describe.
Hello,

Our web applications are using api.wavesplatform.com/v0/ to list all recent actions of our dapps or users in several places.
With the new tx 18 release, we started to implement MetaMask support but realized that invoke made with metamask then don't show up in all these place relying on invoke history (based on /transactions/invoke-script).

Describe the solution you'd like
Since an invoke script is an invoke script, it would make sens for us that they show in invoke-script end point (maybe optional), regardless if the call was made with MetaMask or a native waves signing tool. It is still an invoke call to a dapp generating the same result from the same action.

Describe alternatives you've considered
If this don't make enough sense then at least a separated endpoint for 18 that allow the same filtering as regular invoke-script so we could call both and merge the results and then get all invoke script calls for a specific dapp and / or callable

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.