Giter VIP home page Giter VIP logo

qbitninja's People

Contributors

estebangamedevelopment avatar nicolasdorier avatar xeniacx avatar yakupipek 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  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  avatar  avatar  avatar  avatar  avatar  avatar

qbitninja's Issues

Data Integrity Check

Hello,

Is there any way to check if data in Azure in OK?

Actually in our deployment of QBit.Ninja we have started to get some inconsistencies in the results (Our QBit.Ninja code is up to date now). For example the url "balances/38DdqhVuqb36jjmxTbvBkiFPXKA8EmW9Ly/summary?colored=true&at=446308" returns transactionCount 7385 on our deployment but 1384 on api.qbit.ninja (the 1384 seems to be the correct one) also wrong value for one of the assets (AJPMQpygd8V9UCAxwFYYHYXLHJ7dUkQJ5w). [Block 446307 is fine, 446308 is the first one with difference].

Without "colored=true" things seems to be identical, also number of differences increases as the number of block increases.

A document on data structure may also be helpful.

Thank you

Handling coinbase as a colored transaction unsuccessful

It seems there is problem in handling coinbase as a colored transaction:

Works (not coinbase): http://tapi.qbit.ninja/transactions/270fb9c799a3892af05fa1722caa31e85282dd3573eae4eaf26d82019bf37ba1?colored=true

Doesn't work (coinbase): http://tapi.qbit.ninja/transactions/c844644e7be550fee5d45a2fa9fae0c884fcda07222017a3cb1d83212f5e82f2?colored=true (works without colored parameter)

It seems the Indexer method GetTransactionAsync is causing the problem.

Please help me to overcome broadcast transaction.

I have automate btc sending from c# webapplication using following code. This following code works sometime but sometime not works.
If i use the transaction.tohex() and paste to https://testnet.smartbit.com.au/txs then it will transfer the btc.
Please let me know what is wrong?
I am using nbitcoin version 39. i want permanent solution. please help me. Because i want to make my code live tomorrow.

transaction.Inputs.Add(new TxIn(coin.Outpoint, masterKey.ExtKey.Derive((uint)txBalance.UserAutoId).ScriptPubKey));

        // calculate what amount of bitcoin needed to be send
        Money currrentBalance = new Money(currentBalanceDecimal, MoneyUnit.BTC);
        Money minerFee = new Money(fee, MoneyUnit.BTC);
        Money receiverAmount = new Money(amount, MoneyUnit.BTC);
        Money changeBackAmount = currrentBalance - receiverAmount - minerFee;

        Script receiverScriptPubKey = new BitcoinPubKeyAddress(receiverAdress).ScriptPubKey;

        transaction.Outputs.Add(new TxOut
        {
            Value = receiverAmount,
            ScriptPubKey = receiverScriptPubKey
        });
        if (changeBackAmount > 0)
        {
            transaction.Outputs.Add(new TxOut
            {
                Value = changeBackAmount,
                ScriptPubKey = masterPubKey.Derive((uint)lastUserAutoIdTransactionChange).ScriptPubKey
            });
        }

        // sign transaction
        var keys = new List<ExtKey>();
        foreach (var userAutoId in txBalanceListToUse.Select(x => x.UserAutoId).Distinct())
            keys.Add(masterKey.ExtKey.Derive((uint)userAutoId));

        transaction.Sign(keys.ToArray(), coinList.ToArray());

        var builder = new TransactionBuilder();
        NBitcoin.Policy.TransactionPolicyError[] error = null;
        builder.AddCoins(coinList.ToArray());
        bool verifyTransactionHash = builder.Verify(transaction, out error);

        if (verifyTransactionHash == true && error.Length == 0)
        {
            // Broadcast your transaction to all miners
            BroadcastResponse broadcastResponse = client.Broadcast(transaction).Result;
            if (!broadcastResponse.Success)
                throw new Exception(broadcastResponse.Error.Reason);

}

Adding sequence values for transaction inputs?

Hi, just found out about your project, very useful!

Question about the transactions function, would it be possible to include the nSequence numbers for the transaction's inputs? To determine if it's using Bitcoin's new opt-in Replace-By-Fee feature.

