Issues with committing MD structure

I am having trouble with committing random public md structures to the network and I am met with the error -103: Core error: Routing client error -> Requested data not found. To recreate go to safe://codeplay.discover and authorise, afterwards create a new random public md and use quicksetup to commit it to the network then retrieve the mdName of the structure and save it. Now refresh the page and authorise again but this time click on new public md and in the name field put in the mdname saved earlier with quotes and if you try to getversion or entries you are met with the error -103: Core error: Routing client error -> Requested data not found. I can confirm this is on both the latest browsers on linux with solus . Also you can access the md version and see the entries from quick setup before refreshing the page.

Another issue is the safe://codeplay.discover website isn’t able to upload files, when you try to create a NFS file you are met with TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.

How do you do this step ? Could it be that copying / pasting is messed up as these are not standard characters ? I suppose if you use a variable to store the name, or push it to localstorage, or use a deterministic way to recreate it ( hashing a known string for instance) it should work.

Maybe try : hash a string , for instance “mytestmut” , and use the hash to create a new public mutable instead of a random one. Then try the same after refreshing.

EDIT : darn ! sha3Hash example in the playground is not correct , it tries to print from ‘res’ ( remnants from previous promise based version ? ) maybe it should be :

    `async () => {
      try {
        hashedString = await window.safeCrypto.sha3Hash(appHandle, '1010101010101');
      } catch (err) {
        return err;
      }
      return `SHA3 Hash generated: ${String.fromCharCode.apply(null, new Uint8Array(hashedString))}`;
    }`

Using that, I manage to workaroud your issue and get consistent mutables names

EDIT 2 : localstorage works, too :

instead of copying / pasting the mutable name , edit getNameAndTag this way :

async () => {
      try {
        var nameAndTag = await window.safeMutableData.getNameAndTag(mdHandle);
        mdName = nameAndTag.name.buffer;
      } catch (err) {
        return err;
      }
      localStorage.setItem('mutname', nameAndTag.name.buffer);
    }

Then once you refresh the page, edit newPublic this way :

async () => {
      // name must be 32 bytes.
      // You can use safeCrypto.sha3Hash to generate a 32 byte hash based on the string you input

      let name = localStorage.getItem('mutname');
      try {
        mdHandle = await window.safeMutableData.newPublic(appHandle, name, 15001);
      } catch (err) {
        return err;
      }
      return `Returns handle to newly created or already existing, public, explicitly named Mutable Data structure: ${mdHandle}`;
    }

That way you don’t rely on copy /paste, and the 103 error disappears !

( jeez markdown is a pita with single quotes… I hope you can read it anyways )

5 Likes

This topic was automatically closed after 60 days. New replies are no longer allowed.