Onionr/scripts/block-spammer.py
Kevin Froman a3ce191ed3 renamed old block api due to namespace conflict
fix onboarding not using optimize cpu option
2021-01-21 20:23:58 +00:00

32 lines
769 B
Python
Executable File

#!/usr/bin/env python3
"""Spam a bunch of Onionr blocks"""
# Please don't run this script on the real Onionr network. You wouldn't do anything but be annoying
print("Please don't run this script on Onionr networks that include more than you. You wouldn't do anything but be annoying, and probably violate law")
import sys
import os
if not os.path.exists('onionr.sh'):
os.chdir('../')
sys.path.append("src/")
import oldblocks
amount = int(input("Number of blocks:"))
expire = input("Expire in seconds:")
if not expire:
expire = ""
else:
expire = int(expire)
for i in range(amount):
if expire:
print(oldblocks.insert(data=os.urandom(32), expire=expire))
else:
print(oldblocks.insert(data=os.urandom(32)))
print(i, "done")