Comments (9)
Also now reproduced with Ruby 2.0.0
from bitcoin-ruby.
we never tried that part on windows.
ffi_lib': Could not open library 'ssl'
mean it was not able to load (as in find) ssl.dll on your system. its not about the openssl ruby gem. if you know the path to your ssl.dll you can set it in bitcoin/ffi/openssl.rb:8
also, are you really using the bitcoin-ruby gem? don't, please use the git version from github. the gem was never officially released and is very outdated
from bitcoin-ruby.
Thanks for the feedback. I'll use the git version from now on. I can't however find an ssl.dll on my machine. Any ideas where I can get it from? Web searches aren't helping.
from bitcoin-ruby.
http://www.openssl.org/related/binaries.html i guess. but maybe its not called ssl.dll. i have no clue on windows, sorry.
from bitcoin-ruby.
Thanks for you help anyway. I've learned how to install Ubuntu, Ruby, all the required packages and have now got the function working on Linux, and can create public addresses from private keys.
Incidentally, the get balance example doesn't seem t o be working properly: it doesn't detect when an address has not transactions (returning a balance of 0), and if you use the --list option it tries to get transactions from nil, and returns the following:
balance2.rb:47:in `block (2 levels) in <main>': undefined method `get_addresses' for nil:NilClass (NoMethodError)
from balance2.rb:46:in `each'
from balance2.rb:46:in `block in <main>'
from balance2.rb:41:in `each'
from balance2.rb:41:in `<main>'
from bitcoin-ruby.
Well, the balance being 0 is the expected behavior. It just tells you how many BTC this address has to spend. In many cases when you check the balance, it makes no difference if the address has previously had coins and spent them all, or never received anything. The amount available to spend is 0 either way.
With the --list option I'm not quite sure. It's supposed to exit when there are no transactions.
(You're having different line numbers apparently, so I guess this is where it fails: https://github.com/lian/bitcoin-ruby/blob/master/examples/balance.rb#L42)
Is the address you use with --list empty as well? Have you tried with different addresses? I just generated one and tried on an empty blockchain DB:
> ruby examples/balance.rb 1J63mvBh16Lcwh5XMJmP3nYrq9FhJd3o62
INFO storage: opened database sqlite://bitcoin.db
Balance: 0.00000000
> ruby examples/balance.rb 1J63mvBh16Lcwh5XMJmP3nYrq9FhJd3o62 --list
INFO storage: opened database sqlite://bitcoin.db
Address not seen.
So to me it looks like your address wasn't empty, and one of the inputs doesn't have a prev_out (or it can't be found).
Was there maybe a generation tx to your address? (That would explain it, and it's entirely possible we never tested that)
The only other thing I could think of would be a corrupted DB.
Unfortunately, I can't test it with a real DB right now, but to fix it you could try to check if the prev_out is nil, and instead of calling .get_addresses on it, just output "generation" or something.
from bitcoin-ruby.
It looks like the problem is with generation addresses - so they could do with testing. Thanks for your help.
I am about four days in to generating a blocks.db from my blk*.dat files, and am about 60% in. Slow business...
from bitcoin-ruby.
a9970d8 should fix it. thanks for bringing it up! :)
from bitcoin-ruby.
I shouldn't have added the balance problem to the ssl.dll problem. However, I have verified that the new balance.rb works with generation addresses, so I think we can close this thread.
from bitcoin-ruby.
Related Issues (20)
- raise exceptions instead of returning NIL
- How to convert transaction to hex format? HOT 3
- How to convert hash160 script to Script object?
- Webbtc is not longer alive, better remove it from the README
- Add BitcoinSV Support HOT 1
- Supporting openssl 1.1.0 HOT 1
- litecoin HOT 1
- Why do we need openssl.rb?
- Invalid DLL file names on Windows OpenSSL 1.1.0 / 1.1.1
- Mac os iterm2 fish 'irb' terminated by signal SIGABRT (Abort)
- Is this gem is threadsafe? HOT 5
- Connect Node
- Undefined method 'bytesize' for nil:NilClass Error HOT 9
- Can this be used for dogecoin? HOT 1
- undefined method `each' for nil:NilClass (NoMethodError) HOT 9
- How do I correctly use the second output that sends remaining btc back to me?
- Can an the value of a prev_out be less than the amount I am sending?
- undefined method `dsa_sign_asn1' HOT 4
- Supporting openssl 3.0 HOT 1
- Add bitcoin as a topic to this repository
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitcoin-ruby.