Skip to content

Instantly share code, notes, and snippets.

@jhodges10
Forked from PastaPastaPasta/spam.py
Last active June 25, 2018 16:39
Show Gist options
  • Save jhodges10/7e29934275114ce5a5305758404e486c to your computer and use it in GitHub Desktop.
Save jhodges10/7e29934275114ce5a5305758404e486c to your computer and use it in GitHub Desktop.
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import time, os, sys
print("Starting Spam Program")
password = "d9060549bd53cda3fc0f891b5f4a586271d5ee6a180ade1ea2bfe3985ccc7b01"
user = "6594052d2802c63e763caad3afdd5a2babcdacc4daf47277ca91d4d050d25d16"
def rpc_conn(user=user, password=password):
rpc_conn = AuthServiceProxy("http://%s:%s@localhost:9998" % (user, password))
return rpc_conn
def run_spam():
tx_count = 0
while True:
address = rpc_conn().getnewaddress()
try:
print(tx_count, rpc_conn().sendtoaddress(address, 0.001))
except JSONRPCException as e:
print("Crashed because of {}".format(e))
sys.exit(1)
address = rpc_conn().getnewaddress()
tx_count += 1
# Wait 5 seconds before sending next transaction
time.sleep(5)
try:
print(tx_count, rpc_conn().sendtoaddress(address, 0.001, "", "", True, False, False))
except JSONRPCException as e:
print("Crashed because of {}".format(e))
sys.exit(1)
tx_count += 1
# Push update to monitor service
os.system("curl \"https://push.statuscake.com/?PK=2ef196fa4891bd3&TestID=3255983&time=0\"")
# Add new print line because pretty
print("\n")
# Wait 5 seconds before restarting loop
time.sleep(5)
if __name__ == '__main__':
run_spam()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment