sudo apt remove gstreamer1.0-vaapi
- launch an ec2 instance
- visit security
- click on launch wizard 1
- edit security group and add an inbound rule
- select type http with port 80 and select source as anywhere (0.0.0.0/0)
- open your computer's terminal
- locate your instance private key
- connect using this command
sudo ssh -i "privateKey.pem" instance.compute-1.amazonaws.com
- copy and paste ssh-keygen on your local machine
- ssh root@your_server_ip
- adduser sammy
- usermod -aG sudo sammy - setup root privileges for the user
- ufw app list - setup a basic filewall
- ufw allow OpenSSH - setup a basic filewall
- ufw enable - setup a basic filewall
- copy and paste ssh-keygen on your local machine
- ssh root@your_server_ip
- adduser sammy
- usermod -aG sudo sammy - setup root privileges for the user
- ufw app list - setup a basic filewall
- ufw allow OpenSSH - setup a basic filewall
- ufw enable - setup a basic filewall
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pragma solidity ^0.5.16; | |
pragma solidity >=0.4.22 <0.9.0; | |
/** | |
NOTE VERSION SPECIFIED SHOULD BE THE SAME SPECIFIED IN truffle-config.js | |
*/ | |
interface CourierInterface{ | |
function startItemTranpost(string calldata _sku) external; | |
function getItemStatus(uint256 itemD) external view returns(string memory status); | |
function getItemLocation(uint256 itemID) external view returns(string memory location); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BCShopCourier = artifacts.require('./BCShopCourier.sol') | |
require('chai') | |
.use(require('chai-as-promised')) | |
.should() | |
contract('BCShopCourier', ([deployer,account1,account2,account3]) => { | |
let contract | |
before(async ()=>{ | |
contract = await BCShopCourier.deployed() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.9.0; | |
import './BCShopCourier.sol'; | |
interface SellerInterface{ | |
function addSale(uint256 productID) external; | |
function buyerReceiveProduct(uint256 saleID)external; | |
function getProductPrice(uint256 productID) external view returns(uint256 price); | |
function getSaleStatus(uint256 saleID) external view returns(string memory status); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BCShopCourier = artifacts.require("BCShopCourier"); | |
const BCShopSeller = artifacts.require("BCShopSeller"); | |
const BCShopBuyer = artifacts.require("BCShopSeller"); | |
module.exports = async(deployer) => { | |
let deployBCShopCourier = await deployer.deploy(BCShopCourier) | |
.then(async(courier) => { | |
// console.log(data) | |
let deployBCShopSeller = await deployer.deploy(BCShopSeller, courier.address) | |
.then(async(seller) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.9.0; | |
import './BCShopSeller.sol'; | |
import './BCShopCourier.sol'; | |
contract BCShopBuyer { | |
address payable sellerAddress; | |
SellerInterface SellerContract; | |
CourierInterface CourierContract; | |
constructor(address payable _sellerAddress, address courierAddress) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from functools import reduce | |
class Calculator: | |
def __init__(self): | |
pass | |
def __str__(self): | |
return "Basic calculator" | |