Payment Gateway

Installation

Github

If you do not have a GitHub account sign up for one here.

create a new repository using this guide

Once you have done this simply add it as a remote

git remote add <youroriginname> <githuburl>

Clone

clone the BuildingBlock management portal onto your local machine.

git clone https://github.com/OrbitLabsDAO/buildingblocksreporting.git

then run the following 2 commands

npm install --save-dev @11ty/eleventy

npm install

This will set up the BuildingBlock management portal locally on your machine.

finally push it to the repo you set up earlier

git push github master

Cloudflare

If you do not yet have a Cloudflare account please sign up by clicking on this link.

Click Pages from the menu on the left.

Once you are there you can use the following guide to connect your git and add the project you just pushed.

Select 11.ty as the framework as shown in the image below

then add the ENV vars by going clicking on pages/buildingblocks/settings/environment variables and adding them as shown in the screenshot below

Wrangler

The next thing you need to do is install Wrangler. You can find the current documentation for this here.

D1 database

D1 is the Cloudflare database that we are using you can find out more information about it here.

click on workers/d1 and create a new database as shown in the image below

then we have to add it to add a D1 database binding called DB and point it to the D1 database you created as shown below

The last thing we have to do is run the SQL file to create the tables

wrangler d1 execute DB --local --file=./scripts/sql/schema.sql
sudo wrangler d1 execute DB --file=./scripts/sql/schema.sql

Create environment variables

We have to rename two files at the root of the project. These files contain the following environment variables.

_.env

_.dev.vars

to

.env

.dev.vars

Both of these files are the same but for some reason, Cloudflare decided not to use the industry standard .env for their functions so we have to replicate it to get it working locally. In production, we only have one set of environment variables.

ADMINURL=http://localhost:8790/

APIKEY=youstupididiot

APIURL=http://localhost:8790/api/

BNBBLOCKEXPLORERMAIN=https://testnet.bscscan.com

BNBBLOCKEXPLORERTEST=https://testnet.bscscan.com

BNBCHAINIDMAIN=0x38

BNBCHAINIDTEST=0x61

BNBRPCURLMAIN=https://bsc-dataseed.binance.org

BNBRPCURLTEST=https://data-seed-prebsc-1-s1.binance.org:8545/

BTCBACKUPADDRESSMAIN=bc1qxphczudn8retcx0umz3pf2xuwpaxwmeslwugvm

BTCBACKUPADDRESSTEST=tb1qtted8h90555x2jd53992kxa6rm5y7u2et2l47x

BTCBLOCKEXPLORERMAIN=https://blockstream.info/api/

BTCBLOCKEXPLORERTEST=https://blockstream.info/testnet/api/

CANCREATEACCOUNT=0

CHAINLINKMAINBNB=0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE

CHAINLINKMAINBTC=0x264990fbd0A4796A3E3d8E37C4d5F87a3aCa5Ebf

CHAINLINKMAINETH=0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e

CHAINLINKTESTBNB=0x2514895c72f50D8bd4B4F9b1110F0D6bD2c97526

CHAINLINKTESTBTC=0x5741306c21795FdCBb9b265Ea0255F499DFe515C

CHAINLINKTESTETH=0x143db3CEEfbdfe5631aDD3E50f7614B6ba708BA7

COMPLEXPASSWORD=0

CRYPTOADDRESS=0x960f470cE20Bfb519facA30b770474BBCdF78ef8

CRYPTOSALT=fdsfhsjdfhsdufysdufyu8ewyfefwefe

ETHBLOCKEXPLORERMAIN=https://etherscan.io/

ETHBLOCKEXPLORERTEST=https://goerli.etherscan.io/

ETHCHAINIDMAIN=0x1

ETHCHAINIDTEST=0x5

ETHRPCURLMAIN=https://mainnet.infura.io/v3/400059507a104c01a86fe57ac4543ed4

ETHRPCURLTEST=https://goerli.infura.io/v3/400059507a104c01a86fe57ac4543ed4

NETWORK=testnet

SECRET=974this is the stupid secret that no will ever be able to guess344342!

XPUBMAINNET=xpub67yMUMbr2gAnBgnYvXcbJq8iUBe54Ev2dbUYKGN8jGY21AHJFeR7mnZqhbUNze4UbpRE9S1fWvmFCsFN4EvU1rWdqegW7dzoa7vZmYCLAAy

XPUBTESTNET=xpub69hLknP5tX11wPwujsEGF4YYKDtn5sAQoNv337CsWP8CuYMqjVDAEiUAnVRENbRS6ssN6uYtjSm8iVKRorpmmvceqQmK5H5y6y7ficWV2xe

Run it

run the command

`./build.sh

open a browser and go to the following URL and login in with the following details

test@orbitlabs.xyz

test

cypress testing

It comes with a full test suite that you can access by running the following command

./build.sh cypress

Production

Pushing the site to production requires a few more steps the first thing you have to do is push the project to your GitHub account if you make any code changes is easy just push

git push origin master and it will update it on Cloudflare for you