For example:
http://api.qbit.ninja/transactions/741cca02fbd02488277f95f004d070e852d8a716a8b13ea53398816bbc3cc39a?format=json

It would be great if the utxos that are spent by this tx (the "spentCoins" array) would each contain a "sequence" value for that particular input.

And actually... in that case, a "confirmations" number (for the originating tx) would be a very useful addition as well (with 0 meaning unconfirmed). Or perhaps a block height or hash (with 0 or null meaning unconfirmed). Because once a tx is confirmed, the RBF property doesn't really matter anymore.
But just including the "sequence" values would already be great!

Hope this helps improving your API even further :)

Found Issue with dll at same time everyday

Hi Nic,

I am checking from last 10 days but every other day dll reflect 'One or more errors occurred.' from 4:00:42 AM to 5:30 am.

Please can you check and provide updates?

/balances "until" is not working properly

Hello,

Seems "until" parameter is not working properly for /balances request.
If we understand correctly request:
"/balances/address/until=block num" should return only transactions for mentioned address included in blocks from tip(latest block) until block num.
Seems it is not working.

Here is example (our private blockchain). If needed we can try to find example on mainnet, but I believe example is OK.

  1. http://52.233.192.225/balances/2MuWdziH3irz1ssYvgMbLTZAds1Rtyij3Eh?colored=true
    We see here 5 transaction. Their blocks are: 37000, 37002, 37003, 37003, 37015

  2. http://52.233.192.225/balances/2MuWdziH3irz1ssYvgMbLTZAds1Rtyij3Eh?colored=true&until=37500
    Trying to get balance change transaction later then 37500 block and for some reason instead of zero we see same 5 here. Height value has top block for some reason.

Please, correct me if we understand smth wrong.

Thanks a lot in advance!

Transactions stopped to be broadcasted

No changes to our code using your lib for months and yesterday no more transactions creation succeed, the error:
"The transaction might not have been successfully broadcasted. Please check the Transaction ID in a block explorer."
Sample:
034957970ecedaa1026b7364244edf817287b349a88917ced79ee71d41011945 (fees: 16926 Satochis)
Help required asap please, critical service.

Version 2 and also got error today morning

Hi, do QbitNinja support version 2? if yes then which is the stable version of Package we can use?

This shows version 2 while our all transaction shows version 1.
https://www.smartbit.com.au/tx/33cea950b1e23f4465fc005400ac0c8e53e4816a644eb30cea5aeefea12799a3

I wrote because in version 2, it shows fee double instead of version 1. Like in above example it shows 57.11 on blockchain. Then also it got confirmed.
https://blockchain.info/tx/33cea950b1e23f4465fc005400ac0c8e53e4816a644eb30cea5aeefea12799a3

Please provide more details and example for git, so it's good for us to use less satoshi as fee.

Again issue with test indexing

Hi Nic,

I have check the nbitcoin and may be some issue with indexing.
https://live.blockcypher.com/btc-testnet/tx/10fa6d8fa236e424c073fda72873779507b7d67b14218b6ee1c9032525b0a34d/

This transaction is shows 6+ confirmation but currently when i use following code then it was not retrieve the transaction.

IDestination userUniqueKey = masterPubKey.Derive((uint)9); (this is my wallet index)
BalanceSelector balanceSelector = new BalanceSelector(userUniqueKey.ScriptPubKey);
BalanceModel transactionHistory;
transactionHistory = client.GetBalance(balanceSelector, true).Result;

Also let me know this issue arise with live environment?

Feature Request: Wallet notifications

Support receiving a callback notification (http "web hook") whenever

  1. a block is published which contains a transaction that references (in tx input or output) an address associated with the wallet
  2. a transaction enters the blockchain mempool which references (in tx input or output) an address associated with the wallet.

Thanks!

Exception "The node is not in a connected state"

I'm trying to start indexing the litecoin core node in my server with your project "QBitNinja.Listener.Console" but in the beginning get error "The node is not in a connected state". Litecoin core server is synchronized and running (litecoind.exe) and I successfully execute RPC requests (via litecoin-cli.exe). Could you tell me what I missed? Thank you!

Unconfirmed transaction is not forgotten

Hello,

