-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_deadpool_entry.py
More file actions
45 lines (37 loc) · 1.26 KB
/
create_deadpool_entry.py
File metadata and controls
45 lines (37 loc) · 1.26 KB
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
import numpy as np
import sympy as sp
import sys
import binascii as bs
import os
from subprocess import PIPE, run
import json
if len(sys.argv) < 2:
print("Usage: python3 create_deadpool_entry.py <bounty_amount> < N integer (Optional) > ")
sys.exit()
nbits, p, q, n = 0, 0, 0, 0
bounty = sys.argv[1]
n = sys.argv[2]
print()
print("Create deadpool entry.")
command1 = "./factorn-cli createdeadpoolentry " + bounty + " " + str(n)
result = run( command1 , stdout=PIPE, universal_newlines=True, shell=True)
print(result.stdout)
print("Fund transaction.")
command2 = "./factorn-cli fundrawtransaction " + result.stdout
result = run( command2 , stdout=PIPE, universal_newlines=True, shell=True )
print(result.stdout)
print("Sign transaction.")
command3 = "./factorn-cli signrawtransactionwithwallet " + json.loads( result.stdout)["hex"]
result = run( command3 , stdout=PIPE, universal_newlines=True, shell=True )
print(result.stdout)
print("Send Transaction.")
command4 = "./factorn-cli sendrawtransaction " + json.loads( result.stdout)["hex"]
result = run( command4 , stderr=PIPE, stdout=PIPE, universal_newlines=True, shell=True )
print()
print( result.stdout )
print( result.stderr )
print()
print(command1)
print(command2)
print(command3)
print(command4)