bitcoin

比特币钱包搭建与使用

本秂侑毒 提交于 2019-12-06 02:04:38
安装 就位 cd /usr/local/ 安装依赖 yum install -y wget yum install -y autoconf yum install -y automake yum install -y libtool yum install -y gcc gcc-c++ gcc-g77 yum install -y openssl-devel yum install -y boost-devel yum install -y libevent-devel 数据库和钱包版本是有一定的搭配的,我这里用的是0.17.1配4.8.30,如果你要用其他版本,有可能需要折腾一下。 下载解压 berkeley-db安装包(这是我存储的云端文件) wget http://file.fengyumeng.com/db-4.8.30.tar.gz tar -zxvf db-4.8.30.tar.gz 如果你需要其他版本的话可以到这里去找: https://www.oracle.com/database/technologies/related/berkeleydb-release-history.html 切目录 cd db-4.8.30/build_unix/ 配置 ../dist/configure --enable-cxx --disable-shared --with-pic

bitfinex api v2 error, invalid key

微笑、不失礼 提交于 2019-12-05 17:06:50
I am trying to make a basic authenticated api call to their new v2 api and getting an invalid api key error returned. I reissued the api key just to verify, same error. from time import time import urllib.request import urllib.parse import hashlib import hmac APIkey = b'myapikeyyouarenotsupposedtosee' secret = b'myceeeeecretkeyyyy' url = 'https://api.bitfinex.com/v2/auth/r/wallets' payload = { #'request':'/auth/r/wallets', 'nonce': int(time() * 1000), } paybytes = urllib.parse.urlencode(payload).encode('utf8') print(paybytes) sign = hmac.new(secret, paybytes, hashlib.sha512).hexdigest() print

How does the bitcoin client determine the first IP address to connect?

旧巷老猫 提交于 2019-12-05 15:52:13
In my knowledge, bitcoin is a p2p protocol and a p2p protocol must have a dedicated central server . But it is said that bitcoin is decentralized . Back in 2009 we relied on IRC to bootstrap the network, so every node would connect to Freenode (later LFnet) and would join a channel. Their nicknames were their encoded public IP address. Nowadays the Bitcoin Core client, and many other implementations, rely on DNS seeds. DNS seeds are special DNS servers that are configured to return a number of randomly selected nodes from the network. The operators of the DNS seeds also run crawlers to

How to check Bitcoin address balance from my application?

大城市里の小女人 提交于 2019-12-05 15:42:17
How do I check a balance of a Bitcoin address (any, not necessarily mine), let's say in a Java application (or any other language)? I need a functionality like the one on blockchain.info or biteasy.com but I don't want to use their API. Bitcoin is open source, so I thought maybe it won't be so difficult to get the data myself? Use blockexplorer.com model and piggy back off their server or run your own using open source version at github.com/lirazsiri/blockexplorer For now there is no simple way to get balance of a address that not in the wallet with bitcoin core. Maybe this function is under

How to send a keep-alive packet through websocket in ruby on rails

坚强是说给别人听的谎言 提交于 2019-12-05 01:56:06
问题 I want to send a "Keep alive from client" message every 30 seconds for my websocket connection. Here's what the code that I have in my websocket initializer looks like: ws = WebSocket::Client::Simple.connect 'wss://bitcoin.toshi.io/' ws.on :message do |msg| rawJson = msg.data message_response = JSON.parse(rawJson) end ws.on :open do ws.send "{\"subscribe\":\"blocks\"}" end ws.on :close do |e| puts "WEBSOCKET HAS CLOSED #{e}" exit 1 end ws.on :error do |e| puts "WEBSOCKET ERROR #{e}" end

How to use pagination at api localbitcoin

夙愿已清 提交于 2019-12-04 19:19:09
I'm developing with localbitcoin API and i am using path “/api/dashboard/closed/” and this is my code: <?php function localbitcoinsquery($path, $nonce,array $req = Array()) { global $random; $key='mykey'; $secret='secretkey'; if ($req) { $get=httpbuildquery($req); $path=$path.'?'.$get; } $postdata=$nonce.$key.$path; $sign = strtoupper(hashhmac('sha256', $postdata, $secret)); $headers = array( 'Apiauth-Signature:'.$sign, 'Apiauth-Key:'.$key, 'Apiauth-Nonce:'.$nonce ); $ch = null; $ch = curlinit('https://localbitcoins.com'.$path); curlsetopt($ch, CURLOPTRETURNTRANSFER, true); curlsetopt($ch,

Implementing secp256k1 (ECDSA) in PHP (for Bitcoin) [closed]

前提是你 提交于 2019-12-04 12:16:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . To keen downvoters and/or closers: If you think this is offtopic for SO, kindly point me out other StackExchange site where this question would be more appropriate. How to implement ECDSA curve secp256k1 in PHP? Or rather: Are there any solutions - ie. includable specialized classes - already done? I can see

Parsing JSON data from a remote server

久未见 提交于 2019-12-04 07:04:04
I was wondering if there was any way to make a Parser in PHP in which gets the values from this site https://btc-e.com/api/2/btc_usd/ticker and sets them as variables in php code? I have looked at php parsers a bit and the only thing I found was parsers that echo all the information on a website. Since that URL returns a JSON response: <?php $content=file_get_contents("https://btc-e.com/api/2/btc_usd/ticker"); $data=json_decode($content); //do whatever with $data now ?> You can use file_get_contents to get the data from the URL and json_decode to parse the result, because the site you have

RegEx to match Bitcoin addresses?

心已入冬 提交于 2019-12-03 18:56:59
问题 I am trying to come up with a regular expression to match Bitcoin addresses according to these specs: A Bitcoin address, or simply address, is an identifier of 27-34 alphanumeric characters, beginning with the number 1 or 3 [...] I figured it would look something like this /^[13][a-zA-Z0-9]{27,34}/ Thing is, I'm not good with regular expressions and I haven't found a single source to confirm this would not create false negatives. I've found one online that's ^1[1-9A-Za-z][^OIl]{20,40} , but I

How to send a keep-alive packet through websocket in ruby on rails

佐手、 提交于 2019-12-03 16:28:33
I want to send a "Keep alive from client" message every 30 seconds for my websocket connection. Here's what the code that I have in my websocket initializer looks like: ws = WebSocket::Client::Simple.connect 'wss://bitcoin.toshi.io/' ws.on :message do |msg| rawJson = msg.data message_response = JSON.parse(rawJson) end ws.on :open do ws.send "{\"subscribe\":\"blocks\"}" end ws.on :close do |e| puts "WEBSOCKET HAS CLOSED #{e}" exit 1 end ws.on :error do |e| puts "WEBSOCKET ERROR #{e}" end Without any sort of 'keep alive', the connect closes in about 45 seconds. How should I send the 'heart-beat'