Platform Installation

Install the Enjin Platform package dependencies

  1. Your app will be located in /var/www/laravel/. Use the cd command to navigate to this folder:

    cd /var/www/laravel/
    
  2. We are now ready to install the required extensions, install them with this command:

    sudo apt-get update
    sudo apt install php8.2-{common,sqlite3,gmp,intl,mysql,bcmath,pcov,redis} 
    
  3. Check that Go is installed, and install it if not:

    go version
    
  4. If the above command doesn't return something like go version go1.18.1 linux/amd64 then proceed to install it with these commands (the following is from https://www.cyberciti.biz/faq/how-to-install-gol-ang-on-ubuntu-linux/).

    sudo apt update
    sudo apt upgrade
    sudo apt search golang-go
    sudo apt search gccgo-go
    sudo apt install golang-go
    

Install and configure the Enjin Platform Core package

  1. Delete the composer.lock file if it exists:

    rm composer.lock
    
  2. Edit the composer.json file using a tool like nano or vim and set the minimum-stability property to dev. If using nano you can save and quit with ctrl-x and then y followed by enter

  3. Run the composer require command from the root of your Laravel folder for each of the Enjin Platform packages you wish to install.

    📘

    Platform Packages

    In this guide, we are installing platform-core package only, this is the only required package.
    All other packages are optional.
    To install additional packages, check out the Installing Additional Platform Packages section

    composer require enjin/platform-core  
    
  4. Once the core package is installed, build the sr25519 plugin:

    cd vendor/gmajor/sr25519-bindings/go && go build -buildmode=c-shared -o sr25519.so . && mv sr25519.so ../src/Crypto/sr25519.so && chown $USER:www-data ../src/Crypto/sr25519.so && cd ../../../../
    
  5. Run the platform database migrations:

    php artisan migrate
    
  6. Add these variables to your .env file, the .env file is located in the root of the laravel folder and you can edit it with one of the built-in text editors such a nano:

    sudo nano .env
    

    The required variables are:

    AUTH_DRIVER=null  
    BASIC_AUTH_TOKEN=
    
    CHAIN=substrate  
    NETWORK=canary  
    DAEMON_ACCOUNT=
    
  7. You should set the BASIC_AUTH_TOKEN to a long random string, this will be your key to access the API from your services. You should also set the AUTH_DRIVER= var to basic_token.

  8. Set the NETWORK to either canary (for testnet) or enjin (for mainnet).

  9. If you wish to use the wallet daemon to sign transactions then you should set your wallet daemon account address in the DAEMON_ACCOUNT .env var.

📘

Continue with the installation

If you wish to use features such as Beam, Fuel Tanks, Marketplace, or UI, please continue to the Installing Additional Packages page.
If not, please continue to the Setting up the Decoder page.