Convenient script for quickly generating transactions containing data

Hello!
I’m hoping to timestamp data on Rootstock at relatively low latency, ideally via Python. The most straightforward mechanism would seem to be to include the hashes as data in the sending of a raw transaction. There are Ethereum libraries which appear to make this fairly straightforward, but it’s less obvious for Rootstock.

The following code, based around pip’s web3.js returns “ValueError: {‘code’: -32603, ‘message’: ‘Internal server error’}”.

Any feedback would be appreciated. I would, of course, like to ultimately deploy on mainnet.

from web3 import Web3
from eth_account import Account

my_provider = Web3.HTTPProvider(‘https://public-node.testnet.rsk.co’)
w3 = Web3(my_provider)

private_key = ‘4110ee084c208e8f3c9fd7203c4194e35db519a64c2e9c36b005e425b1356c73’
acct = Account.from_key(private_key)

signed_txn = w3.eth.account.sign_transaction(dict(
nonce=w3.eth.get_transaction_count(w3.toChecksumAddress(acct.address.lower())),
maxFeePerGas=3000000000,
maxPriorityFeePerGas=2000000000,
gas=100000,
to=‘0x0000000000000000000000000000000000000000’,
value=12345,
data=b’',
chainId=31,
),
acct.key,
)
w3.eth.send_raw_transaction(signed_txn.rawTransaction)

Hi Ortho - Did you discuss this with the Discord community? Or are you still looking for help?

Thank you for responding! Apologies for the latency in my response; I was working on another component of the project :smiley:

I was in a hurry for a python-native library for easily generating transactions from a private key with little configuration and overhead. I found a solution which suited me; issuing a token using brownie.

If there’s a default Python library for interacting with Rootstock, now would be a good time for me to switch over. May I ask whether there any commonly used Python-based solutions?