I have create a Private tangle with Hornet, and I setup three peer node for testing.
When I test for sending data with this tutorial, it responses
from iota import Iota, TryteString, Address, Tag, ProposedTransaction
from pprint import pprint
# Declare an API object
api = Iota('http://localhost:14265')
# Prepare custom data
my_data = TryteString.from_unicode('HI,')
# Generate a random address that doesn't have to belong to anyone
my_address = api.get_new_addresses()['addresses'][0]
print("Addr:", my_address)
# Tag is optional here
my_tag = Tag(b'MY9FIRST9TAG')
# Prepare a transaction object
tx = ProposedTransaction(
address=my_address,
value=0,
tag=my_tag,
message=my_data
)
# Send the transaction to the network
response = api.send_transfer([tx])
pprint(response)
Traceback (most recent call last):
File "/Users/danny/opt/iota/api/sendData.py", line 26, in <module>
response = api.send_transfer([tx])
File "/usr/local/lib/python3.9/site-packages/iota/api.py", line 1191, in send_transfer
return extended.SendTransferCommand(self.adapter)(
File "/usr/local/lib/python3.9/site-packages/iota/commands/__init__.py", line 130, in __call__
self.response = self._execute(self.request)
File "/usr/local/lib/python3.9/site-packages/iota/commands/extended/send_transfer.py", line 53, in _execute
st_response = SendTrytesCommand(self.adapter)(
File "/usr/local/lib/python3.9/site-packages/iota/commands/__init__.py", line 130, in __call__
self.response = self._execute(self.request)
File "/usr/local/lib/python3.9/site-packages/iota/commands/extended/send_trytes.py", line 49, in _execute
att_response = AttachToTangleCommand(self.adapter)(
File "/usr/local/lib/python3.9/site-packages/iota/commands/__init__.py", line 130, in __call__
self.response = self._execute(self.request)
File "/usr/local/lib/python3.9/site-packages/iota/commands/core/attach_to_tangle.py", line 41, in _execute
return super(FilterCommand, self)._execute(request)
File "/usr/local/lib/python3.9/site-packages/iota/commands/__init__.py", line 158, in _execute
return self.adapter.send_request(request)
File "/usr/local/lib/python3.9/site-packages/iota/adapter/__init__.py", line 320, in send_request
return self._interpret_response(response, payload, {codes['ok']})
File "/usr/local/lib/python3.9/site-packages/iota/adapter/__init__.py", line 455, in _interpret_response
raise with_context(
iota.adapter.BadApiResponse: 400 response from node: Wrong MinWeightMagnitude. requested: 14, expected: 5
How can I fix it?