MCPcopy Create free account
hub / github.com/ethstorage/es-node / runUploadBlobs

Function runUploadBlobs

cmd/es-utils/main.go:466–506  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

464}
465
466func runUploadBlobs(cmd *cobra.Command, args []string) {
467 setupLogger()
468
469 wg := new(sync.WaitGroup)
470 wg.Add(len(*privateKeys))
471
472 for i, privateKey := range *privateKeys {
473 go func(idx int, priv string) {
474 files := genBlobAndDump(idx)
475
476 for j, file := range files {
477 selector := "0x4581a920"
478 byteArray := make([]byte, 32)
479 binary.LittleEndian.PutUint64(byteArray, uint64(j))
480 firstParam := hex.EncodeToString(byteArray)
481 otherParams := "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000"
482 calldata := selector + firstParam + otherParams
483
484 utils.SendBlobTx(
485 *rpcURL,
486 common.HexToAddress(*contractAddr),
487 priv,
488 file,
489 false,
490 -1,
491 "0x0",
492 210000,
493 "",
494 "200000000",
495 "300000000",
496 *chainId, // TODO: @Qiang everytime devnet update, we may need to update it
497 calldata,
498 )
499 }
500
501 wg.Done()
502 }(i, privateKey)
503 }
504
505 wg.Wait()
506}
507
508// rootCmd represents the base command when called without any subcommands
509var rootCmd = &cobra.Command{

Callers

nothing calls this directly

Calls 3

SendBlobTxFunction · 0.92
setupLoggerFunction · 0.85
genBlobAndDumpFunction · 0.85

Tested by

no test coverage detected