more docs for merchant script
[electrum-nvc.git] / scripts / merchant / merchant.readme
1 merchant.py is a daemon that manages payments for a web server. It
2 creates Bitcoin addresses using a master public key (so you do not
3 leave your private keys on the server), detects when payments are
4 received and notifies your web application.
5
6 The workflow goes like this:
7
8  - the server sends a request to the daemon via POST. the request
9    contains an amount to be paid, a number of confirmations, and an
10    expiration period in hours.
11
12  - the daemon answers with a Bitcoin address, where the customer needs
13    to send the coins.
14
15  - later, the daemon will send a POST to the webserver, to notify that
16    the payment has been received OR that the request has expired
17
18
19 Since addresses are generated using an Electrum master public key, it
20 is possible to visualize payments in the Electrum client; you will,
21 however, need to manually adjust your "gap limit". 
22
23 In order to use this script, first edit and rename
24 merchant.conf.template to merchant.conf
25
26 to launch it, type:
27 > python merchant.py
28
29 In another terminal, you may send a request from the command line (it
30 will send the request to the running daemon via http). For example,
31 here is a request for 0.1 bitcoins, that requires two confirmations,
32 and expires in 120 minutes:
33
34 > python merchant.py request 0.1 2 120
35
36