Bitcoin Forum
May 12, 2024, 04:35:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: python-obelisk: Pure Python Obelisk + Bitcoin client side library  (Read 5807 times)
genjix (OP)
Legendary
*
expert
Offline Offline

Activity: 1232
Merit: 1076


View Profile
December 02, 2013, 04:10:01 AM
Last edit: December 12, 2013, 10:28:38 PM by genjix
 #1

https://github.com/darkwallet/python-obelisk/

See examples/ directory.

This is a collaboration between Pablo Martin's ZMQ/Obelisk implementation, and Robert Williamson's blockalchemy library with code from ThomasV's Electrum.

Obelisk is a scalable blockchain query infrastructure. See the setup guide. There is a public server available at 37.139.11.99:9091 but I wouldn't use it for anything production (besides testing).

A pure Python library is great because it can be deployed easily without requiring dependencies. This allows code to be ported across many platforms such as the mobile phone with Kivy, desktops or any platform running Python.

Features:

* Blockchain queries and navigation through Obelisk servers.
* Construct & sign transactions.
* BIP32 hierarchical wallet.
* Traverse the blockchain using a syntax similar to Django ORM / SQL alchemy.

Use cases:

* Website payment backend (store and manage the keys yourself).
* Wallet software.
1715488535
Hero Member
*
Offline Offline

Posts: 1715488535

View Profile Personal Message (Offline)

Ignore
1715488535
Reply with quote  #2

1715488535
Report to moderator
1715488535
Hero Member
*
Offline Offline

Posts: 1715488535

View Profile Personal Message (Offline)

Ignore
1715488535
Reply with quote  #2

1715488535
Report to moderator
"Bitcoin: the cutting edge of begging technology." -- Giraffe.BTC
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715488535
Hero Member
*
Offline Offline

Posts: 1715488535

View Profile Personal Message (Offline)

Ignore
1715488535
Reply with quote  #2

1715488535
Report to moderator
broketech
Member
**
Offline Offline

Activity: 104
Merit: 10


View Profile
December 09, 2013, 09:34:17 PM
 #2

No replies? Very nice, thanks again man.

Sysadmin - Troubleshooter - Armchair Debugger
BTC: 1PCocLTxLJP4L1d1Gigjhxoy2WypifA4Cy - UN: uQAR2PhjtdvNvbbh4JC4wJdx3SCh2W4xB4 - SKC: SR81M5iqLkRB6PjZgkpNkpz1G7KmY3zceL
jtimon
Legendary
*
Offline Offline

Activity: 1372
Merit: 1002


View Profile WWW
December 15, 2013, 02:16:49 PM
 #3

A pure Python library is great because it can be deployed easily without requiring dependencies. This allows code to be ported across many platforms such as the mobile phone with Kivy, desktops or any platform running Python.

Another great advantage of python is that it allows programmers to write very readable code, which is more maintainable, facilitates collaboration and conserves extensibility.

2 different forms of free-money: Freicoin (free of basic interest because it's perishable), Mutual credit (no interest because it's abundant)
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
December 16, 2013, 11:52:25 PM
 #4

Would it be possible to emulate blockchain.info's merchant API with that or does it require another piece in the puzzle? A self-hosted implementation of the callback API would be really great to have...

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
JahPowerBit
Sr. Member
****
Offline Offline

Activity: 335
Merit: 255


Counterparty Developer


View Profile
January 25, 2014, 12:51:27 AM
 #5

https://github.com/darkwallet/python-obelisk/

See examples/ directory.

This is a collaboration between Pablo Martin's ZMQ/Obelisk implementation, and Robert Williamson's blockalchemy library with code from ThomasV's Electrum.

Obelisk is a scalable blockchain query infrastructure. See the setup guide. There is a public server available at 37.139.11.99:9091 but I wouldn't use it for anything production (besides testing).

A pure Python library is great because it can be deployed easily without requiring dependencies. This allows code to be ported across many platforms such as the mobile phone with Kivy, desktops or any platform running Python.

Features:

