Skip to content

Instantly share code, notes, and snippets.

View tchardin's full-sized avatar

tdot tchardin

View GitHub Profile
@tchardin
tchardin / RetrievalMarketCodingChallenge.md
Last active August 11, 2021 09:34
Retrieval Market Coding Challenge

Instructions

There is no right or wrong answer. Solutions should be well documented and explain every architecture decisions made along the way. Code should be written as a proof of concept demonstrating the core idea behind the solution to the problem. You may structure it as a module with a unit test or create a CLI to interact with it. If you are stuck of cannot find any satisfying solutions, you may write in details about all the possible solutions you tried and why they didn't work. You may also show your solution to any other dev to receive feedback before submitting it.

Context

In a content delivery market, clients pay providers to retrieve content from their point of presence. Content is broken down into blocks formatted as merkle DAGs. Each block is represented by its content identifier (CID) made from the hash of the block and blocks can link to other blocks i.e. if a file is split into 4 chunks, the root block of a file can link to all its chunks.

In the market, clients query the network w

@tchardin
tchardin / Challenges.md
Last active June 26, 2021 12:38
A list of thought/coding exercises in the decentralized storage world

Decentralized Storage Coding Challenges

There is no right or wrong answer. Solutions should be well documented and explain every architecture decisions made along the way. Code should be written as a proof of concept demonstrating the core idea behind the solution to the problem. You may structure it as a module with a unit test or create a CLI to interact with it. If you are stuck of cannot find any satisfying solutions, you may write in details about all the possible solutions you tried and why they didn't work. You may also show your solution to any other dev to receive feedback before submitting it.

Problem 1:

A Filecoin storage miner can store a minimum size of 1GB of data in a single storage deal. Using golang, implement a module with the following features:

  • I can insert new content represented by an identifier (CID) and an associated int64 byte size.
  • The module takes a callback function, keeps track of the content and if the total size is
@tchardin
tchardin / architecture.md
Last active April 27, 2021 13:39
Myel Architecture Overview

Myel Technical Update

Yesterday we presented a technical overview of our approach building Myel point of presence nodes at a Filecoin builders mini summit. Here is a recap of what we shared during the presentation.

Context

The goal of Myel is to be the CDN for decentralized storage networks. At the core our system is a network of points of presence (PoP) that run data exchanges (formerly known as Hop exchange) and allow any individuals to publish content and provide bandwidth and fast storage to the network against financial incentives. We started out building an IPFS plugin to run with any IPFS node however we realized this would require some upgrades to the current IPFS implementation that may not be available until later this year. Instead of waiting, we are releasing a standalone PoP node that remains fully compatible with IPFS but can run independently. PoP nodes provide a very simple interface to publish and retrieve content from cache providers. In the following sections, I will go over this in

@tchardin
tchardin / chained.go
Last active April 16, 2021 20:27
Chained options
var session = NewSession(
WithTriageEnabled(),
WithBounds(56000, 50000),
)
// Or...
ses := NewSession().
WithTriageEnabled().
@tchardin
tchardin / session.go
Created April 15, 2021 21:14
Example Storage API
type Options struct {
File string
String string
}
func (s *Storage) Put(key string, opts Options) error
// Or:
// A BitCurve represents a Koblitz Curve with a=0.
// See http://www.hyperelliptic.org/EFD/g1p/auto-shortw.html
type BitCurve struct {
P *big.Int // the order of the underlying field
N *big.Int // the order of the base point
B *big.Int // the constant of the BitCurve equation
Gx, Gy *big.Int // (x,y) of the base point
BitSize int // the size of the underlying field
}
@tchardin
tchardin / machine.js
Last active April 17, 2020 20:09
Generated by XState Viz: https://xstate.js.org/viz
const CHART = 'cic';
const HISTORY = 'backToPrevStep';
// states
const LIFE_CHANGE_INTRO = 'lifeChangeIntro';
const MANAGE_COVERAGE_INTRO = 'manageCoverageIntro';
const ADD_MEMBER_REASON = 'addMemberReason';
const REMOVE_MEMBER_REASON = 'removeMemberReason';
const CHANGE_SELECTION = 'changeSelection';
const ADDRESS_ENTRY = 'addressEntry';
@tchardin
tchardin / machine.js
Created March 31, 2020 15:56
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tchardin
tchardin / machine.js
Last active August 21, 2019 16:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
var users = {
tchardin: {...},
...
}
var user1 = users[Object.keys(users)[0]]