Skip to content

Configuration

Mikhail Mikheev edited this page Jun 21, 2018 · 10 revisions

Configuring the Interface

Inside the /config/environments folder you can find all different environments that can be built with the pm-trading-ui. You can easily add your own here, which will be merged with the base configurations (/config/config.json, /config/interface.config.json).

Don't make changes to config/config.json or config/interface.config.json, instead create your own environments and pass GNOSIS_ENV as an env variable to set the environment that should be used.

App Config

Inside the config.json you set configuration variables for the application, like the gnosis connection and which market creators you allow on your platform:

pm-trading-db

Defines which connection should be used to communicate with the PM-Trading-DB. You only need Read Access to use the Database with the the management interface, as it's only purpose is to synchronize previous blocks of interactions with prediction markets, with the interface.

{
  ...
  "gnosisdb": {
    "protocol": "https",
    "host": "localhost",
    "port": 443
  }
  ...
}

ethereum

Defines the Ethereum Node that should be used for all providers (Metamask, uPort, etc). This basically defines the network you want to use.

{
  ...
  "ethereum": {
    "protocol": "https",
    "host": "rinkeby.infura.io",
    "port": 443
  }
  ...
}

whitelist

Whitelist defines which accounts you want to allow as market creators. We currently limit the interface by only allowing markets from specified addresses.

{
  ...
  "whitelist": {
    "0x123": "John Foo"
  }
  ...
}

hiddenMarkets

hiddenMarkets allows you to provide an array of markets' addresses you want to hide. Markets' addresses should be in lower case.

{
  ...
  "hiddenMarkets": ["0x9e1008ff1b30b871701e5527fc4efe339cf96abc", "0x23effcde33bd3100ca038f56ccda0a0c695439da"]
  ...
}

Interface Config

To configure different features and to enable the tournament mode, you need to configure the interface config based upon /config/config.interface.json

logo

Defines the logos used in the interface.

{
  ...
  "logo": {
    "regular": "assets/img/defaultSizeLogo.png",
    "small": "assets/img/smallSizeLogo.png",
    "favicon": "assets/img/favicon.png",
  }
  ...
}

tournament

Defines tournament settings and enables/disables the tournament mode.

{
  ...
  "tournament": {
    "enabled": true,
    "name": "My Tournament Name",
    "registration": {
      "enabled": true,
      "contractAddress": "0x79da1c9ef6bf6bc64e66f8abffddc1a093e50f13"
    }
  }
}
  • tournament.registration.contractAddress refers to the registration contract that should be used, when the user uses a provider (Metamask, Hardware Wallets) without user verification. This Contract will pair users from your tournaments network with their mainnet addresses, providing a layer of verification.

collateralToken

Defines the ERC20 token that should be used for the platform. Please note that gas payments are still in ETH (unwrapped) and will be required by your users to interact with the platform

{
  ...
  "collateralToken": {
    "address": "0x123",
    "icon": "assets/img/myTokenImage.png"
  }
  ...
}

providers

Defines the provider settings and allows setting custom options for each of the providers. Providers are wallets, ledgers and certain browsers. Basically 3rd Party Software that allows interaction with the ethereum network.

{
  ...
  "providers": {
    "default": "METAMASK",
    "options": {
      "UPORT": {
        "appName": "Your Tournamet Name",
        "clientId": "yourClientId",
        "network": "rinkeby",
        "privateKey": "yourPrivateKey",
        "useNotifications": false
      }
    }
  }
  ...
}
  • providers.default specifies the default provider your interface should expect. This provider will be used to tell users which wallet to get in order to interact with the platform and will always be prefered if multiple providers are available.
  • providers.options.UPORT.appName is the name that will show up in the uPort App when interacting with your platform.
  • providers.options.UPORT.useNotifications enables uPorts Push Notification System, it will send a push notification to the users Phone instead of requiring the user to scan a QRCode. Please see https://uport.me for me information regarding uPort.

scoreboard

The scoreboard shows users in a competition style layout on who has the best predictions. This needs to be setup with PM-Trading-DB.

{
  ...
  "scoreboard": {
    "enabled": true
  }
  ...
}

gameGuide

You can use our default gameguide from Olympia as a starter, or link your own website here, to introduce your users to how your platform works.

