Skip to content

Instantly share code, notes, and snippets.

View RichardLitt's full-sized avatar

Richard Littauer RichardLitt

View GitHub Profile
function license {
echo "## License
[MIT](LICENSE)"
}
function contribute {
echo "
## Contribute
#!bin/sh
FILE="log/$(date +%Y-%m-%d).md"
echo "# $(date +%Y-%m-%d)\n" >> $FILE
cat "daily_routines.md" >> $FILE
echo "\n" >> $FILE
cat "todo.md" | head -5 >> $FILE
## TODO
# - [ ] Send anything from yesterday's ## Tomorrow section into the new day

Dynamic content in distributed applications

30mins

Description

At the heart of every application is a database. In the decentralized web, the peer-to-peer paradigm doesn't use servers, so how can we develop compelling applications and user experiences? This talk will demonstrate orbit-db, a distributed peer-to-peer database built on IPFS. We'll show how we can create traditional data models, such as a key-value store, in a distributed fashion and create applications without servers. We'll cover the underlying data structures and transport mechanisms provided by IPFS, take a look at CRDTs (Conflict-free Replicated Data Types) and show how they can be leveraged to create different types of databases. Using IPFS and orbit-db, we'll show examples of how to build news feeds, real-time chat and comment systems in distributed applications that can run purely in the browser.

Additional resources

orbit-db

orbit-db is a distributed, peer-to-peer database built on IPFS. By saving all data in IPFS and

var logLsCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "List the logging subsystems.",
ShortDescription: `
'ipfs log ls' is a utility command used to list the logging
subsystems of a running daemon.
`,
},
Run: func(req cmds.Request, res cmds.Response) {
output := strings.Join(logging.GetSubsystems(), "\n")
Verifying that +richlitt is my blockchain ID. https://onename.com/richlitt
/* Print out open cards from a given list */
function listCards (listName) {
return Promise.try(function () {
return getOpenLists()
}).filter(function (list) {
return list.name === listName
}).then(function (list) {
return t.getAsync('/1/lists/' + list[0].id, {cards: 'open'})
}).then(function (list) {
return Promise.map(list.cards, function (card) {
/* Print out open cards from a given list */
function listCards (listName) {
return Promise.try(function () {
return getOpenLists()
}).filter(function (list) {
return list.name === listName
}).then(function (list) {
return t.getAsync('/1/lists/' + list[0].id, {cards: 'open'})
}).spread(function (list.cards) {
// Here!
10:05 ~/src/ipfs-community 🐕 git co master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
10:05 ~/src/ipfs-community 🐕 git pull
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 2), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (11/11), done.
From github.com:ipfs/community
96a9229..34b44fe master -> origin/master
@RichardLitt
RichardLitt / gist:0b7072739d2ae46b9162
Created October 14, 2015 18:55
Returned undefined
function binSearch (dict, hunt) {
var len = dict.length
var half = Math.floor(len / 2)
if (len === 1) {
if (dict[0] === hunt) {
return hunt
} else {
return null
}

Keybase proof

I hereby claim:

  • I am RichardLitt on github.
  • I am richlitt (https://keybase.io/richlitt) on keybase.
  • I have a public key whose fingerprint is 1070 2CDC E1A8 61C8 4EC6 B5F1 4EA1 CEF2 3B01 6E42

To claim this, I am signing this object: