Skip to content

Instantly share code, notes, and snippets.

View YazzyYaz's full-sized avatar
💭
Coding 💻

Yaz Khoury YazzyYaz

💭
Coding 💻
View GitHub Profile

Running a Validator

This section explains how to get a Validator node running on the network, using the same docker image used for running a full node.

Validators help secure the Celo network by participating in Celo’s Proof of Stake protocol. Validators are organized into Validator Groups, analogous to parties in representative democracies. A Validator Group is essentially an ordered list of Validators.

Just as anyone in a democracy can create their own political party, or seek to get selected to represent a party in an election, any Celo user can create a Validator group and add themselves to it, or set up a potential Validator and work to get an existing Validator group to include them.

While other Validator Groups will exist on the Celo Networks, the fastest way to get up and running with a Validator will be to register a Validator Group, register a Validator, and add that Validator to your Validator Group. The addresses used to register Validator Groups and Validators must be unique, which will req

@haferman
haferman / TLS-enable.txt
Last active December 9, 2021 01:35
steps to enable TLS for attestations
1. create DNS "A" record (link ip address with FQDN)
2. make sure port 443 is open
3. sudo apt install nginx
4. stop attestation-service (so we can get certificate on default port 80)
5. sudo systemctl start nginx
6. sudo systemctl enable nginx
7. https://certbot.eff.org/instructions?ws=nginx&os=ubuntubionic
(sudo snap install --classic certbot; sudo ln -s /snap/bin/certbot /usr/bin/certbot; sudo certbot --nginx)
8. sudo vi /etc/nginx/sites-available/default (doc root change to /dev/null so that http://ipaddress will fail)
9. attestation.config should point to new port (8080)
@haferman
haferman / celocli.txt
Created December 19, 2019 15:34
celo: celocli install for fresh Ubuntu 18.04 server
# install nodejs and dependencies
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash
sudo apt -y install gcc g++ make
sudo apt -y install nodejs
# install yarn
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
# check on node and npm versions (for me was 10.17.0 and 6.11.3)
SELECT
SUM (fees)
FROM (
SELECT
*,
eth * eth_price / 1e18 AS trade_volume,
eth * eth_price * 0.003 / 1e18 AS fees
FROM (
SELECT distinct
a.hash,
with
double_entry_book as (
select
array_to_string(outputs.addresses,',') as address,
value, block_timestamp
from `crypto-etl-bitcoin-prod.bitcoin_blockchain.transactions` join unnest(outputs) as outputs
union all
select
array_to_string(inputs.addresses,',') as address,
-value as value, block_timestamp
@sinclairtarget
sinclairtarget / bernoulli.c
Created August 17, 2018 20:22
Lovelace's Note G Program in C
#include <stdio.h>
/*
* Calculates what Ada Lovelace labeled "B7", which today we would call the 8th
* Bernoulli number.
*/
int main(int argc, char* argv[])
{
// ------------------------------------------------------------------------
// Data
Language Vehicle Reason
GoLang Tesla The future, but want somebody I know to buy one first
Haskell Batmobile Looks awesome but you'll never figure out how to drive it
Java Hummer Uses way more resources than is strictly necessary
Perl Classic Mini A classic that has influenced many cars, but not practical for 2015
PHP Fiat Multipla Ugly, nobody wants to be seen driving this
Ruby Smart Car Practical design. Will get you around the city fast, but not great on motorways
Python VW Golf Solid. Reliable. Middle of the road.
@garaud
garaud / sqlalchemy-orm-query-to-dataframe.py
Last active June 7, 2024 13:55
Example to turn your SQLAlchemy Query result object to a pandas DataFrame
# -*- coding: utf-8 -*-
"""From a Query.all(), turn this result to a pandas DataFrame
Table creation and example data come from the official SQLAlchemy ORM
tutorial at http://docs.sqlalchemy.org/en/latest/orm/tutorial.html
Just take a look at the 'query_to_dict' function and the last part of the __main__.
"""
@azmenak
azmenak / gulpfile.js
Last active April 24, 2017 21:35
Example Gulpfile for Jekyll
var options, paths,
gulp = require("gulp"),
merge = require("merge-stream"),
path = require("path"),
clean = require("gulp-clean"),
concat = require("gulp-concat"),
markdown = require("gulp-markdown"),
minifyCSS = require("gulp-minify-css"),
removeLines = require("gulp-remove-lines"),
@mschoebel
mschoebel / main.go
Created March 6, 2014 20:02
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling