Query Chainweb transfer events within a block range for a given chain.
Usage example:
CHAIN=1 MINHEIGHT=1420000 MAXHEIGHT=14201000 bash ./tranfers.sh
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# OPTIONS_GHC -fno-warn-orphans #-} | |
module Main (main) where | |
import Data.Mod (Mod) | |
import GHC.TypeNats (KnownNat) | |
import Numeric.Natural (Natural) |
# ############################################################################ # | |
# Base64 URL without padding | |
def base64dUrl: . | |
| gsub("(?<x>[-_])"; if .x == "-" then "+" else "/" end) | |
| "\(.)===" | |
| @base64d | |
; | |
def fromjson64: . |
{-# LANGUAGE DerivingVia #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeFamilies #-} |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE NumericUnderscores #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} | |
-- | | |
-- To reproduce with curl, run mainTls (from ghci) and use | |
-- | |
-- @ |
This gist contains benchmarks for read-only concurrent transaction that involve many shared variables. The test data is a mutable single-linked list where individual list "cells" are linked via mutable shared variables. The goal is to measure the overhead of different transaction types and variables in read-only transactions when there are no concurrent writes.
The input to a benchmark run is a list of a of successive Int
values.
The benchmark code runs a number of concurrent threads that each fold over the list and
each compute the sum of all entries. The list isn't mutated during the benchmarks.
{-# LANGUAGE ScopedTypeVariables #-} | |
module WrappedException | |
( main | |
) where | |
import Control.Concurrent | |
import Control.Exception (SomeAsyncException(..)) | |
import Control.Monad.Catch |
#!/bin/bash | |
# The Haskell packages cryptonite and blake2 both include a version | |
# of the C sources of the blake2 reference implementation. Linking | |
# both packages into the same Haskell binary can result in a broken | |
# binary that produces unsound results. | |
TDIR=$(mktemp -d "${TMPDIR:-/tmp/}$(basename $0).XXXXXXXXXXXX") | |
trap "{ rm -rf "$TDIR"; }" EXIT |
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE UnicodeSyntax #-} | |
-- | | |
-- Module: Main | |
-- Copyright: Copyright © 2018 Kadena LLC. |