Skip to content

Instantly share code, notes, and snippets.

View pfrazee's full-sized avatar

Paul Frazee pfrazee

View GitHub Profile
[h1.0] { lo:
[h1.0] [ { address: '127.0.0.1',
[h1.0] netmask: '255.0.0.0',
[h1.0] family: 'IPv4',
[h1.0] mac: '00:00:00:00:00:00',
[h1.0] internal: true },
[h1.0] { address: '::1',
[h1.0] netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
[h1.0] family: 'IPv6',
[h1.0] mac: '00:00:00:00:00:00',
@pfrazee
pfrazee / userland-webdb.js
Created November 27, 2017 19:17
Example usage of a hypothetical new version of Ingest, which is renamed to WebDB and tweaked a little
import WebDB from 'dat://modules.beakerbrowser.com/webdb.1.0.0.js'
// setup
// ==
// create the database instance
const webdb = new WebDB()
// define our data model

If Rotonde were to switch to WebDB and to Beaker's format, wouldn't that 1. restrict Rotonde to Beaker's format; 2. force services to run in Beaker (cutting already working tools off the network)? I welcome Ingest, but... letting the browser dictate where and how social networks should store their data sounds wrong IMO.

I agree.

Regarding the tooling working outside the browser, you can use ingest directly in node, and we even have a neatly-packaged module for that: https://github.com/beakerbrowser/beaker-profiles-api (it's a little out of date compared to the spec but it'll be kept up to date -- it's what we use inside beaker). So, that shouldn't be a concern.

Rotonde doesn't have to use WebDB. We want yall to use Ingest or the files API directly if you're not interested in WebDB's schemas. The idea with WebDB is to reduce the learning curve and do some things which are otherwise hard to do right now: giving fine-grained permissions, sharing data between apps, enforcing compatibility, and so on. Web

Transferring your dats from one beaker to another

WARNING 1. If you do this, it MUST be either a transfer or a backup. Don't do this to run your Dats from two different computers. The Dat protocol doesn't support multiple computers running a Dat at the same time (yet) and you WILL corrupt your data.

WARNING 2. This will nuke the data in your new install.

WARNING 3. I havent actually tried this. Good luck!

If you're using Beaker 0.7.x, you'll need to copy part of your Beaker app data, and then your library folder (~/Sites).

Errmojis

Users have a hard time dealing with errors.

To solve that, put these emojis prominently in your error messages. Then when the user says:

I dont know what happened but I saw a christmas tree and then everything stopped working

You'll know it was an internal error!

My suggestion, feel free to make changes:

{
  intro: {
    title,
    summary,
    backgroundImage,
  },
  chapters: [{

Can we create a smart contract VM on nodejs using Dat?

Ethereum is a trustless network of VMs which run smart contracts submitted by users. It uses proof-of-work to synchronize state across the network, and has every node execute the contracts in order to verify the state's validity. Each transaction is stored in the blockchain for replayability. Read more about it here.

Ethereum's "trustless network" model has some disadvantages:

  • Transaction processing is slow - it maxes at roughly 25tx/s right now for all contracts combined.
  • Every transaction costs money to execute.
  • The entire blockchain state must be shared across the computing network.
  • No private transactions.
@pfrazee
pfrazee / index.html
Created July 13, 2017 22:25
Self-editing app in Beaker
<!doctype html>
<html>
<head>
<title>Self-editing app</title>
<style>
#textarea {
display: block;
width: 90vw;
height: 90vh;
}
<!doctype html>
<html>
<head>
<title>Webcell</title>
<link rel="stylesheet" href="table.css">
</head>
<body>
<table id="the-table"></table>
<script src="index.js"></script>
</body>