{
  ...
  "gameGuide": {
    "enabled": true,
    "type": "default",
    "url": "https://example.org"
  }
  ...
}
  • gameGuide.type allows link to link to an external website specified as gameGuide.url and default to enable the Olympia Tournament Gameguide, written by us.

termsOfUse

Allows you to customize the terms of use. These can obviously not be disabled.

{
  ...
  "termsOfUse": {
    "url": "https://linkToExternalSite"
  }
  ...
}

footer

Change the Footer Element on the website.

{
  ...
  "footer": {
    "enabled": true,
    "content": {
      "type": "text",
      "source": "Powered by Gnosis",
      "markdown": true
    }
  }
  ...
}
  • footer.content.type allows:
    • text to write your own footer content inline
    • file to use the file in src/components/Footer/footerText.txt to customize the text

rewards

Enables the reward system to show the user which reward he can get based on his correct predictions.

{
  ...
  "rewards": {
    "enabled": true,
    "rewardToken": {
      "symbol": "RWD",
      "contractAddress": "0x123",
      "networkId": 3
    },
    "claimReward": {
      "claimStart": "2018-04-01T12:00:00",
      "claimUntil": "2018-05-01T12:00:00",
      "contractAddress": "0x123",
      "networkId": 3
    },
    "levels": [
      { "value": 5, "minRank": 1, "maxRank": 1 },
      { "value": 4, "minRank": 2, "maxRank": 2 },
      { "value": 3, "minRank": 3, "maxRank": 3 },
      { "value": 2, "minRank": 4, "maxRank": 4 },
      { "value": 1, "minRank": 5, "maxRank": 5 },
      { "value": 0.9, "minRank": 6, "maxRank": 7 },
      { "value": 0.8, "minRank": 8, "maxRank": 9 },
      { "value": 0.7, "minRank": 10, "maxRank": 11 },
      { "value": 0.6, "minRank": 12, "maxRank": 13 },
      { "value": 0.5, "minRank": 14, "maxRank": 15 },
      { "value": 0.4, "minRank": 16, "maxRank": 17 },
      { "value": 0.3, "minRank": 18, "maxRank": 19 },
      { "value": 0.2, "minRank": 19, "maxRank": 34 },
      { "value": 0.1, "minRank": 34, "maxRank": 100 }
    ]
  },
  ...
}
  • reward.rewardToken defines the ERC20 token that will be used as a reward. You can chose on which network this token will be received using the network option. 3 is Rinkeby.
  • reward.claimReward defines at which time the reward claiming (basically when the tournament ends) will start and how long users have to claim their rewards, until it vanishes. The contract that must be specified here must be implemented according to RewardClaimHandler.sol and the times/dates must be hardcoded in your own contract!
  • reward.levels specify the reward levels you allow on your platform. In this example a total of 30 RWD will be given to the users. You can specify ranged by using minRank and maxRank as inclusive ranges in which the user is eligible for this rewards .value.

badges

Badges are symbols shown in the Header Section of the site and add gamification. The badges are obtained by making predictions on the markets. Example here is used in Olympia

{
  ...
  "badges": {
    "enabled": true,
    "ranks": [
      {
        "icon": "components/Dashboard/Metrics/assets/badges/junior-predictor.svg",
        "rank": "Junior Predictor",
        "minPredictions": 0,
        "maxPredictions": 4
      },
      {
        "icon": "components/Dashboard/Metrics/assets/badges/crystal-gazer.svg",
        "rank": "Crystal Gazer",
        "minPredictions": 5,
        "maxPredictions": 9
      },
      {
        "icon": "components/Dashboard/Metrics/assets/badges/fortune-teller.svg",
        "rank": "Fortune Teller",
        "minPredictions": 10,
        "maxPredictions": 14
      },
      {
        "icon": "components/Dashboard/Metrics/assets/badges/clairvoyant.svg",
        "rank": "Clairvoyant",
        "minPredictions": 15,
        "maxPredictions": 19
      },
      {
        "icon": "components/Dashboard/Metrics/assets/badges/psychic.svg",
        "rank": "Psychic",
        "minPredictions": 20
      }
    ]
  }
  ...
}
  • ranks[...].icon defines the image used to display this badge.
  • ranks[...].rank defines the rank that is associated with this badge.

Clone this wiki locally