* Blockchain queries and navigation through Obelisk servers.
* Construct & sign transactions.
* BIP32 hierarchical wallet.
* Traverse the blockchain using a syntax similar to Django ORM / SQL alchemy.

Use cases:

* Website payment backend (store and manage the keys yourself).
* Wallet software.

thks!!
JahPowerBit
Sr. Member
****
Offline Offline

Activity: 335
Merit: 255


Counterparty Developer


View Profile
January 27, 2014, 06:49:57 PM
Last edit: January 27, 2014, 08:02:58 PM by JahPowerBit
 #6

Hi,

I want to try pubsub.py example, but the script fails silently.
Obelisk and SX works well (i can see that in the debug.log).

But when i try this simple code :

Code:
if __name__ == '__main__':
    c = obelisk.ClientBase('tcp://127.0.0.1:9091', 'tcp://127.0.0.1:9093', 'tcp://127.0.0.1:9094')
    reactor.run()

But i obtain nothing! only silence..

I put some "print" in zmqbase, and it seems that the script connect well but don't receive anything.

Code:
~/python-obelisk$ python pubsub.py
init start
setup:
<obelisk.zmq_fallback.ZmqSocket instance at 0x2681878>
setup_block_sub:
<obelisk.zmq_fallback.ZmqSocket instance at 0x2681a70>
setup_transaction_sub:
<obelisk.zmq_fallback.ZmqSocket instance at 0x2681b90>
init end

and after that nothing..

i try with python-zmq and zmqproto but it's the same..

How i can diagnose what happen here ?

Thank you very much for your help.

BTW: i needed to correct the zmq_fallback to work with python-zmq and type='SUB'. I will make a pull request this week:

Code:
...

class ZmqSocket:

    context = zmq.Context(1)

    def __init__(self, cb, version, type = zmq.DEALER):
        self._cb = cb
        self._type = type
        [b]if self._type=='SUB':
            self._type = zmq.PUB[/b]

    def connect(self, address):
        self._socket = ZmqSocket.context.socket(self._type)
        self._socket.connect(address)
        l = task.LoopingCall(self.poll)
        l.start(0.1)

...

I just add the parameters type to the constructor.

Edit:
with netstat i can see that connection established :
Code:
/home/obelisk# netstat --inet
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 localhost.localdom:9094 localhost.localdo:36606 ESTABLISHED
tcp        0      0 localhost.localdo:40484 localhost.localdom:9091 ESTABLISHED
tcp        0      0 localhost.localdo:40472 localhost.localdom:9091 TIME_WAIT
tcp    13415      0 localhost.localdo:36606 localhost.localdom:9094 ESTABLISHED
tcp        0      0 localhost.localdom:9093 localhost.localdo:49661 ESTABLISHED
tcp        0      0 localhost.localdom:9091 localhost.localdo:40484 ESTABLISHED
tcp        0      0 localhost.localdo:40113 localhost.localdom:9092 ESTABLISHED
tcp        0      0 localhost.localdo:49661 localhost.localdom:9093 ESTABLISHED
JahPowerBit
Sr. Member
****
Offline Offline

Activity: 335
Merit: 255


Counterparty Developer


View Profile
January 28, 2014, 09:53:26 AM
 #7

someone have an idea please?
How i can now if the problem come from obelisk or from the client ?
thanks.
JahPowerBit
Sr. Member
****
Offline Offline

Activity: 335
Merit: 255


Counterparty Developer


View Profile
January 28, 2014, 03:54:13 PM
 #8

ok finally i found the solution. Just need to add :

self._socket.setsockopt(zmq.SUBSCRIBE, '')

here pull request for this fix:

https://github.com/darkwallet/python-obelisk/pull/3
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
June 01, 2014, 11:27:58 PM
 #9

Just a heads-up, i read:

Quote
Warning. Non-standard tx coming could probably fork libbitcoin/Obelisk from the main chain. #Bitcoin
- http://twitter.com/SDLerner/status/472388946761371648

And I see also:

Quote
I need to send a non-standard tx.
- http://bitcointalk.org/index.php?topic=627218.0

Is there a vulnerability and is it being addressed?

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!