encointer / pallets

all application-specific pallets for encointer
GNU General Public License v3.0
19 stars 3 forks source link

enable community customization and branding #28

Closed brenzi closed 3 years ago

brenzi commented 3 years ago

Currently, our chain spec only allows to set bootstrappers, but name is ignored:

    "community_meta": {
        "name": "mediterranean test community",
        "bootstrappers": [
          "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
          "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
          "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y",
          "5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy",
          "5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw",
          "5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL"
        ]
    },

Moving towards mainnet, we want to allow branding. The app shall no longer show the human-unfriendly CommunityIdentifier and we want to allow customization

  1. name: a long name, like "Züri Leu"
  2. symbol abbreviation, like "LEU"
  3. icons a multi-resolution resource for the community icon
  4. theme an optional color scheme or other customizable styles to shape app appearance
  5. url a optional link to a community site
  6. demurrage_per_block: to override the default
  7. nominal_income: the amount of UBI to be paid out for every attended ceremony. to override the default

For icons, we could use the favicon format, like manifest.json

  "icons": [{
        "src": "<ipfs#>",
        "sizes": "64x64",
      }, {
        "src": "<ipfs#>",
        "sizes": "64x64"
      }, {
        "src": "<ipfs#>",
        "sizes": "128x128",
        "density": 2
      }],

TODO:

  1. extend extrinsic call to include above customizations
  2. offer sudo calls to change each field
  3. override nominal_income in pallet-encointer-ceremonies and demurrage_per_block in pallet-encointer-balances
  4. modify encointer/explorer to respect and show the new customizations (open new issue in other repo)
  5. modify encointer/encointer-wallet-flutter to respect and show the new customizations (open new issue in other repo)

see bazaarfor IPFS integration

clangenb commented 3 years ago

I suggest including all fields into a new CommunityMetadata struct, (maybe except for nominal_income and demurrage_per_block, as these are fetched regularly by the pallets. Doing so, we would save some decoding operations if we store them separately, which might be significant depending on the size of the icons, theme?).

Along this approach I would only offer the following sudo calls:

  1. update_community_metadata → supply an updated struct. Saves some boilerplate code in the pallets compared to offering a sudo call to change each field, and is of almost the same effort on the client side.
  2. update_demmurage
  3. update_nominal
clangenb commented 3 years ago

Estimate concerns only tasks 1.-3., without integration in explorer/app

clangenb commented 3 years ago

This was closed with #31