Giter Club home page Giter Club logo

insight-lite-api's Introduction

Insight API [DEPRECATED]

=======

Important Notice: insight-lite-api and the litecore stack are now deprecated. Please switch to alternative packages. insight-lite-api should be considered unsafe for production use.

Alternatives include:

  • insight: a modern fork of insight-lite-api with similar api (now supports litecoin)

License

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

insight-lite-api's People

Contributors

abbshr avatar bechi avatar braydonf avatar cmgustavo avatar devlo avatar eordano avatar eveiv avatar gasteve avatar iamkubi avatar igarciaes avatar ionux avatar isocolsky avatar jl2035 avatar kleetus avatar koirikivi avatar lordhelmut avatar losh11 avatar maraoz avatar martindale avatar matiu avatar periodic1236 avatar plwalters avatar pnagurny avatar ralphtheninja avatar rhoop avatar slush0 avatar stues avatar ultragtx avatar updatesthepoolist avatar yemel 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

Watchers

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

insight-lite-api's Issues

Vulnerability (stack trace disclosure)

Sending a POST request to a number of different API endpoints is incorrectly dumping the stack trace, this information might help an attacker gain more information and potentially focus on the development of further attacks for the target system or leverage the incorrect error handling to create a new attack.

Example -

  1. HTTP POST request to (https://insight.litecore.io/api/block/) with the body -
{
,
}

This will return the following HTTP reply -

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error</title>
    </head>
    <body>
        <pre>SyntaxError: Unexpected token ,
            <br> &nbsp; &nbsp;at Object.parse (native)
            <br> &nbsp; &nbsp;at parse (/home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/lib/types/json.js:89:19)
            <br> &nbsp; &nbsp;at /home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/lib/read.js:121:18
            <br> &nbsp; &nbsp;at invokeCallback (/home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/node_modules/raw-body/index.js:224:16)
            <br> &nbsp; &nbsp;at done (/home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/node_modules/raw-body/index.js:213:7)
            <br> &nbsp; &nbsp;at IncomingMessage.onEnd (/home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/node_modules/raw-body/index.js:273:7)
            <br> &nbsp; &nbsp;at emitNone (events.js:67:13)
            <br> &nbsp; &nbsp;at IncomingMessage.emit (events.js:166:7)
            <br> &nbsp; &nbsp;at endReadableNT (_stream_readable.js:923:12)
            <br> &nbsp; &nbsp;at nextTickCallbackWith2Args (node.js:511:9)
        </pre>
    </body>
</html>

There's also more stack trace dumping in other errors, see PayloadTooLargeError for eg -

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error</title>
    </head>
    <body>
        <pre>PayloadTooLargeError: request entity too large
            <br> &nbsp; &nbsp;at readStream (/home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/node_modules/raw-body/index.js:155:17)
            <br> &nbsp; &nbsp;at getRawBody (/home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/node_modules/raw-body/index.js:108:12)
            <br> &nbsp; &nbsp;at read (/home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/lib/read.js:77:3)
            <br> &nbsp; &nbsp;at jsonParser (/home/livenet/livenet/node_modules/litecore-node/node_modules/body-parser/lib/types/json.js:134:5)
            <br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/home/livenet/livenet/node_modules/litecore-node/node_modules/express/lib/router/layer.js:95:5)
            <br> &nbsp; &nbsp;at trim_prefix (/home/livenet/livenet/node_modules/litecore-node/node_modules/express/lib/router/index.js:317:13)
            <br> &nbsp; &nbsp;at /home/livenet/livenet/node_modules/litecore-node/node_modules/express/lib/router/index.js:284:7
            <br> &nbsp; &nbsp;at Function.process_params (/home/livenet/livenet/node_modules/litecore-node/node_modules/express/lib/router/index.js:335:12)
            <br> &nbsp; &nbsp;at next (/home/livenet/livenet/node_modules/litecore-node/node_modules/express/lib/router/index.js:275:10)
            <br> &nbsp; &nbsp;at expressInit (/home/livenet/livenet/node_modules/litecore-node/node_modules/express/lib/middleware/init.js:40:5)
        </pre>
    </body>
</html>

Fix -

  1. Try catch when parsing json and handle properly or hook eventemitter and handle properly.

Error while installing

While running command
litecore-node install insight-lite-api
got an error
/usr/local/lib/node_modules/litecore-node/lib/cli/main.js:75
throw new Error('Could not find configuration, see litecore-node create --help');
^

Error: Could not find configuration, see litecore-node create --help
at Command. (/usr/local/lib/node_modules/litecore-node/lib/cli/main.js:75:15)
at Command.listener (/usr/local/lib/node_modules/litecore-node/node_modules/commander/index.js:315:8)
at emitTwo (events.js:87:13)
at Command.emit (events.js:172:7)
at Command.parseArgs (/usr/local/lib/node_modules/litecore-node/node_modules/commander/index.js:651:12)
at Command.parse (/usr/local/lib/node_modules/litecore-node/node_modules/commander/index.js:474:21)
at Object.main (/usr/local/lib/node_modules/litecore-node/lib/cli/main.js:143:11)
at Liftoff. (/usr/local/lib/node_modules/litecore-node/lib/cli/bitcore.js:31:16)
at Liftoff.execute (/usr/local/lib/node_modules/litecore-node/node_modules/liftoff/index.js:203:12)
at module.exports (/usr/local/lib/node_modules/litecore-node/node_modules/liftoff/node_modules/flagged-respawn/index.js:51:3)

Any ideas?

Every day 8pm EST the API fails

Everyday 8pm EST like a clockwork the call:
/insight-lite-api/blocks?limit=1

returns empty blocks array:
{"blocks":[],"length":0,"pagination":{"next":"2018-06-15","prev":"2018-06-13","currentTs":1529020799,"current":"2018-06-14","isToday":true,"more":false}}

this problem lasts a minute or two and then all returns to normal.

Why is that???

List blocks api `/blocks` not working

Hi guys,
The list blocks api /blocks doesn't work, I inspect source code and realized Bitcore has getBlockHashesByTimestamp method and this method call getblockhashes.
I tested litecoin-cli commands (litecoin 0.13.2) with method getblockhashes (method returns an array of block hashes for a specified block range, ex: two timestamps) but it return Method not found, is it removed?
If it was removed, so is there a method that has the same feature with above method?

Change ticker to LTC

Hello,
I am working with a multicurrency wallet to be used for use your crypto on debit cards.
I am using HD wallets, but seems that the insight api is not correctly configurated, is just receiving btc as ticker, it will work if I was just using it, but I am using 6 or 7 apis.
So, anybody can work it to use ltc ticker, or should I create my own api.
I am using this website: https://insight.litecore.io/

WebSocket subscribe on Address transaction

"bitcoinAddress: new transaction concerning received from network. This event is published in the bitcoinAddress room."

How to use it?

I send:

io.emit('subscribe', "LTU2cds4aSdXFip9sV4gXphnhxGQjgfjmg");

and then:

io.on("LTU2cds4aSdXFip9sV4gXphnhxGQjgfjmg", function(data) {

console.log("New transaction LTU2cds4aSdXFip9sV4gXphnhxGQjgfjmg: ",data)

}).

But nothing happens. Transactions in the blockchain appear, but I do not get them.

Litecore works:
info: ::ffff:127.0.0.1 web socket subscribe: LTU2cds4aSdXFip9sV4gXphnhxGQjgfjmg

What am I doing wrong? Or how to do it? Just do not understand from the documentation .. :(

Please, help me.
Thank you!

insight-lite-api 404 issue

I'm facing this issue, when $ curl localhost:3001/insight-lite-api/ , i get {"status":404,"url":"/insight-lite-api/","error":"Not found"} . Has anyone encountered this issue?

Method not found. Code:-32601 insight-lite-api

Hi
I used the current version of litecore-node and run insight. but when I try to get block details or transaction I got this error message Method not found. Code:-32601
while just status page work fine.
What's wrong in this case?

help! litecore-node start error!

[sulijia@localhost mynode]$ litecore-node start
/home/sulijia/litecoin/mynode/node_modules/insight-lite-api/node_modules/async/dist/async.js:52
function apply(fn, ...args) {
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/sulijia/litecoin/mynode/node_modules/insight-lite-api/lib/blocks.js:3:13)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

not matter ubuntu18.04 or centos 7,error is the same,node version is 4.6.0,what's wrong?

I am not able to install this

I'm a noob when it comes to npm, could anyone help please?
Thank you!

c:\API>npm install -g litecore-node@latest

[email protected] preinstall C:\Users\Administrator\AppData\Roaming\npm\nod
e_modules\litecore-node
./scripts/download

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: ./scripts/download
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2018-01-19T0
6_07_23_261Z-debug.log

c:\API>

Error posting to addrs/txs/

I'm seeing this error on a fresh install:

curl -d 'addrs=an-address&from=0' 'http://127.0.0.1:3001/insight-lite-api/addrs/txs/'
Method not found. Code:-32601

Other calls working fine.

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.