title: How to properly sign an Ethereum transaction?
body: <p>I'm learning Ethereum on GOlang. I work through Ganache GUI. I'm trying to make a transfer from 1 wallet to another, but I get an error at the stage of sending a transaction through the client. I think the problem is in the config where I sign the transaction. Tell me what config is needed for my transaction?</p>
  <pre><code>    tx := types.NewTx(&amp;types.DynamicFeeTx{
      Nonce:     nonce,
      GasTipCap: gasTipCap,
      GasFeeCap: gasFeeCap,
      Gas:       gas,
      To:        &amp;toAdress,
      Value:     value,
      Data:      data})
  
  config, block := params.TestChainConfig, params.TestChainConfig.MuirGlacierBlock
  
  signer := types.MakeSigner(config, block)
  
  signedTx, err := types.SignTx(tx, signer, privateKey)
  if err != nil {
      log.Fatal(&quot;Unable to sign TX&quot;)
  }
  
  if err != nil {
      log.Fatal(&quot;Unable to cast to raw txn&quot;)
  }
  
  err = client.SendTransaction(context.Background(), signedTx)
  
  if err != nil {
      log.Fatal(&quot;Unable to submit transaction&quot;)
  }
  
  fmt.Printf(&quot;tx sent: %s&quot;, signedTx.Hash().Hex())
  </code></pre>