Skip to content

Instantly share code, notes, and snippets.

import {WarpFactory, defaultCacheOptions, ArweaveGatewayBundledContractDefinitionLoader, ArweaveGatewayBundledInteractionLoader} from 'warp-contracts';
import Arweave from 'arweave';
const arweave = Arweave.init({
host: 'arweave.net',
port: 443,
protocol: 'https',
timeout: 200000
});
const arLoader = new ArweaveGatewayBundledInteractionLoader(arweave, 'mainnet');
@xiaojay
xiaojay / stamp.ts
Created May 23, 2023 03:03
gist used to get stamp contract from arweave gateway
import {WarpFactory, defaultCacheOptions,} from 'warp-contracts';
const contractId = 'TlqASNDLA1Uh8yFiH-BzR_1FDag4s735F3PoUFEv2Mo';
const warp = WarpFactory.forMainnet(defaultCacheOptions, true)
const stamp = warp.contract(contractId).setEvaluationOptions({
allowBigInt: true,
unsafeClient: "skip"
});
#!/usr/bin/env python3
import bitarray
from hashlib import blake2b
# POW Constants
BASE_EDGE_BITS = 24
PROOFSIZE = 42;
# https://github.com/mimblewimble/grin/blob/cccaf984936d4792f8b6c39e6b500ad2e3f08817/core/src/pow/types.rs#L314
--------------------------------------------
- Format 2 NVMe SSD Drives
--------------------------------------------
NOTE: NVMe SSD Drives are Ephemeral! Data will
survive hard and soft reboots, but not stop/start
cycles via the AWS Console.
sudo fdisk -l|more
sudo fdisk /dev/nvme0n1
n
p
@xiaojay
xiaojay / notes-medalla.md
Created August 6, 2020 04:29
Notes on setting up Eth2 clients for Medalla testnet (Prysm / Lighthouse / Teku / Nimbus / Lodestar)

Notes on setting up Eth2 clients for Medalla testnet (Prysm / Lighthouse / Teku / Nimbus / Lodestar)

PLEASE NOTE:

  • Prysm, Lighthouse, and Teku are attesting and proposing correctly following this guide
  • Nimbus currently has a glitch that it syncs the beacon chain well but can't post any attestations. An issue has been created: #1443
  • Lodestar also has a glitch that the beacon client hangs up and won't sync the beacon chain
  • This guide will be updated once these issues have been resolved

Using the launchpad

@xiaojay
xiaojay / BLS_Signature.md
Created May 6, 2020 02:24
BLS Signature for Busy People

BLS Signature for Busy People

Summary

  • BLS stands for

    • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve.
    • Boneh-Lynn-Shacham: A Signature Scheme.
  • Signature Aggregation

  • It is possible to verify n aggregate signatures on the same message with just 2 pairings instead of n+1.

@xiaojay
xiaojay / BLS_Signature.md
Created May 6, 2020 02:24
BLS Signature for Busy People

BLS Signature for Busy People

Summary

  • BLS stands for

    • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve.
    • Boneh-Lynn-Shacham: A Signature Scheme.
  • Signature Aggregation

  • It is possible to verify n aggregate signatures on the same message with just 2 pairings instead of n+1.

@xiaojay
xiaojay / namebase.py
Created February 20, 2020 12:04 — forked from jat001/namebase.py
Sell HNS automatically
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from decimal import Decimal
from datetime import datetime
try:
import requests
import simplejson as json
@xiaojay
xiaojay / server.js
Created June 1, 2019 07:17
log out http request
const http = require('http');
http.createServer((request, response) => {
const { headers, method, url } = request;
let body = [];
request.on('error', (err) => {
console.error(err);
}).on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
var cp = require('child_process')
i = cp.spawn('grin-wallet', ['init'])
i.stdout.on('data', function(data){
let output = data.toString()
console.log(output)
})