Installation


In order to have this project installed you have to meet following requirements:

  • php7.1
  • mysql5
  • composer installed
  • node v7 or later with npm

Installation steps

  1. Create database
  2. Download the project and navigate to the project root
  3. Copy .env.example file to .env and provide correct data for database access
  4. Run setup.sh - note: this will only launch correct commands in correct order
  5. Run php artisan serve if you don't have/want to install local web server

Deploy PBL test contract

In the repository we have "developer edition" of PBL contract and you need to deploy it if you want to interact with it. We used rinkeby testnet for our tests, so you can do the same or you can run your own node.

First, let's take a look at this file:

// resources/assets/js/config/index.js

export default {
    // IP address or hostname of your provider
    network: 'http://provider-ip:8545',

    // This will be the address of deployed PBL test contract
    pblContract: '0x2A16e83c2988826905C538be5d9Fdc87D2BF3dea',

    // This is the address of contracts deployer 
    // We have one particular account that will deploy contracts
    deployer: '0x2f0b91829b5862714805d8e1d49bc206acf8ef04',

    // Password to unlock the deployer account
    deployerPassword: 'qwerty12345',

    // Global setting for max gas value during transactions
    gas: 6500000,

    // Hardcoded conversion rate to represent USD value of PBL
    conversionRate: 0.2,

    // Used in Big Number calculation
    decimals: 10 ** 18
}

This is file with global settings we use in the project. We are well aware that password should not be here.

In order to deploy contract you need:

  1. Update config with correct provider address
  2. Create a deployer account and make sure it has ether, because deployer will pay for the contract deployment
  3. Update config with deployer address and password
  4. Now you can trigger app.__vue__.createPblContract() which will deploy PBL test contract
  5. Update config with deployed PBL test contract address
  6. Now to receive 1000 PBLs on your account in PBL test contract you can trigger app.__vue__.receivePbls() function

results matching ""

    No results matching ""