How to call a contract static method?

Hello, everyone
Based on the hints given, I learned that this interface should be called to access static methods of the contract at no cost

http://localhost:3013/v2/debug/transactions/dry-run

But the parameters he needs now I don’t understand a little bit, the parameters I get through HTTP packet capture are like this?

{“accounts”:[{“pub_key”:“ak_f9vDQvr1cFAQAesYA16vjvBX9TFeWUB4Gb7WJkwfYSkL1CpDx”,“amount”:100000000000000000000000000000000000}],“txs”:[{“tx”:“tx_+GUrAaEBVqH8TvOMvF3ctrIzB7DFNUAucqkyyQh8iiLKvm7dAw+CBX6hBQ9o4kpHlKfZSqVzVJQsuraptmAFA/jMQj3olU8xmIljA4cBmyVrt5gAAACDGBf4hDuaygCHKxEiXQmTPxmyVhA=”}]}

Excuse me, what is TXS? How do I generate it?

And what does the packet return? Is there any configuration

In short, check the protocol repository, txs are the rlp-packed, signed and encoded transaction structures.

http://localhost:3113/v2/debug/transactions/dry-run

It seems not only the problem, is the port of this address correct?

1 Like

I found a problem. When setting 127.0.0.1, the local access is not accessible, so setting it to 0.0.0.0 is ok

1 Like

Are user signatures required when generating TX

did you check the protocol repository and understand the transaction generation process? Also transactions without signature are not valid

Transactions sent to dry-run should NOT be signed, this is to ensure that you don’t accidentally leak transactions that could be posted to the chain…

1 Like

So what does his generation rule look like?
I understand the steps

  1. Sir/madam ContractCallTx (but how should the parameters in it be selected)?
  2. Sign at NewSignedTx
    3.SerializeTx takes a Tx

I’m using the Golang-SDK
The specific code call looks like this

ttlnoncer := transactions.NewTTLNoncer(node)
callTx, err := transactions.NewContractCallTx(address, ctID,new(big.Int), new(big.Int), new(big.Int), config.Client.Contracts.ABIVersion, function,ttlnoncer)
if err != nil {
	return nil, function, err
}
signedTx := transactions.NewSignedTx([][]byte{}, callTx)
signedTxStr, err := transactions.SerializeTx(signedTx)

I was just one step away. Thank you

The Golang SDK seems to have no way to call static methods and needs to be encapsulated by itself. Will the official continue to maintain the Golang SDK