GithubHelp home page GithubHelp logo

bitd's People

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  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  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

bitd's Issues

Transaction missing p2sh input address

I found this while testing my bitd-importer

https://blockchair.com/bitcoin-cash/transaction/a7f755127dc63f32ed14b00fa789f6d101a2a1af334ccbb4d91d7b957fafe7cc

First input should have address pzcgf24w3f6slgzn2nm5e08dv6lch4ngvgedfc4e4z however it doesn't show up. The other inputs address does show up.

https://bitdb.network/v3/explorer/ewogICJ2IjogMywKICAicSI6IHsKICAgICJmaW5kIjogewogICAgICAidHguaCI6ICAiYTdmNzU1MTI3ZGM2M2YzMmVkMTRiMDBmYTc4OWY2ZDEwMWEyYTFhZjMzNGNjYmI0ZDkxZDdiOTU3ZmFmZTdjYyIKICAgIH0KICB9Cn0=


Another example is:

390a6806e8ebe0eb7d6fa83fa14810fef0669a9b4aafbdc4bb7389068f2fb81b / pzcf8fn0wc8aphkw4cgqjuzpd2xpeyggqu4v3vzqln

I think it is related to how p2sh addresses are parsed. It may be an issue upstream to bitcoincashlib ? It'd probably be useful to check first if it is fixed in bitcore-lib-cash if that's the case.

RPC settings not honored

It looks like that the TNA module doesn't utilize the credentials specified in the config file, but rather looks at environment variables.

 var fromHash = function(hash) {
   const RpcClient = require('bitcoind-rpc');
   const rpc = new RpcClient({
     protocol: 'http',
     user: process.env.BITCOIN_USERNAME ? process.env.BITCOIN_USERNAME : 'root',
     pass: process.env.BITCOIN_PASSWORD ? process.env.BITCOIN_PASSWORD : 'bitcoin',
     host: process.env.BITCOIN_IP ? process.env.BITCOIN_IP : '127.0.0.1',
     port: process.env.BITCOIN_PORT ? process.env.BITCOIN_PORT : '8332',
   })

So the Init needs something like:

    process.env.BITCOIN_USERNAME = Config.rpc.user;
    process.env.BITCOIN_PASSWORD = Config.rpc.pass;
    process.env.BITCOIN_IP = Config.rpc.host;
    process.env.BITCOIN_PORT = Config.rpc.port;

reversed 'tx.h' is needed for $lookup

Memo is using tx.h in reverse form. Something like 'tx.rh' is needed to allow lookups.
Unless I am missing a way to do it without additional field of cоurse

Broken dependency with node-jq and big-jq

node-jq/bin/jq is not found
I had an issue trying to install one of the dependencies:
unwriter/bigjq#1

This might have been particular to my machine but i got a solution.

Solution:
In this lib, you can fix this by running npm install --save --unsafe-perm [email protected]; npm install --save --unsafe-perm --no-bin-links

The package maintainer can fix this by adding "node-jq:":"=1.5.0" to the package.json. I'm not sure why no-bin-links is needed but it was necessary to do the final install on my machine

UTXO

Support Unspent outputs.

Currently it's easy to aggregate and filter outputs in many different ways, but bitdb doesn't provide info on which one of them are already spent.

Thinking about some potential use cases for this would be helpful in designing the architecture.

Query Blocks

Id like to be able to query blocks similarly to transactions. Among other things, this could allow for implementation of a block explorer. It could also be useful for analytics. These are some some suggestions for fields:

  • height
  • blocksize
  • block version
  • previous block hash
  • merkle root
  • time
  • bits
  • difficulty
  • chainwork
  • nonce
  • coinbase input data
  • coindays destroyed
  • transaction count
  • input total bch
  • output total bch
  • total inputs
  • total outputs
  • fee total
  • reward
  • [transactions]

Trouble running example with firebase cloud function

Hi, I've copy/paste the example using bitdb.network server but am getting an error I don't understand. Here's my code and the caught error is underneath.

exports.queryBlockchain = functions.https.onRequest((request, response) => {
    var query = {
    v: 3,
    q: { find: {}, limit: 5 }
    };
    var s = JSON.stringify(query);
    var b64 = Buffer.from(s).toString('base64');
    var url = "https://bitgraph.network/q/" + b64;

    var header = {
    headers: { key: "1Bk7ku4FF5fNngcquF6evGHEWNVQeXbB6g" }
    };

    axios
        .get(url, header)
        .then((r) => {
            console.log("Fetched: ", r.data)
            return response.send(JSON.stringify(r.data))
        })
        .catch((err) => {
            return response.send(err)
        })
})

{"message":"connect ECONNREFUSED 198.54.117.200:443","name":"Error","stack":"Error: connect ECONNREFUSED 198.54.117.200:443\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)","config":{"url":"https://bitgraph.network/q/eyJ2IjozLCJxIjp7ImZpbmQiOnt9LCJsaW1pdCI6NX19","method":"get","headers":{"Accept":"application/json, text/plain, */*","key":"1Bk7ku4FF5fNngcquF6evGHEWNVQeXbB6g","User-Agent":"axios/0.19.0"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1},"code":"ECONNREFUSED"}

Update to bitcore-lib-cash

bitcoincashjs is not being maintained, lets upgrade to bitcore-lib-cash which is maintained by bitpay, who's the original author of the bitcode-lib from which both bitcore-lib-cash and bitcoincashjs forked.

Technically this won't be difficult since both libraries are forked from the same upstream so have exactly the same API, but will need some testing.

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.