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

Function runShardWrite

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

Source from the content-addressed store, hash-verified

333}
334
335func runShardWrite(cmd *cobra.Command, args []string) {
336 setupLogger()
337
338 ds := initDataShard()
339
340 bs := readInputBytes()
341
342 commit := common.HexToHash(*commitString)
343 encodingKey := es.CalcEncodeKey(commit, *kvIdx, ds.Miner())
344 log.Info("Write info", "commit", commit, "encodingKey", encodingKey)
345
346 err := ds.Write(*kvIdx, bs, commit)
347 if err != nil {
348 log.Crit("Write failed", "error", err)
349 }
350 log.Info("Write value", "kvIdx", *kvIdx, "bytes", len(bs))
351}
352
353func runSampleRead(cmd *cobra.Command, args []string) {
354 setupLogger()

Callers

nothing calls this directly

Calls 5

setupLoggerFunction · 0.85
initDataShardFunction · 0.85
readInputBytesFunction · 0.85
MinerMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected