Skip to content

Instantly share code, notes, and snippets.

View gentlyawesome's full-sized avatar
🏠
Working from home

Arc Angelo Ibalio gentlyawesome

🏠
Working from home
  • Philippines
View GitHub Profile
pragma solidity ^0.8.0;
contract MyContract {
// State variables
uint public myVariable;
// Events
event MyEvent(uint indexed value);
// Constructor
const CryptoJS = require('crypto-js');
// Create an array of data items
const data = ['data1', 'data2', 'data3', 'data4'];
// Function to generate Merkle tree
function generateMerkleTree(data) {
if (data.length === 0) return [];
if (data.length === 1) {
Root
|
-----------------------------------
| |
0x123 0x456
| |
------------------- -------------------
| | | |
"balance" "nonce" "storage" "code"
| | | |
const crypto = require('crypto');
function calculateMerkleRoot(transactions) {
if (transactions.length === 0) {
return null;
}
// Create a copy of the transactions array
let hashes = [...transactions];
const crypto = require('crypto');
// Block Header
const version = 1;
const previousBlockHash = 'ABC123';
const merkleRoot = 'XYZ789';
const timestamp = 1642931200;
let nonce = 0;
// Difficulty Target
const crypto = require('crypto');
// Transactions
const transactions = ['T1', 'T2', 'T3', 'T4', 'T5'];
// Merkle Root Calculation
function calculateMerkleRoot(transactions) {
if (transactions.length === 0) {
return null;
}
If your time does not permit the close supervision of your project then i am here for your help related with LAMP or LEMP Stack and others.
Contact Me For Engaged Your Works:
Telegram: https://t.me/LinuxGun
WhatsApp: https://wa.link/5ow7oz
#!/bin/bash
# This will remove Apache
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin
du -hsx -- * | sort -rh | head -10
#!usr/bin/python
"""
Sample python script to migrate documents from mongodb to apache couchdb database.
This script reads a document from mongodb and writes it to couchdb database.
**Script does not support the use case for 'documents with attachments'
"""
from bson import json_util, objectId
import json
from argparse import ArgumentParser
import requests
@gentlyawesome
gentlyawesome / docker-help.md
Created February 19, 2019 02:09 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info