Skip to content

Instantly share code, notes, and snippets.

View sudo-vaibhav's full-sized avatar
🤖
Yes, my bio is auto-updated

Vaibhav Chopra sudo-vaibhav

🤖
Yes, my bio is auto-updated
View GitHub Profile
import { Player } from "@lottiefiles/react-lottie-player";
import { useWindowWidth } from "@react-hook/window-size";
import { mdBreakpoint } from "../../constants";
const Container = ({
children,
className = "",
preset,
}: {
left?: number;
import fetch from "isomorphic-fetch"
const gap = 60 * 1000
const username = "19BCE0932"
const password = "passwordHere"
const login = async () => {
const resp = await fetch("http://phc.prontonetworks.com/cgi-bin/authlogin?URI=http://nmcheck.gnome.org/", {
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
My address : 0x93a8ba9652a4dbf28709a15e58378828d54feaee
Recepient address : 0xd86518b29bb52a5dac5991eacf09481ce4b0710d
@sudo-vaibhav
sudo-vaibhav / app.js
Created July 12, 2020 09:27
blockchain code
//setup for the server and other third party node modules
const port = process.env.PORT || 3000
const express = require("express")
const app = express()
// this will allow cross-domain access
const cors = require("cors")
app.use(cors())
//for parsing json content in requests
@sudo-vaibhav
sudo-vaibhav / app.js
Last active July 12, 2020 09:27
setting up blockchain constants
const THIRTY_MINUTES = 30 * 60 * 1000 //the consensus algorithm runs every 30 minutes
const INITIAL_BALANCE = 50 //this is the initial amount that any node starts with
const STAKE_AMOUNT = 10 //this is the amount that's staked by default to make a proposal
const REWARD_AMOUNT = 15 //you get 5 more Reputation Tokens that what you staked
const PENALIZED_AMOUNT = 5 //you lose 5 Reputation Tokens if your contribution is not approved by the majority of nodes
const CONSENSUS_THRESHOLD = 0.5 //more than 50% of nodes have to approve your contribution to get the reward