# Create keys
drand generate-keypair --tls-disable --folder ~/.drand0 127.0.0.1:3000
drand generate-keypair --tls-disable --folder ~/.drand1 127.0.0.1:3100
drand generate-keypair --tls-disable --folder ~/.drand2 127.0.0.1:3200
# Start daemons
drand start --tls-disable --folder ~/.drand0 --private-listen 127.0.0.1:3000 --control 3001 --public-listen 127.0.0.1:3002
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import addr, { Address, newAddress } from '@glif/filecoin-address' | |
import { blake2b } from 'blakejs' | |
import varint from 'varint' | |
/** | |
* PayloadHashLength defines the hash length taken over addresses using the Actor and SECP256K1 protocols. | |
*/ | |
export const payloadHashLength = 20 | |
function addressHash (ingest: Uint8Array): Uint8Array { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Install deps with `npm i csv-parse @glif/filecoin-number` | |
// 2. Drop `balances.baseline.clean.out` and `balances.claus.clean.out` into the CWD | |
// 3. Run `node balances-to-json.js` | |
// 4. It'll create `balances.baseline.json` and `balances.claus.json` and `actors.json` in the CWD | |
const fs = require('fs') | |
const parse = require('csv-parse') | |
const { FilecoinNumber } = require('@glif/filecoin-number') | |
async function main () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Format a percentage according to some arbitrary rules that actually make it pleasing to look at. | |
// 100 -> 100 // whole numbers have no decimal | |
// 85.1543 -> 85.1 // it just truncates after first non-zero decimal | |
// 3.00345 -> 3.003 // leading zeros preserved before truncate | |
// 3.0000345 -> 3.00003 // ...up to a limit of 5dp | |
// 3.000001 -> 3 // ...so fractional numbers with 5+ leading zeros become an integer | |
function formatPercentage (num) { | |
const [int, frac] = num.toFixed(5).split('.') | |
const index = frac.split('').findIndex(n => n !== '0') | |
return index === -1 ? int : `${int}.${frac.slice(0, index + 1)}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# what even contexts do I have? | |
kubectl config get-contexts | |
# switch to other one | |
kubectl config use-context CONTEXT_NAME | |
# === | |
# for new or update existing cluster credentials: | |
# === |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name := "Unknown" | |
sc, ok := r.Client.(fmt.Stringer) | |
if ok { | |
name = sc.String() | |
} | |
oc.log.Info("optimizing_client", "thanks for the round", "client", name) |
https://access.redhat.com/solutions/30453
dmesg -wH
sysctl net.netfilter.nf_conntrack_max
net.netfilter.nf_conntrack_max = 196608
- Room Guardian
- bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
- IPFS blog
- bafybeifzcblbfi4nzmaq2ckaag63fufhkbfl7u3zqfkskmwjr3jsxtpyru
- XKCD
- QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm
- Project Apollo Archives
- QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
- https://awesome.ipfs.io/datasets/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import IPFS from 'ipfs' | |
export default class App extends Component { | |
constructor (props) { | |
super(props) | |
this.state = { | |
ready: false, | |
files: [], | |
fileName: '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... && go tool cover -html=coverage.txt |