Skip to content

Commit e0a1e6a

Browse files
committed
separate offers and credential json
1 parent 532720d commit e0a1e6a

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
resources/
2-
config.json
3-
config.json*
2+
credentials.json
43
newtxn
54
payouts.csv
65
references.csv

config.example.json config.json

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
1-
//An example configuration file
2-
//To use make a copy of this and rename it to config.json
31
{
42
"offers": {
53
"best-price": {
64
"name": "South Asian Blend Medium",
7-
"price": 0.0004,
5+
"price": 0.00015,
86
"match": "Best Price",
97
"producer": "Farm name"
108
},
119

1210
"trending-choice": {
1311
"name": "Brazil Santos Medium-Dark",
14-
"price": 0.0004,
12+
"price": 0.00025,
1513
"match": "Trending Choice",
1614
"producer": "Farm name"
1715
},
1816

1917
"best-social-responsibility": {
2018
"name": "Ethiopia Sidamo Medium",
21-
"price": 0.0004,
19+
"price": 0.0002,
2220
"match": "Best Social Responsibility",
2321
"producer": "Farm name"
2422
},
2523

2624
"low-environmental-impact": {
2725
"name": "Colombia Huila Medium",
28-
"price": 0.0004,
26+
"price": 0.0002,
2927
"match": "Low Environmental Impact",
3028
"producer": "Farm name"
3129
}
32-
},
33-
34-
"walletpass":"<electrum wallet password>"
30+
}
3531
}

credentials.example.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"walletpass":"<electrum wallet password>"
3+
}

fserver.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
with open('config.json') as json_config:
2222
config = json.load(json_config)
2323

24+
with open('credentials.json') as json_credentials:
25+
credentials = json.load(json_credentials)
26+
2427
offers = config["offers"]
2528

2629
root_url = "http://localhost:5000"
@@ -258,7 +261,7 @@ def check_request(address):
258261

259262
def send_payment(address, amount):
260263
print "Attempting to send payment to " + address + " for " + str(amount) + "BTC"
261-
p = Popen(['electrum', 'payto', address, str(amount), '-W', config["walletpass"]], stdin=PIPE, stdout=PIPE, stderr=PIPE)
264+
p = Popen(['electrum', 'payto', address, str(amount), '-W', credentials["walletpass"]], stdin=PIPE, stdout=PIPE, stderr=PIPE)
262265
tx, err = p.communicate()
263266

264267
if p.returncode == 0:

0 commit comments

Comments
 (0)