Basic script for testnet spamming (Windows)

Discussion in 'Testnet / Development' started by molten, Nov 22, 2017.

Thread Status:
Not open for further replies.
  1. molten

    molten Well-Known Member Staff Member

    Messages:
    115
    Likes Received:
    37
    Trophy Points:
    28
    Here's a basic script that makes spamming the network automated. Set and forget.
    It works well enough, and i encourage you to use it until we find/make something better. It requires PHP. And you are welcome to join us in the testnet channel on Slack if not there already. Ask for an invite in #general.

    By default the script will send 3 transactions of 1 xby to the first address in 'run_testnet_spam.bat' every ~0.5 second and move on to the next address. Once it hits the last address it will start from the top. The looping transactions will continue until you close the command window.

    How fast you can send transactions depends on your computer. There are some settings you can adjust if the script causes your wallet to freeze. Default is 2tx/second. Scroll down to #7 for a guide on this.

    Edit: Updated the script. It should send out transaction 50% faster than the previous one. Added a ton of new receiving addresses as well as better control of the transaction speed. You need to replace 'xbytestnet.php' and 'run_testnet_spam.bat' with the updated versions.


    1-

    Downloads
    XAMPP - Webserver that includes PHP. I'm using version 5.6.32
    https://www.apachefriends.org/download.html

    Zipfile with the updated scripts
    https://drive.google.com/file/d/145TYIoU-ob7ftkp-qhXzjy75HDw79NuC/view?usp=sharing

    (Optional) Notepad++ - Makes editing PHP files much easier
    https://notepad-plus-plus.org/download/v7.5.1.html


    2-

    Install XAMPP.​


    3-

    Open your xcite.conf file. It's in the same folder as wallet.dat and the blockchain.
    Add the following lines:
    rpcport=35001
    rpcallowip=127.0.0.1
    You should end up with something like this:
    [​IMG]
    Hit save, close the editor and restart xcite.exe​


    4-

    Locate your xampp installation folder and open the php folder. Copy the folder address.
    In my case it was 'D:\xampp\php'​


    5-

    Create a new folder and unzip the scripts.
    You should have 3 files, 'easybitcoin.php', 'xbytestnet.php' and 'run_testnet_spam.bat'.

    Open 'run_testnet_spam.bat' in notepad.
    Replace "C:\PATH\TO\PHP\FOLDER" with the location of your PHP folder from step 4.

    [​IMG]

    In the section below :start you can change the addresses you will be sending to.
    I included everyone from the address spreadsheet
    https://docs.google.com/spreadsheets/d/1XlIELiZ2C7YV40SOHLBNHtNg9b59s9MI5J00tL2bzvg/edit#gid=0

    Locate your own wallet address and remove that line from the script if you are on the list. No point in sending coins to yourself.

    Save and close.​


    6-
    Start 'run_testnet_spam.bat'

    Make sure you have restarted Xcite.exe after changing xcite.conf so it starts with the new parameters allowing the script to communicate with the wallet.
    If everything went well it should look something like this:
    [​IMG]

    7-
    If you want to change the speed, how many transactions gets sent to each address or the amount of xby per transaction, open xbytestnet.php in notepad(++).

    The variables you can change are
    $usleep - This changes the speed of sending transactions. 1 second = 1000000. Default setting is 500000, and that equals ~0,5 seconds between transactions. If your wallet is freezing, try increasing this value (try 1000000 or more)
    $amount - This changes how many XBY to send per transaction
    $loop_times - This changes how many transactions gets sent to one address in the .bat file before moving on the next line.

    [​IMG]


    That's basically it. Hope this made it easy. Let me know if there is something i should improve. Thanks to @marqric21 on slack for helping out!
     
    Last edited: Nov 25, 2017
  2. MarqRic

    MarqRic New Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    very good guide @molten thanks for putting this together.
    :)
     
  3. enervey

    enervey Member

    Messages:
    29
    Likes Received:
    8
    Trophy Points:
    8
    Good work, and great walkthrough explaining how to use it! I'll give it a try.
     
  4. molten

    molten Well-Known Member Staff Member

    Messages:
    115
    Likes Received:
    37
    Trophy Points:
    28
    It should hopefully help us get more people involved and start upping the volume :)
     
  5. molten

    molten Well-Known Member Staff Member

    Messages:
    115
    Likes Received:
    37
    Trophy Points:
    28
    Another quality of life tip if you are running windows 10 and are getting spammed with notifications.
    Open the notification center in the bottom right corner of the screen. Right click a notification from Xcite and disable the notifications for that application. No more noise :smiley:
     
    Yankee Ruin X likes this.
  6. nickdegre

    nickdegre Member

    Messages:
    34
    Likes Received:
    11
    Trophy Points:
    8
    I finally got it to work! Is there a way to speed up the transactions/second?

    EDIT: inside xbytestnet.php, by changing the sleep to usleep = 100000 for example i get 1tx/s. Lowering that number raised the transaction speed.
     
    Last edited: Nov 23, 2017
    molten likes this.
  7. molten

    molten Well-Known Member Staff Member

    Messages:
    115
    Likes Received:
    37
    Trophy Points:
    28
    It's a great way to speed up if your computer can handle it :)
     
  8. nickdegre

    nickdegre Member

    Messages:
    34
    Likes Received:
    11
    Trophy Points:
    8
    My computer can handle around 10tx/s , then the wallet freezes, but the script continues to run.
     
  9. molten

    molten Well-Known Member Staff Member

    Messages:
    115
    Likes Received:
    37
    Trophy Points:
    28
    The goal is finding the sweet spot where your wallet is able to keep up :) It's different for everyone. The script should be pretty safe for most computers though, at least computers with a SSD drive.
     
  10. Superd

    Superd Member

    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    So are we actually encouraged to have this run for testing purposes ?
     
  11. Niklasmato

    Niklasmato Member

    Messages:
    40
    Likes Received:
    23
    Trophy Points:
    8
    Great stuff.. can we currently run this?
     
Thread Status:
Not open for further replies.

Share This Page