trustgraph / trustgraph-holochain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TrustAtoms allow content over 900 bytes, stored in "extra" entry

harlantwood opened this issue · comments

Feature

If content exceeds 900 bytes:

  • In the link tag: it ends with (unicode char) as a hint

  • Full content is stored in the extra Entry under the key __FULL_TRUST_ATOM_CONTENT__

      eg: extra is equal to
      { "__FULL_TRUST_ATOM_CONTENT__": "abcdefg....",  ... }
    
  • Validation error if user passes in extra hash with __FULL_TRUST_ATOM_CONTENT__ as top level key

      eg: if user sends us an extra hash with:
      { "__FULL_TRUST_ATOM_CONTENT__": "zzzzz....",  ... }
      and they also send content > 900 bytes: "aaaa..."
    

from discussion:

trustatom::create_trust_atom( 
  target: string version of EntryHash // TBH would be better to be more readable thing
  content: string // semantic
  value: number as string // scalar
  extra: { foo: "bar", bar2: "baz", baz2: 333 } // valid
  extra: { {foo: "bar"}, bar2: "baz", baz2: 333 } // invalid
  extra: [ "foo" ] // invalid
)