Bitcoin Forum
June 25, 2024, 07:59:34 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 »
1  Bitcoin / Project Development / Re: Need help about PHP and API on: September 29, 2017, 08:53:54 AM
Quote
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);

FWITW, doing this or just error_reporting(0) is the same. It takes a binary flag as arguments. It's like doing 0xFFFF & ~0xFFFF which obviously equals...0.
2  Bitcoin / Project Development / Re: Need help about PHP and API on: September 28, 2017, 07:08:06 PM
Quote
I do not understand your "add a @ in front of the call"

In PHP, adding a @ in front of a call disables any error related to this call. But you should globally disable error reporting in your php.ini.
Just read the doc Wink


I have put this:
Quote
ini_set('display_errors', 'off');
error_reporting(0);
But I do not see a difference.

about the @ I have not yet foud.

@ just tells PHP not to trigger an error for a particular call. (e.g. when you don't globally disable all the errors)
3  Bitcoin / Project Development / Re: Need help about PHP and API on: September 27, 2017, 05:59:04 PM
Quote
I do not understand your "add a @ in front of the call"

In PHP, adding a @ in front of a call disables any error related to this call. But you should globally disable error reporting in your php.ini.
Just read the doc Wink
4  Bitcoin / Project Development / Re: Need help about PHP and API on: September 27, 2017, 03:40:06 PM
Well, you just leaked your secret key from coin-hive because file_get_contents failed and disclosed the URL you're trying to call (with the secret key embedded).

1. Disable PHP errors on production!
2. We now know we shouldn't trust the thing you're calling 'U2cloudmining'



Thanks and how can I do this?
and test it?

http://php.net/manual/en/function.error-reporting.php

If it's just for file_get_contents, add a @ in front of the call.
5  Bitcoin / Project Development / Re: Need help about PHP and API on: September 27, 2017, 02:17:05 PM
Quote

Well, you just leaked your secret key from coin-hive because file_get_contents failed and disclosed the URL you're trying to call (with the secret key embedded).

1. Disable PHP errors on production!
2. We now know we shouldn't trust the thing you're calling 'U2cloudmining'

6  Bitcoin / Project Development / Re: Need help about PHP and API on: September 27, 2017, 01:31:19 PM
Quote
Both codes work
but I am not able to replace :
$data = '{"success":true,"name":"winspiral","total":196864,"withdrawn":0,"balance":196864}';
by
 
$data='$file';
why?

Because :

1. If $file contains the JSON, it must be either just $file (no quote, or double quote instead of single) or just use $file as the data.
2. If you want to read the data from a file, use something like $data = file_get_contents($path_to_file) (or whatever is the API you get your JSON from)

Anyway, this is very basic programming. If you're planning to deal with other people money, you shouldn't do this yourself.
7  Bitcoin / Development & Technical Discussion / Re: Bitcoin Fork November. BTC and BCH on: September 27, 2017, 12:52:50 PM
Hello

I have a question about the next fork, that could probably come in November 2017.
When the first fork happened, I was holding 0.5 BTC and got the same in BCH (nice fork Grin)

So now I have 0.5 BTC and 0.5 BCH.
What happens on the next fork?
Will I get 0.5 BTC of that new third coin, or will I get 1 coin?
Basically, am I getting only new coins for the BTC I hodl or also for the BCH?
Sorry for my noob question, but I could not find any answer to this yet.
Thank you!

This is simple to understand. The only duplicated coins are the ones that share the same blockchain. It's exactly like copying a file and start working on both copy at some point. You share the same history but every new change is made on only one file, not both.
So if there is a fork from BTC, you'll only have this one duplicated, since BCH as nothing to do with the new fork and doesn't share the same history since it happened.
8  Bitcoin / Project Development / Re: Need help about PHP and API on: September 27, 2017, 12:39:25 PM
This is quite dumb, but if you really want to have the named variable exported to the global namespace, you can use extract()

e.g.

Code:
$data = '{"success":true,"name":"winspiral","total":196864,"withdrawn":0,"balance":196864}';
extract((array)json_decode($data), EXTR_SKIP);

echo "Hey $name, your balance is $balance";

Anyway, you shouldn't do this and avoid trashing the global namespace (or current scope), just use a regular object, like :

Code:
$obj = json_decode($data);
echo "Hey $obj->name, your balance is $obj->balance";
9  Alternate cryptocurrencies / Altcoin Discussion / Re: need help !! on: September 27, 2017, 11:29:14 AM
I guess you're refering to GetBlockSubsidy() function.

nSubsidy is the number of coin "mined".
nHeight is the block number.

Here you're just telling the function to reward "10000" coins for the first block (provided that you're returning this value).