As I understand of what discussed in #8 , unconfirmed transactions is forgotten after some hours (6 I think). For the transaction f5b05118d0a51bcedfeae1b37dfea165f835290ce9668c276b681ed0bb6b4976 although it has been past more than a day from its submission (https://www.blocktrail.com/BTC/tx/f5b05118d0a51bcedfeae1b37dfea165f835290ce9668c276b681ed0bb6b4976) it is still available (http://web.archive.org/web/20170311122658/http://api.qbit.ninja/transactions/f5b05118d0a51bcedfeae1b37dfea165f835290ce9668c276b681ed0bb6b4976?colored=true).

Is it a problem? (This transaction seems to be related to the recent malleability attack on Bitcoin network)

Thanks

GetBalance(unspentonly=true) false positive

Hello,

We have some reports that GetBalance function with unspentonly flag set to true, for address 38DdqhVuqb36jjmxTbvBkiFPXKA8EmW9Ly (which has large number of outputs and unspents) , sometimes generates outputs which has been spent.

As I have studied logs, the false positives are reported for transactions(tx1) which output to the address and all of these outputs are consumed in transactions (tx2, tx3) such that all tx1, tx2 and tx3 are mined in the same block (This may be also a wrong pointer).

I will update, if was able to generate the case deterministicly..

Any help appreciated.

Can it be related to unclosed #19 ?

Thanks


1- By GetBalance I mean: https://github.com/MetacoSA/QBitNinja/blob/master/QBitNinja.Client/QBitNinjaClient.cs#L263

Hosting QBit.Ninja inside docker

We want to create docker containers hosting QBit.Ninja. But it seems we have shared resources here, like a- service bus and 2- Table storage

Is it safe to share these resources specifically the service bus?

Will we have performance increase by having multiple instances of QBit.Ninja running using the same table storage?

Thanks

QbitNinja.client transaction issue

Hi, I have installed Qbitninja client package in my c# project.
Now i am trying to send transaction on Testnet, but could not see those transaction using following code.
My question:

  1. do we need to add or install anything else on server?
  2. Do we need qbitninja.server?
  3. Do we need azure server or it can run on any pc?
  4. If possible then please provide sample code.
  5. What fee we need to used? because i tried 0.0004 as well as .0015.

public void SendCoin(string receiverAdress, decimal amount, string message = null)
{
BitcoinSecret secretPrivateKey = masterKey.ExtKey.Derive(1).PrivateKey.GetWif(network);
var cl = new List();
Money minerFee = new Money(0.0004m, MoneyUnit.BTC);
var transaction = new Transaction();

		Money currrentBalance = new Money(0, MoneyUnit.BTC);
		var historyTransaction = client.GetBalance(secretPrivateKey.ScriptPubKey, true).Result;
		foreach (var tx in historyTransaction.Operations)
		{
			currrentBalance += tx.Amount;
			foreach (var coin in tx.ReceivedCoins)
			{
				cl.Add(coin);
				transaction.Inputs.Add(new TxIn(coin.Outpoint, secretPrivateKey.ScriptPubKey));
			}
		}				
		
		// calculate what amount of bitcoin needed to be send
		Money receiverAmount = new Money(amount, MoneyUnit.BTC);
		Money changeBackAmount = currrentBalance - receiverAmount - minerFee;

		// make sure you have enough money
		var totalSpendAmount = amount + minerFee.ToDecimal(MoneyUnit.BTC);
		if (totalSpendAmount > currrentBalance.ToDecimal(MoneyUnit.BTC))
			throw new Exception("The total spend amount is greater than you have now");

		// add outputs to tx
		Script receiverScriptPubKey;
		receiverScriptPubKey = new BitcoinPubKeyAddress(receiverAdress).ScriptPubKey;

		TxOut txOut = new TxOut()
		{
			Value = receiverAmount,
			ScriptPubKey = receiverScriptPubKey
		};
		TxOut changeBackTxOut = new TxOut()
		{
			Value = changeBackAmount,
			ScriptPubKey = secretPrivateKey.ScriptPubKey
		};

		transaction.Outputs.Add(txOut);
		transaction.Outputs.Add(changeBackTxOut);


		// add message
		if (!String.IsNullOrWhiteSpace(message))
		{
			var bytes = Encoding.UTF8.GetBytes(message);
			transaction.Outputs.Add(new TxOut()
			{
				Value = Money.Zero,
				ScriptPubKey = TxNullDataTemplate.Instance.GenerateScriptPubKey(bytes)
			});
		}

		// Sign the transaction
		transaction.Sign(secretPrivateKey, false);

		// Broadcast your transaction to all miners
		BroadcastResponse broadcastResponse = client.Broadcast(transaction).Result;
		if (!broadcastResponse.Success)
			throw new Exception(broadcastResponse.Error.Reason);
	}

