diff options
author | IkiWiki <ikiwiki.info> | 2020-03-03 15:56:27 -0500 |
---|---|---|
committer | IkiWiki <ikiwiki.info> | 2020-03-03 15:56:27 -0500 |
commit | 7f6df89a48a2d57a6d09c8fd6dcf0a0ca0a5018a (patch) | |
tree | 89a1a7a1241b7461a2c561784a42f3919cf60171 | |
parent | 4b743a1f2435454da297ff55d531157101d77f7e (diff) | |
download | standingwithresilience-master.tar.gz standingwithresilience-master.zip |
-rw-r--r-- | .gitmodules | 2 | ||||
m--------- | backend/dep/bsvup | 0 | ||||
-rw-r--r-- | backend/resilient/bsv_metanet.py | 19 |
3 files changed, 13 insertions, 8 deletions
diff --git a/.gitmodules b/.gitmodules index c3df40a..9d2d48e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,4 +7,4 @@ [submodule "backend/dep/bsvup"] path = backend/dep/bsvup url = https://github.com/xloem/bsvup.git - branch = paramsadjust4 + branch = merged diff --git a/backend/dep/bsvup b/backend/dep/bsvup -Subproject 062592d6f259780f3cc0a81c15662e43b39c837 +Subproject da1b63529b81a44080fcd25c24e50d02a266afc diff --git a/backend/resilient/bsv_metanet.py b/backend/resilient/bsv_metanet.py index 62bf6c1..98956bb 100644 --- a/backend/resilient/bsv_metanet.py +++ b/backend/resilient/bsv_metanet.py @@ -24,13 +24,18 @@ class bsvup(): with open(self.keyfile) as f: self.privkey = f.read() self.configdir = self.keyfile + '.bsv' if bsvup.found: - if not os.path.isdir(self.configdir): - os.mkdir(self.configdir) + if not os.path.isfile(os.path.join(self.configdir, 'key')): + if os.path.isdir(self.configdir): + os.remove(os.path.join(self.configdir, '.bsv')) + else: + os.mkdir(self.configdir) os.symlink(".", os.path.join(self.configdir, ".bsv")) - proc = subprocess.Popen([bsvup.binary, 'init'], stdin=subprocess.PIPE, cwd=self.configdir) - proc.stdin.write(self.privkey + "\n") - time.sleep(1) - proc.communicate("\n") + proc = subprocess.Popen([bsvup.binary, '-p', '', '-r', '250', 'init'], stdin=subprocess.PIPE, cwd=self.configdir) + result = proc.communicate(self.privkey + "\n"); + print(result[0]) + print(result[1]) + if not os.path.isfile(os.path.join(self.configdir, 'key')): + raise "key not generated" open(os.path.join(self.configdir, "info", ".keepme"), "a").close() open(os.path.join(self.configdir, "objects", ".keepme"), "a").close() open(os.path.join(self.configdir, "tx", ".keepme"), "a").close() @@ -44,7 +49,7 @@ class bsvup(): # add files to bsv metanet orig_dir = os.path.abspath(".") - proc = subprocess.Popen([bsvup.binary, '-f', html_path, 'upload'], stdin=subprocess.PIPE, cwd=self.configdir) + proc = subprocess.Popen([bsvup.binary, '-p', '', '-r', '250', '-f', html_path, 'upload'], stdin=subprocess.PIPE, cwd=self.configdir) proc.stdin.write("\n") time.sleep(1) proc.stdin.write("Y\n") |