Created
January 22, 2020 22:09
Revisions
-
vasa-develop created this gist
Jan 22, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ // Map the struct instance to the mapping DocStoreMap[inputID] = employeeObject // Converting the map into JSON object entryJSON, err := json.Marshal(DocStoreMap) if err != nil { fmt.Println(err) } // Display the marshaled JSON object before sending it to IPFS jsonStr := string(entryJSON) fmt.Println("The JSON object of your document entry is:") fmt.Println(jsonStr) start := time.Now() // Dag PUT operation which will return the CID for futher access or pinning etc. cid, err := sh.DagPut(entryJSON, "json", "cbor") elapsed := time.Since(start) if err != nil { fmt.Fprintf(os.Stderr, "error: %s", err) os.Exit(1) }