How to setup QBitNinja for own server?

Hello,

I am working with Windows Server 2012 so I am not using azure services. Can I setup QbitNinja on IIS?

Also, I am trying to setup on azure but I can't find Storage resource and Azure Bus resource.

Please, could you record a video with it or write a article?

Another Issue, I downloaded the source and try build it my pc, But I got many errors.

qb

Thanks.

IS there any way to calculate fee

Is there any way to auto calculate the fee during withdrawn transaction?

Because if i get some thing static then withdrawn take long time. so please assist.

or is there any way to get total number of byte of current transaction?

QBitNinjaClient cannot be instantiated with Litecoin network

new QBitNinjaClient(NBitcoin.Litecoin.Networks,Mainnet) triggers the following error:

System.NotSupportedException: "Network not supported"

Stack trace says:
at QBitNinja.Client.QBitNinjaClient..ctor(Network network) in C:\Sources\rapidbase\QBitNinja.Client\QBitNinjaClient.cs:line 196

Support of blocks more than 1 MB

Hello,

Is there any limitation in Indexer or QBit.Ninja regarding blocks more than 1 MB?

I am considering the use of Bitcoin Unlimited instead Bitcoin Core in some deployments, and worrying if possible blocks more than 1 MB will cause any problems.

Thanks

QBitNinja released under LGPL3.0

I am generally hesitant to use LGPL3.0 due to the potential legal issues of static and dynamic linking, I am curious as to why QBitNinja is released using LGPL3.0, is it a matter of preference or necessity?

TestNet server broadcust not working

I done successful broadcast, but looks like, it's not working. Can you check it?

Tx hash:fdf5117b6820a39f9c022fe01609ed111ce99bf72ed92be103ed21a2f4ba266b

Feature request: Return color info on get transaction

It would be great if the qbit /transactions/ returned colored asset information in the same manner that /wallets//balance and /balances/ do. Return color info if &colored=true

This would virtually eliminate the need for clients to use NBitcoin's expensive/exhaustive GetColoredTransaction() function at all, and save the clients from having to make dozens or hundreds of network calls to qbit /transaction to crawl the transaction chain in search of issuance txs.

/Balances amount field negative for large txs?

I'm seeing an issue in the amount field returned by tapi.qbit.ninja/balances/mnDQg9yvKQv3u88favjCfGtDhfD5tpq9wa .

In the operation with transactionId ed7bc6de74ce3c8d2e2f6d9b2ac487eacc39a03ea11f9431c4865c7ce27244e7, the amount field is negative: -1257227

This tx is consolidating a few hundred inputs into one 6000 TBTC output. The amount should be 6000 * satoshis-per-coin. Similar for the txs before and after this one. 3 consolidations: 5000, 6000, and 11528 TBTC, but none of them show the correct amount in the "amount" field of the operation.

The balance summary shows the correct total balance.

Excerpt: (spent coins edited out for brevity)

