Skip to content

Instantly share code, notes, and snippets.

View segun's full-sized avatar

Olusegun Akintayo segun

  • HeyHaiVille
  • Digital Normad
  • 05:38 (UTC +01:00)
  • X @softhardguy
View GitHub Profile
@segun
segun / Mnesia Utils
Created September 3, 2014 23:17
Mnesia Add New Column In Production Environment Without Losing Data
%%%-------------------------------------------------------------------
%%% @author aardvocate
%%% @copyright (C) 2014, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 03. Sep 2014 11:02 PM
%%%-------------------------------------------------------------------
%%%
%%% This module provides a method will add new mnesia columns to an already running mnesia instance without losing data.
//Compiler version 1.8.0_111
import java.util.*;
import java.lang.*;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;
//TODO: Check logic for isPair.
//TODO: Implement is2Pairs
@segun
segun / PY0101EN-1-1-Types.ipynb
Created August 30, 2020 20:08
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@segun
segun / PY0101EN-1-2-Strings.ipynb
Created August 30, 2020 20:19
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Synopsis

On the d14n server, we have several services that is tied together. One of that is a gbc-crawler that crawls the Gnosis network for nodes and stores information like geo location, client name, client version etc.

Issue

The crawler finds about 1500 nodes (called discovered peers) but is only able to connect to 35. We need to find the reason why so many nodes (also called peers) are showing as offline.

TODO

Exercise 1: Use another lib asides the one used by gbc-crawler to get a list of connected node

We need to connect to the mongo-db instance and run a script on each peer to try and connect to it. Ideally all nodes should have a UDP port open and we should be able to just ping it. There's an example https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/devp2p/examples/simple.ts (in javascript) that tries to ping it's bootnodes. We can adapt this, for instance here's an adaption of that code, using Gnosis Chain boot nodes.