Skip to content

Instantly share code, notes, and snippets.

View ChamsBouzaiene's full-sized avatar
🎯
Focusing

Bouzaine Chamsddine ChamsBouzaiene

🎯
Focusing
  • FinCompare
  • Gemany, Hamburg
  • 16:50 (UTC -12:00)
  • X @shemsddine
View GitHub Profile
@ChamsBouzaiene
ChamsBouzaiene / file_bridge.js
Created October 23, 2020 23:35
download file from link and upload it to remote server
// load status span
let Status = document.getElementById("status");
// messages for status
const DOWN_START = "File is being downloaded ...";
const DOWN_SUCCESS = "File is downloaded ...";
const DOWN_FAIL = "File failed to download with : ";
const UPLOAD_START = "File is being Uploaded ";
const UPLOAD_SUCCESS = "File is Uploaded";
const UPLOAD_FAILD = "File failed to upload with : ";
// function to update status span
@ChamsBouzaiene
ChamsBouzaiene / truffle-config.js
Created October 6, 2019 23:07
truffle config for the ropsten blockchain
const HDWalletProvider = require("truffle-hdwallet-provider"); // npm i truffle-hdwallet-provider
const ROPSTEN_MNEMONIC =
"Input your seed phrase here";
const INFURA_API_KEY = "input your infura api Key here";
module.exports = {
networks: {
ropsten: {
@ChamsBouzaiene
ChamsBouzaiene / 2_public_migration.js
Last active October 6, 2019 23:04
Public Blockchain Migration file
var PublicQueue = artifacts.require("./PublicQueue.sol");
module.exports = function(deployer) {
deployer.deploy(PublicQueue);
};
@ChamsBouzaiene
ChamsBouzaiene / PublicQueue.sol
Created October 6, 2019 22:58
Public Blockchain Smart Contract
pragma solidity ^0.5.0;
contract PublicQueue {
struct Transaction {
address tFrom;
address tTo;
uint256 tValue;
}
@ChamsBouzaiene
ChamsBouzaiene / truffle-config.js
Last active October 6, 2019 22:49
truffle config for the ganache blockchain
const path = require("path");
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
develop: {
port: 8545
},
@ChamsBouzaiene
ChamsBouzaiene / 2_deploy_contracts.js
Created October 6, 2019 22:38
migration file for the private smart contract
var PrivateQueue = artifacts.require("./PrivateQueue.sol");
module.exports = function(deployer) {
deployer.deploy(PrivateQueue);
};
@ChamsBouzaiene
ChamsBouzaiene / PrivateQueue.sol
Created October 6, 2019 22:25
the private blockchain smart contract
pragma solidity ^0.5.0;
contract PrivateQueue {
struct Transaction {
address tFrom;
address tTo;
uint256 tValue;
}
struct Users {