{
amount: 245755493,
confirmations: 719,
height: 407327,
blockId: "000000000003475f3410f488c7a178e103e02cecc9108be48aab6b22153bafe6",
transactionId: "8bacc5fb0eed986a95c4127a773cbad7ed48ce1172707465ca327eb15750d5bb",
receivedCoins: [
{
transactionId: "8bacc5fb0eed986a95c4127a773cbad7ed48ce1172707465ca327eb15750d5bb",
index: 0,
value: 1152800000000,
scriptPubKey: "76a91449776a3be69fa71e2d12d14d0d7d696c28fd395e88ac",
redeemScript: null
}
],
spentCoins: []
},
{
amount: -1257227,
confirmations: 719,
height: 407327,
blockId: "000000000003475f3410f488c7a178e103e02cecc9108be48aab6b22153bafe6",
transactionId: "ed7bc6de74ce3c8d2e2f6d9b2ac487eacc39a03ea11f9431c4865c7ce27244e7",
receivedCoins: [
{
transactionId: "ed7bc6de74ce3c8d2e2f6d9b2ac487eacc39a03ea11f9431c4865c7ce27244e7",
index: 0,
value: 600000000000,
scriptPubKey: "76a91449776a3be69fa71e2d12d14d0d7d696c28fd395e88ac",
redeemScript: null
}
],
spentCoins: []
},
{
amount: 4998696861,
confirmations: 719,
height: 407327,
blockId: "000000000003475f3410f488c7a178e103e02cecc9108be48aab6b22153bafe6",
transactionId: "ed7f627900ecce30dcbb681a7aaf4decaaeb2ee43cbd778640d3c10baa9a1c4a",
receivedCoins: [
{
transactionId: "ed7f627900ecce30dcbb681a7aaf4decaaeb2ee43cbd778640d3c10baa9a1c4a",
index: 0,
value: 500000000000,
scriptPubKey: "76a91449776a3be69fa71e2d12d14d0d7d696c28fd395e88ac",
redeemScript: null
}
],

QBitNinja incorrectly implements HTTP Content-Encoding

What it does:

  1. Get the original content
  2. Add Content-Encoding
  3. Clones all the headers
  4. Sends the encoded content as a stream.

The problem is that the "Content-Length" header is copied too, which will have the original Content-Length of the data, but it MUST have the Content-Length of the encoded data.

You cannot calculate the Content-Length, because you are sending it as a stream, so the Content-Length is not known in advance.

However if the Content-Length is not known in advance you MUST use Transfer-Encoding:chunked.

In which case Content-Length is not sent, rather the length of every chunk are sent separately.

https://tools.ietf.org/html/rfc7230#section-3.3.3

If the the recipient times out before the indicated number of octets are
received, the recipient MUST consider the message to be
incomplete and close the connection.

Balance update issue

Hello,

It seems sometimes when a transaction is sent the balances are not updated. For example consider the following transaction: http://web.archive.org/web/20160616192047/http://api.qbit.ninja/transactions/acf3e98c37513699549f4d5df8911130736e3124ade4a1b71822ff7c663ce27c?colored=true the output 5 of transaction 184ef9cb8d34d62a9878bffbd25cb4473e70033913e793a9d567801b53b621c6 is spent in the captured transaction but this output it is still reported as unspent: http://web.archive.org/web/20160616191930/http://api.qbit.ninja/balances/38DdqhVuqb36jjmxTbvBkiFPXKA8EmW9Ly?unspentonly=true&colored=true

The problem seems to gradually be corrected, when time passes, since I had issues which seems similar to this from some days ago, but now they do not exist as I am investigating now.

I use QBitNinja.Listner.Console for updating.

ASP.NET Core support

Hello,

Is there any plan to support ASP.NET Core? I am asking this for hosting QBit.Ninja inside a docker container which could be run on Linux: #16 .

Thank you for your help

live Main net not working

var getCurrentBlock = client.GetBlock(new BlockFeature(SpecialFeature.Last)).Result

This throws error one more error occur. Please can you check?

Please provide steps to make own Qbitninja server

Hi Nic,

Please can you provide me the steps to generate own qbite ninja server. Because on github i could not get full details.

Also please can you tell me what is the downtime on Qbit public server - Main (not testnet) Indexing

Invaild address

Hi Nic,

When we used following address to transfer money it give me invalid key:
38DdjQuLgpPebLFKFysxvWAjWHi5vpH56r
3JPNA8vXjfkC1i8ZUXbRggjXi19jirxmLD

i have tried with follwing way:
BitcoinAddress bitcoinAddress = new BitcoinPubKeyAddress(address, network);
also tried with:
Script receiverScriptPubKey = new BitcoinPubKeyAddress(address).ScriptPubKey;

Please let me know what is the issue? i am using version 39.

Thanks.

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.