我有用过的方法:
调用eth_getTransactionReceipt 拿到交易详情
再调用eth_call把交易信息提交到节点上 就会拿到函数返回值
golang的话可以试下下面的代码

func GetMessage(hash common.Hash) (string, error) {
tx, _, err := eth.Client.TransactionByHash(context.Background(), hash)
if err != nil {
return "", err
}
from, err := types.Sender(types.NewEIP155Signer(tx.ChainId()), tx)
if err != nil {
return "", err
}
msg := ethereum.CallMsg{
From: from,
To: tx.To(),
Gas: tx.Gas(),
GasPrice: tx.GasPrice(),
Value: tx.Value(),
Data: tx.Data(),
}
res, err := eth.Client.CallContract(context.Background(), msg, nil)
if err != nil {
return "", err
}
return string(res), nil
}