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
- Create database
- Download the project and navigate to the project root
- Copy .env.example file to .env and provide correct data for database access
- Run setup.sh - note: this will only launch correct commands in correct order
- Run
php artisan serveif 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:
- Update config with correct provider address
- Create a deployer account and make sure it has ether, because deployer will pay for the contract deployment
- Update config with deployer address and password
- Now you can trigger
app.__vue__.createPblContract()which will deploy PBL test contract - Update config with deployed PBL test contract address
- Now to receive 1000 PBLs on your account in PBL test contract you can trigger
app.__vue__.receivePbls()function