Given what you asked, a more comprehensible way to achieve the same result would be :

Code:
   nSubsidy = (nHeight == 1) ? 
                      10000 * COIN :
                      100 * COIN;

Also, not sure, but the first block is probably 0 (nHeight)

i want 10000coins  in the first block and he rest blocks should have 100 coins each  considering the simple liteocin source i guess mine is right but still need some expert advice


Since you only want 100000 coins total, you need to stop rewarding coin after 1000 blocks minus the first premined. So 900 blocks. (900*100 + 10000 = 100000).

Just add at the beginning :

Code:
if (nHeight > 900) return 0;

Not sure what your problem is? This is very simple
10  Alternate cryptocurrencies / Altcoin Discussion / Re: need help !! on: September 27, 2017, 11:15:46 AM
I guess you're refering to GetBlockSubsidy() function.

nSubsidy is the number of coin "mined".
nHeight is the block number.

Here you're just telling the function to reward "10000" coins for the first block (provided that you're returning this value).

Given what you asked, a more comprehensible way to achieve the same result would be :

Code:
   nSubsidy = (nHeight == 1) ? 
                      10000 * COIN :
                      100 * COIN;

Also, not sure, but the first block is probably 0 (nHeight)
11  Other / Beginners & Help / Re: Avoid fees when buying coins on: September 27, 2017, 07:46:33 AM
I want to start buying some coins (btc, eth, altcoins...) but when looking at the exchanges like bitfinex, bitmex... they all charge some non neglectable fees to deposit USD or coins.
So my question is: is there a way to avoid all these fees ?

You can still buy coins "off exchanges" but you then lose the escrow service provided by it. (having a trusted third party handling the transaction for you).

Quote
Is it better to deposit cash on an exchange and buy coins directly on the exchange? Or buy coins and then transfer them to the exchange (I saw bitfinex charges had deposits but not btc deposits for example)
Also if I create an account on different exchanges, do I need to create a wallet for each one or can I use the same wallet on different places ?

It's ALWAYS better to keep your coins out of the exchange. "Not your private key, not your coin".
Obviously, you can manage all your coin on one wallet. Just transfer your coin to one of the addresses provided by your wallet.

Also, if your plan is to do some day trading, of course, keep what you need on the platform. Just keep in mind that any third party holding your money may shutdown without prior notice.
12  Other / Beginners & Help / Re: private Key ? on: September 25, 2017, 01:50:05 PM
what is private key and how this key work ?

This is the base concept behind asymmetrical cryptography (https://en.wikipedia.org/wiki/Public-key_cryptography).
You can share your public key with anyone, so that one can encrypt a message that only you can read (owner of the private key derived from the public key).

When it comes to bitcoin (or more generally to cryptocurrencies), your private key allows you to spend the coins you received on your public address (wallet address). (More info here : https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses)
13  Economy / Currency exchange / Re: Buying BTC using Skrill on: September 25, 2017, 01:42:56 PM
There are various exchanges listed here: https://en.bitcoin.it/wiki/Skrill
14  Bitcoin / Project Development / Re: Is it possible to create a coinbase exchange? with lower fees? on: September 20, 2017, 02:08:46 PM
Quote
Now I do have a white paper and eveything ready to go but before I push the button. I want to know is this possible.

So, you have a white paper but don't know if it's possible?  Roll Eyes

Quote
But you wont be able to withdraw for the first 3 months of the grand opening of the site. This being that if people decide to just go to my site and withdraw I would go bankrupt in the matter of seconds

So you're going to play with people money?
This look a very good plan if your final goal is to end up in jail.
15  Local / Développement et technique / Re: Interaction fiat- cryptomonnaie on: September 19, 2017, 05:14:22 PM
Bonjour,

Il existe deux principe de fonctionnement pour les carte de paiement crypto <-> FIAT

Le pré-paiement
Il s'agit ici de service type CryptoPay
1) L'utilisateur doit envoyer des fonds Bitcoin vers son wallet CryptoPay
2) CryptoPay fait ensuite la conversion des Bitcoins vers une devise FIAT
3) Les fonds sont ensuite chargé sur la carte bancaire
4) Les paiements sont ensuite réalisé de manière classique

