Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-13777

Fix private data tutorial instructions for base64

    XMLWordPrintable

Details

    • Documentation
    • Status: Closed
    • Medium
    • Resolution: Done
    • None
    • v2.0.0, v1.4.1
    • fabric-docs
    • None

    Description

      Private data tutorial instructions:

      export MARBLE=$(echo -n "{\"name\":\"marble1\",\"color\":\"blue\",\"size\":35,\"owner\":\"tom\",\"price\":99}" | base64)

      fails on linux with error:

      Error: error parsing transient string: invalid character '\n' in string literal - proposal response: <nil>

      Reason is because base64 command on linux adds a problematic newline character to wrap after every 76 characters.

      To fix this you can use

      -w 0

      to eliminate the wrapping.

      However -w option is not available in Alpine, therefore we will manually remove any existing newline characters, this will work across all platforms:

      export MARBLE=$(echo -n "{\"name\":\"marble1\",\"color\":\"blue\",\"size\":35,\"owner\":\"tom\",\"price\":99}" | base64 | tr -d \\n)

      Thanks to tip at: https://superuser.com/a/1225334

      Attachments

        Issue Links

          Activity

            People

              denyeart David Enyeart
              denyeart David Enyeart
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: