forked from slush0/stratum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
81 lines (62 loc) · 2.43 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
**!! Obsolete, not maintanied - DO NOT USE !!**
I keep this repository alive and open for study and historical purposes only.
It is no longer actively maintained (although there may be other forks that are still maintained).
Description:
============
This is implementation of Stratum protocol for server and client side
using asynchronous networking written in Python Twisted.
Homepage: http://stratum.bitcoin.cz
Contact to main developer:
==========================
Email info at bitcoin.cz
Nickname slush at bitcointalk.org forum
Installation
============
Requirements:
python 2.6 or 2.7
linux-based system (should work on Mac OS too, not tested)
Following instructions will work on Ubuntu & Debian*:
a) From GIT, for developers
git clone git://github.com/slush0/stratum.git
sudo apt-get install python-dev
sudo python setup.py develop
b) From package, permanent install for production use
sudo apt-get install python-dev
sudo apt-get install python-setuptools
sudo easy_install stratum
*) Debian don't have a 'sudo' command, please do the installation
process as a root user.
Configuration
=============
a) Basic configuration
Copy config_default.py to config.py
Edit at least those values: HOSTNAME, BITCOIN_TRUSTED_*
b) Message signatures
For enabling message signatures, generate server's ECDSA key by
python signature.py > signing_key.pem
and fill correct values to SIGNING_KEY and SIGNING_ID (config.py)
c) Creating keys for SSL-based transports
For all SSL-based transports (HTTPS, WSS, ...) you'll need private key
and certificate file. You can use certificates from any authority or you can
generate self-signed certificates, which is helpful at least for testing.
Following script will generate self-signed SSL certificate:
#!/bin/bash
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -in server.csr -signkey server.key -out server.crt
Then you have to fill SSL_PRIVKEY and SSL_CACERT in config file with
values 'server.key' and 'server.crt'.
Startup
=======
Start devel server:
twistd -ny launcher.tac
Devel server *without* lowlevel messages of Twisted:
twistd -ny launcher.tac -l log/twistd.log
Running in production
=====================
TODO: Guide for running twistd as a daemon, init scripts
TODO: Loadbalancing and port redirecting using haproxy
TODO: Tunelling on 80/443 using stunnel
Any volunteer for this ^ ?