Author

Topic: python-obelisk: Pure Python Obelisk + Bitcoin client side library (Read 5826 times)

legendary
Activity: 2506
Merit: 1010
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.
- https://bitcointalksearch.org/topic/miner-accepting-non-standard-txs-required-627218

Is there a vulnerability and is it being addressed?
sr. member
Activity: 335
Merit: 255
Counterparty Developer
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
sr. member
Activity: 335
Merit: 255
Counterparty Developer
someone have an idea please?
How i can now if the problem come from obelisk or from the client ?
thanks.
sr. member
Activity: 335
Merit: 255
Counterparty Developer
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:

setup_block_sub:

setup_transaction_sub:

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
sr. member
Activity: 335
Merit: 255
Counterparty Developer
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!!
legendary
Activity: 2618
Merit: 1007
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...
legendary
Activity: 1372
Merit: 1002
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.
member
Activity: 104
Merit: 10
No replies? Very nice, thanks again man.
legendary
Activity: 1232
Merit: 1076
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.
Jump to: