github.com/annchain/OG@v0.0.9/benchmark/cmd/autotx.go (about)

     1  package cmd
     2  
     3  import (
     4  	"github.com/spf13/cobra"
     5  )
     6  
     7  var autoTxCmd = &cobra.Command{
     8  	Use:   "tx",
     9  	Short: "run auto client for normal tx generation",
    10  	Run:   runAutoClientManager,
    11  }
    12  
    13  func runAutoClientManager(cmd *cobra.Command, args []string) {
    14  	//autoClientManager := &auto.AutoClientManager{
    15  	//	SampleAccounts:         core.GetSampleAccounts(),
    16  	//	NodeStatusDataProvider: org,
    17  	//}
    18  	//// TODO
    19  	//// RegisterNewTxHandler is not for AnnSensus sending txs out.
    20  	//// Not suitable to be used here.
    21  	////autoClientManager.RegisterReceiver = annSensus.RegisterNewTxHandler
    22  	//
    23  	//accountIds := StringArrayToIntArray(viper.GetStringSlice("auto_client.tx.account_ids"))
    24  	//
    25  	//autoClientManager.init(
    26  	//	accountIds,
    27  	//	delegate,
    28  	//	myAcount,
    29  	//)
    30  	// syncManager.OnUpToDate = append(syncManager.OnUpToDate, autoClientManager.UpToDateEventListener)
    31  	// just for debugging, ignoring index OOR
    32  	//rpcServer.C.NewRequestChan = autoClientManager.Clients[0].ManualChan
    33  	// rpcServer.C.AutoTxCli = autoClientManager
    34  }
    35  
    36  // legacy code to be removed.
    37  
    38  //func (r *RpcController) AutoTx(c *gin.Context) {
    39  //	intervalStr := c.Query("interval_us")
    40  //	interval, err := strconv.Atoi(intervalStr)
    41  //	if err != nil || interval < 0 {
    42  //		Response(c, http.StatusBadRequest, fmt.Errorf("interval format err"), nil)
    43  //		return
    44  //	}
    45  //	r.AutoTxCli.SetTxIntervalUs(interval)
    46  //
    47  //	Response(c, http.StatusOK, nil, nil)
    48  //	return
    49  //}