Setting up a new platform

1. Generate platform's account secret

Generate a keypair for the new platform (for example, here).

2. Create platform account

Send POST request to horizon-url/platforms in order to create new platform account. Put the public key from previous step into the field id and secret key of the master account into field seed

Field Description
id required: account id of the platform
seed required: secret key of the master account
first_name UTF-8 string (up to 30 symbols)
last_name UTF-8 string (up to 30 symbols)
email email to display as contact information
phone_number phone number in an international format (e.g. +380991234567)
avatar_link link to account's avatar
country ISO 3166-1 Alpha 3 country code
city UTF-8 string (up to 30 symbols)
address UTF-8 string (up to 100 symbols)
company UTF-8 string (up to 30 symbols)

Example:
POST horizon-url/platforms

{
    "data": {
        "type": "accounts",
        "id": "GDMP2R4KSZHGOVC7LR5J7ITPJHD3W3C7635RQRSF5KFCCZHNIXZWRQSP",
        "attributes": {
          "seed": "SDWJEVODNGKWIIDU7TBEKAGXJXIBEH4P4TRDWK7TSGIV6P5SMHVVOYT7",
          "first_name" : "Name to display",
          "last_name" : "",
          "avatar_link": "https://avatar.link",
          "email" : "email@todisplay.com",
          "phone_number": "+380951234567",
          "country": "UKR",
          "city": "Kharkiv",
          "address" : "Address",
          "company": "Company name"
        }
    }
}

3. Update horizon config

Add platform's secret key from the first step to HORIZON_PLATFORMS environment variable and restart horizon.

Refer to horizon documentation for description of config env vars.

4. Create admin account

Send local request (i.e. not through api-gateway) to horizon-url/accounts
Put public key from step 1 into platform_id.

Example: POST horizon-url/accounts

{
    "data": {
        "type": "accounts",
        "attributes": {
            "account_type": "admin",
            "password": "aa8f965dg",
            "platform_id": "GDMP2R4KSZHGOVC7LR5J7ITPJHD3W3C7635RQRSF5KFCCZHNIXZWRQSP",
            "locale": "en",
            "currency": "USD",
            "first_name": "Admin",
            "last_name": "Admin",
            "avatar_link": "https://avatar.link",
            "email": "admin@email.com",
            "phone_number": "+380951234568"
        }
    }
}

results matching ""

    No results matching ""