Skip to content

Instantly share code, notes, and snippets.

View Gozala's full-sized avatar
😱
Oh well

Irakli Gozalishvili Gozala

😱
Oh well
View GitHub Profile
1) ipfs --upgrade-cidv0-in-output=true add --chunker=rabin-262141 --trickle=false --raw-leaves=false --cid-version=0 ../testdata/large_repeat_1GiB.zst
2) ipfs add --chunker=rabin-262141 --trickle=false --raw-leaves=false --cid-version=1 ../testdata/large_repeat_1GiB.zst
3) ipfs --upgrade-cidv0-in-output=true add --chunker=rabin-262141 --trickle=false --raw-leaves=true --cid-version=0 ../testdata/large_repeat_1GiB.zst
4) ipfs add --chunker=rabin-262141 --trickle=false --raw-leaves=true --cid-version=1 ../testdata/large_repeat_1GiB.zst
5) ipfs --upgrade-cidv0-in-output=true add --chunker=size-65535 --trickle=true --raw-leaves=false --cid-version=0 ../testdata/large_repeat_1GiB.zst
6) ipfs add --chunker=size-65535 --trickle=true --raw-leaves=false --cid-version=1 ../testdata/large_repeat_1GiB.zst
7) jsipfs add --chunker=size-65535 --trickle=true --raw-leaves=false --cid-version=1 ../testdata/large_repeat_1GiB.zst
8) ipfs --upgrade-cidv0-in-output=true add --chunker=size-262144 --trickle=true --raw-leaves=false -
@Gozala
Gozala / unixfs.ts
Created January 31, 2022 19:59
Attempt to define more clearly unixfs encoding
import type { CID } from 'multiformats'
/**
* Logical representation of a raw chunk of a file.
*
* TODO: Clarify when represenation is used instead of `FileChunk`
* representation.
*/
export interface Raw extends PBNode {
Data: ByteView<{
@Gozala
Gozala / api.v0.ts
Last active January 6, 2022 06:42
Sketch of unixfs-importer API
import type { CID} from "multiformats"
import { Mtime } from "ipfs-unixfs"
export interface Lib {
/**
* Creates a directory importer that can be used to build up directory of
* files. It takes an optional queuing strategy parameter that can be used
* to specify how how many blocks can be queue internally before backpressure
* is applied and writer is blocked. This allows users to specify how much
import { loop, recur } from './loop.js'
export const factorial = (n) => loop((n, acc) => n <= 1 ? acc : recur(n - 1, n * acc), n, 1)
/**
* @template T, X, A
* @typedef {import('./protocol').Process<T, X, A>} Process
*/
/**
* @template X, T
* @typedef {import('./protocol').Task<X, T>} Task
*/
interface CID {
code: number
version: number
multihash: Uint8Array
bytes: Uint8Array
}
type Future<T> =
| T
| Promise<T>
@Gozala
Gozala / Readme.md
Created April 2, 2020 19:08
Reproducible test case

This is illustrating issue with vscode

use async_std::task;
use juniper::{EmptyMutation, RootNode};
struct Concrete;
enum CustomName {
Concrete(Concrete),
}
#[juniper::graphql_object]
type Tag {
id:ID
name: String! @fake(type:word)
}
type InlineLink {
id:ID
to:Resource!
name:String @examples(values: ["automerge", "pushpin", "local-first", "farm"])
description:String @fake(type:words)
@Gozala
Gozala / hypermerge.ts
Created February 20, 2020 07:25
Attempt to revist hypermerge interface
type DocID<a> = string
type Doc<a> = a
interface RepoService {
keys: KeyService
create<a>(doc: Doc<a>): Promise<DocID<a>>
read<a>(id: DocID<a>): Promise<a>
change<a>(id: DocID<a>, change: (doc: a) => void): Promise<void>
watch<a>(id: DocID<a>): AsyncIterator<a>