im going to give a shot at making a bot for spamming the network with transactions but im wondering a few things like does matter if the amount being sent or the fee is fixed for all transactions to if it should be variable for every transaction? also how many transactions per min/hour etc would be best for a robust test? im thinking il be able to set up a gang of nodes with a bot on each spittin out transactions like nuts… but how many tx's are too many? obviously i want to test the network but i dont want to bring it crashing down either… :
edit: na looks like i can do it using the gui and not a clue how to do anything with direct api calls to the nis(i did say i only have basic skills)… oh well…
I would like to give this a shot, can someone please post the API syntax for sending a transaction?
API docummentation will hopefully come during the following week or the week after that.
Doing it over the gui will most likely not allow you to really go nuts. API will facilitate much faster sending.
Amount shouldn't matter but I'd vary with the fee.
So no API is available then? :( I have a script I used on a different coin I was hoping to adapt for NEM.
So no API is available then? :( I have a script I used on a different coin I was hoping to adapt for NEM.
Any chance I could get a look at it? Seeing how api calls are used I think will make a massive difference in my understanding.. Are they the same/similar to calling a method and sending a value to that method such as an address/amount?
I would like to give this a shot, can someone please post the API syntax for sending a transaction?
It's probably easiest to use the NCC APIs, which are documented here: https://github.com/NewEconomyMovement/NemCommunityClient/blob/master/docs/api.md. You'll want to look at /wallet/account/transaction/send and /wallet/account/transaction/validate.
Thank you for the info but is there any way you can give some steps on how to use this?
I would like to give this a shot, can someone please post the API syntax for sending a transaction?
It's probably easiest to use the NCC APIs, which are documented here: https://github.com/NewEconomyMovement/NemCommunityClient/blob/master/docs/api.md. You'll want to look at /wallet/account/transaction/send and /wallet/account/transaction/validate.
This is my old script I used:
#!/bin/bash
while :
do
./cryptonited -testnet sendtoaddress myoq946jrvuBCcHwzYV1cQV68Bdw1cVbjd "0.01000000ep"
sleep 1
done
Thank you for the info but is there any way you can give some steps on how to use this?
I would like to give this a shot, can someone please post the API syntax for sending a transaction?
It's probably easiest to use the NCC APIs, which are documented here: https://github.com/NewEconomyMovement/NemCommunityClient/blob/master/docs/api.md. You'll want to look at /wallet/account/transaction/send and /wallet/account/transaction/validate.
This is my old script I used:
#!/bin/bash
while :
do
./cryptonited -testnet sendtoaddress myoq946jrvuBCcHwzYV1cQV68Bdw1cVbjd "0.01000000ep"
sleep 1
done
What's cryptonited ? Some client for another crypto ?
yes, i was helping to do stress testing for it too. It was a mini-blockchain of bitcoin kind of thing.Thank you for the info but is there any way you can give some steps on how to use this?
I would like to give this a shot, can someone please post the API syntax for sending a transaction?
It's probably easiest to use the NCC APIs, which are documented here: https://github.com/NewEconomyMovement/NemCommunityClient/blob/master/docs/api.md. You'll want to look at /wallet/account/transaction/send and /wallet/account/transaction/validate.
This is my old script I used:
#!/bin/bash
while :
do
./cryptonited -testnet sendtoaddress myoq946jrvuBCcHwzYV1cQV68Bdw1cVbjd "0.01000000ep"
sleep 1
done
What's cryptonited ? Some client for another crypto ?
Some stressing suggestion:
amount = 10
fee = 0.1 (or which is minimum for 10 NEM)
TIME_X = 10 sec
for ever?
for address in addressList
send amount with fee to address
pause for TIME_X
endfor
amount = amount + 2
fee = fee + 0.1
TIME_X = TIME_X - 2 sec
if TIME_X < 0.1 sec
TIME_X = 10
endfor
I'm not sure I follow? How do you run this?
Some stressing suggestion: :)
amount = 10
fee = 0.1 (or which is minimum for 10 NEM)
TIME_X = 10 sec
for ever? :)
for address in addressList
send amount with fee to address
pause for TIME_X
endfor
amount = amount + 2
fee = fee + 0.1
TIME_X = TIME_X - 2 sec
if TIME_X < 0.1 sec
TIME_X = 10
endfor
I'm not sure I follow? How do you run this?
Some stressing suggestion: :)
amount = 10
fee = 0.1 (or which is minimum for 10 NEM)
TIME_X = 10 sec
for ever? :)
for address in addressList
send amount with fee to address
pause for TIME_X
endfor
amount = amount + 2
fee = fee + 0.1
TIME_X = TIME_X - 2 sec
if TIME_X < 0.1 sec
TIME_X = 10
endfor
that's just pseudo code :)
He was just proposing a logic.
An example of how to utilize NIS API - which is a REST API - is https://github.com/NewEconomyMovement/blockexplorer/blob/master/api_connectors/async_httpapi.py which is used by the blockexplorer (blockexplorer doesn't need much so the calls you guys would need aren't implemented).
Now this is written to be used async with tornado but the precedure is the same regardles. It's always simple http requests.
Ah ok Pat thanks. Guess we will have to wait for the API to be finished.
Very simple but it works on linux:<br />echo "TAX3CF5CQVCJEV2DQTQMFBSJN3REPOMH3OZJKP73<br />TA5J37JT6SDUV4K5VYFSLO4XVBGRT5M3LFQMCJJV<br />TBBUSMIV6K57KSRY3I7X42P66SKWDTPEZRFREXOH<br />TACMKSUMO5C64ETLTF33WSDAFT5BHL7K26BOH433<br />TDFW3H62F5DMCYB6MCFPQKOV3PDEVPTOE6GY5RAI<br />TB7RD3F2BUX4DSD4QWH3IHP7PLKBEBAFILHGOOVH" | while read ADDR<br />do<br />nc localhost 8989 <<EOF<br />POST /ncc/api/wallet/account/transaction/send HTTP/1.1<br />Host: localhost<br />Content-type: application/json<br />Content-length: 219<br /><br />{"wallet":"betatest","password":"beta","account":"TCRIGEL6TUKDGDVBXIVY3HQNADAV6JZMGKNPL23Y","recipient":"$ADDR","amount":10000000,"fee":2000000,"message":"","encrypt":0,"hours_due":12}<br />EOF<br />done<br />
Hey rigel,
So do I run this from my Nem dir?
Alternatively, here is some python code that sends transactions via NCC:
Of course, rigel's shell script is much more compact :D!<br />import json<br />import sys<br />from time import sleep<br />import datetime<br />import requests<br /><br /><br />class NccConnect:<br /> def __init__(self, address, port):<br /> self.address = address<br /> self.port = port<br /><br /> def info_ncc(self):<br /> return self.send_get('info/ncc')<br /><br /> def send_transfer(self, data):<br /> return self.send_post('wallet/account/transaction/send', data)<br /><br /> def send_get(self, path):<br /> headers = {'Content-type': 'application/json'}<br /> uri = str.format('http://{0}:{1}/ncc/api/{2}', self.address, self.port, path)<br /> return requests.get(uri, headers=headers, timeout=10)<br /><br /> def send_post(self, path, data):<br /> headers = {'Content-type': 'application/json'}<br /> uri = str.format('http://{0}:{1}/ncc/api/{2}', self.address, self.port, path)<br /> return requests.post(uri, data=json.dumps(data), headers=headers, timeout=10)<br /><br /><br />connect = NccConnect('localhost', 8989)<br />r = connect.info_ncc()<br />if not r.ok:<br /> print(str.format('unable to query ncc status {0}', r.status_code))<br /> sys.exit()<br /><br />print(str.format('connected to ncc version {0}', r.json()['metaData']['version']))<br /><br /># amounts are in micronem<br />data = {<br /> 'wallet': 'j',<br /> 'password': 'j',<br /> 'account': 'TD2T562S4H3XT3QADUYYWEJ4EKJAGUARHGGOLHQQ',<br /> 'recipient': 'TALICELCD3XPH4FFI5STGGNSNSWPOTG5E4DS2TOS',<br /> 'amount': 1000000,<br /> 'fee': 2000000,<br /> 'message': 'batch test',<br /> 'encrypt': 1,<br /> 'hours_due': 12<br />}<br /><br />time = datetime.datetime.utcnow().time()<br />for i in range(1, 4):<br /> print(str.format('sending transaction {0}', i))<br /> data['message'] = str.format('batch test #{0} ({1}Z)', i, time.strftime('%H%M%S'))<br /> r = connect.send_transfer(data)<br /> print(str.format('send returned {0}', r.status_code))<br /> sleep(1)<br />
When I run your script this happens:
Alternatively, here is some python code that sends transactions via NCC:
Of course, rigel's shell script is much more compact :D!
[code]
import json
import sys
from time import sleep
import datetime
import requests
class NccConnect:
def __init__(self, address, port):
self.address = address
self.port = port
def info_ncc(self):
return self.send_get('info/ncc')
def send_transfer(self, data):
return self.send_post('wallet/account/transaction/send', data)
def send_get(self, path):
headers = {'Content-type': 'application/json'}
uri = str.format('http://{0}:{1}/ncc/api/{2}', self.address, self.port, path)
return requests.get(uri, headers=headers, timeout=10)
def send_post(self, path, data):
headers = {'Content-type': 'application/json'}
uri = str.format('http://{0}:{1}/ncc/api/{2}', self.address, self.port, path)
return requests.post(uri, data=json.dumps(data), headers=headers, timeout=10)
connect = NccConnect('localhost', 8989)
r = connect.info_ncc()
if not r.ok:
print(str.format('unable to query ncc status {0}', r.status_code))
sys.exit()
print(str.format('connected to ncc version {0}', r.json()['metaData']['version']))
# amounts are in micronem
data = {
'wallet': 'j',
'password': 'j',
'account': 'TD2T562S4H3XT3QADUYYWEJ4EKJAGUARHGGOLHQQ',
'recipient': 'TALICELCD3XPH4FFI5STGGNSNSWPOTG5E4DS2TOS',
'amount': 1000000,
'fee': 2000000,
'message': 'batch test',
'encrypt': 1,
'hours_due': 12
}
time = datetime.datetime.utcnow().time()
for i in range(1, 4):
print(str.format('sending transaction {0}', i))
data['message'] = str.format('batch test #{0} ({1}Z)', i, time.strftime('%H%M%S'))
r = connect.send_transfer(data)
print(str.format('send returned {0}', r.status_code))
sleep(1)
[/code]
connected to ncc version 0.4.9-BETA
sending transaction 1
send returned 400
sending transaction 2
send returned 400
sending transaction 3
send returned 400
I have changed the wallet info to match mine.
Hey rigel,
So do I run this from my Nem dir?
Directory doesn't matter.
You have to change wallet name, wallet password, sending address and content-length (length of the line with brackets).
I did that and this is what I am getting:
Hey rigel,
So do I run this from my Nem dir?
Directory doesn't matter.
You have to change wallet name, wallet password, sending address and content-length (length of the line with brackets).
HTTP/1.1 400 Bad Request
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(9.1.z-SNAPSHOT)
5F
{"timeStamp":7248300,"error":"Bad Request","message":"JSON Object was expected","status":400}
0
HTTP/1.1 400 No URI
Content-Length: 0
Connection: close
Server: Jetty(9.1.z-SNAPSHOT)
Has there been a network change to slowdown spamming? My spams are not going out as fast as they were and I'm using the same settings.