Le paiement a la volé
Il s'agit ici du mécanisme utilisé par TenX
1) La carte de paiement dispose d'un solde de 0€
2) Lorsque la carte est utilisé pour le paiement la transaction est envoyé aux serveurs Visa/Mastercard puis transmise à TenX (ou autre)
3) Le serveur va vérifier si le wallet de l'utilisateur dispose de suffisamment de Bitcoin
4) Les Bitcoins sont vendu "a la volé" pour le montant exact de la transaction
5) La devise FIAT est envoyé sur la carte de paiement
6) La transaction est approuvé, le solde de la carte retourne a 0€

Chaque service dispose de divers mécanisme pour la conversion/vente des cryptos a la volé mais le principe reste globalement le même. Dans le cas de TenX par exemple ils utilisent le réseau COMIT qui permet l'utilisation de plusieurs types de cryptocurency et des smart contrat off-chain sont utilisé pour réaliser les conversion. Si tu souhaite en savoir plus a ce sujet, tu peux lire le white-paper de COMIT ( http://www.comit.network/doc/COMIT%20white%20paper%20v1.0.2.pdf ) ou même celui de TenX ( https://www.tenx.tech/whitepaper/tenx_whitepaper_final.pdf )
16  Bitcoin / Development & Technical Discussion / Re: Bitcoin transaction help on: September 18, 2017, 11:38:52 AM
Quote
So I started thinking: Am I correct, that when sending a bitcoin transaction, all of the amount from a specific address gets placed in the input, a part of it (the part which I specify) gets sent to the address I wish to send, and the rest gets transferred to a newly created address on the same wallet, from which the send operation was initiated?

Not "all" of the amount. It uses a UTXO (Unspent Transaction Output) as input and send you back the change for it.
Basically, a UTXO is the output of a previous transaction you received. The way your wallet handle this is also called "coin control".
17  Other / Meta / Re: How to input Avatar? on: September 18, 2017, 06:25:15 AM

You need more activity : https://bitcointalk.org/index.php?topic=237597.0
18  Other / Meta / Re: How to input Avatar? on: September 18, 2017, 06:18:22 AM
You need to be full member : https://bitcointalk.org/index.php?action=avatar
19  Bitcoin / Development & Technical Discussion / Re: How do you realistically start a blockchain? on: September 18, 2017, 06:10:18 AM
What's your question?

Do you mean, how does one aquire the skill to understand every aspect of the blockchain, from the economic perspective, to the technical aspect?
Probably start hacking into the existing and understand the state of the art.
20  Bitcoin / Development & Technical Discussion / Re: Why node is showing "whitelisted":false, even i added whitelist=<ip> on: September 18, 2017, 06:03:46 AM
You can try to specify the address on which whitelisted node can connect to, using "-whitebind".

If you look closely, the value you're refering to is displayed here : https://github.com/bitcoin/bitcoin/blob/e0e3cbbf081b74ed5322176dcda081c64076fd21/src/rpc/net.cpp#L171

This value is set here :

https://github.com/bitcoin/bitcoin/blob/723e5806578be90ba0f6b953629cf7389e6a27cd/src/net.cpp#L1056

Code:
bool whitelisted = hListenSocket.whitelisted || IsWhitelistedRange(addr);

So, it's true either because it's connected to a whitelisted bound address (set by -whitebind and should be restricted by a firewall or local network) or is in the whitelist range (which you seem to (wrongly?) set in your config).

I suggest you to break into this code and check what's going wrong with the test against the addr in your config : https://github.com/bitcoin/bitcoin/blob/723e5806578be90ba0f6b953629cf7389e6a27cd/src/net.cpp#L607-L613

thank you , looking in to it.

wiki says i can specify ip too. and not just ip range.

-whitelist=<IP address or network>   Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times. Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway


and i have other non trusted peers connecting to my node.
so if i do whitebind., then all the nodes will be whitlisted , i dont think thats a good idea.

ill try , the whitelist with cidr range.

thnks

That's what I said actually, hence my statement about adding a breakpoint into the IsWhitelistedRange() function (which check against the IP specified in the whitelist config key).
I suggested you to try whitebind as a test to make sure that your config is working properly.
Pages: [1] 2 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!