It's the network protocol. With a simple state machine, your Clojure REPL 
can become a simple Bitcoin node and do fun things like download the 
blockchain. What's it good for? At first, it's good for some Saturday 
morning fun. But then I started implementing blockchain validation which 
happens to be splendid for masochism.

On Monday, January 27, 2014 8:39:59 PM UTC-6, Cedric Greevey wrote:
>
> On Mon, Jan 27, 2014 at 4:13 PM, danneu <danr...@gmail.com 
> <javascript:>>wrote:
>
>> ztellman's Gloss is magic to me.
>>
>> - Here's an example of my first attempt to use Gloss to parse the Bitcoin 
>> protocol: https://gist.github.com/danneu/7397350 -- In 2-chan.clj, it 
>> demonstrates using ztellman's Aleph to send Bitcoin's verack handshake to a 
>> node and ask it for blocks.
>>
>
> I assume we don't want to know what's in 4-chan.clj. ;)
>  
>
>> - Bitcoin protocol specs are described here: 
>> https://en.bitcoin.it/wiki/Protocol_specification
>> - The hardest part of the protocol was 
>> https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_integer, 
>> but Gloss makes it easy.
>> - The latest version of my code is here (
>> https://github.com/danneu/chaingun/blob/master/src/chaingun/codec2.clj) 
>> but it became coupled to my Datomic entities, so it's perhaps more 
>> confusing.
>>
>> I wasn't able to find any easy to follow real-world examples back when I 
>> was checking it out, so hopefully that helps someone. 
>>
>> The amount of time Gloss has saved me is dumbfounding.
>>
>
> What's the Bitcoin code good for though? A Clojure-based miner will be 
> stomped into the dust by the HW-accelerated mining machines that exist 
> nowadays. Or is this for managing a wallet and making transactions? 
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to