Skip to content

Instantly share code, notes, and snippets.

View ilyar's full-sized avatar
🖖
this is the way

ilyar

🖖
this is the way
View GitHub Profile
@ilyar
ilyar / forth.v
Created April 16, 2023 04:41 — forked from siraben/forth.v
Small-step operational semantics of Forth in Coq
Set Warnings "-notation-overridden,-parsing".
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.EqNat.
From Coq Require Import Init.Nat.
From Coq Require Import Lia.
From Coq Require Import Lists.List.
Import ListNotations.
From PLF Require Import Maps.
From PLF Require Import Smallstep.
Import Nat.
@ilyar
ilyar / how_to.txt
Created April 9, 2023 10:21 — forked from mnill/how_to.txt
// Запуск локального теснета с 6 валидаторами на одной машине, debian 11
// Лучше побольше цпу и диск от 200 гигабайт
// Зависимости
apt update
apt install jq build-essential git tmux
apt install libc6=2.31-13+deb11u4
apt-get install pkg-config libssl-dev libzstd-dev libclang-dev
apt-get install libgoogle-perftools-dev
// увеличиваем разрешенное количество открытых файлов/коннектов
Источник https://www.forth.org.ru/~ac/rationale/FORTH.TXT
Слово о Форте. Андрей Черезов ac@forth.org
Попытка формализации сути языка :) 29.07.1999
1. Форт-система
Традиционная форт-система состоит из двух частей: исполняющая среда (её
часто назвают VFM - виртуальная форт-машина) и транслятор. Транслятор
занимается поглощением исходных текстов программ (и что-то при этом
производит, о чем позже), VFM занимается выполнением программного кода.
{
"ABI version": 2,
"version": "2.3",
"header": ["pubkey", "time", "expire"],
"functions": [
{
"id": "0x00000000",
"name": "transfer",
"inputs": [
{
#!/usr/bin/env bash
std_lib() {
list=()
list+=('"SETCP0":"FF00"')
list+=('"ACCEPT":"F800"')
list+=('"THROW":"F22"')
list+=('"PUSHREF":"88"')
list+=('"SETCODE":"FB04"')
opcodes=$(printf ",%s" "${list[@]}")
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://raw.githubusercontent.com/tmorin/plantuml-libs/v9.4.4/distribution"
' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml
' loads the package bootstrap
include('domainstorytelling/bootstrap')
#!/usr/bin/env bash
slugSha256() {
slug=$(echo -n "$1" | sha256sum | cut -d' ' -f1)
echo -n $((16#"${slug:0:8}"))
}
functionHash() {
hash=$(slugSha256 "$(echo -n "$1" | sed 's/ //g')")
if [[ "$1" == *constructor* ]] || [[ "$1" == *cell* ]] || [[ "$1" == *bytes* ]]; then
#!/usr/bin/env ts-node
import { createHash } from 'crypto'
function slugSha256(data: string): number {
return Number(`0x${createHash('sha256').update(data).digest('hex').slice(0, 8)}`)
}
function functionHash(signature: string): number {
let hash = slugSha256(signature.replaceAll(' ', ''))
// FIXME for constructor, cell, bytes see https://gist.github.com/ilyar/484360bdb5464a6f252bd8f8ec10aaff
#!/usr/bin/env node
'use strict'
const { createHash } = require('crypto')
function slugSha256(data) {
return Number(`0x${createHash('sha256').update(data).digest('hex').slice(0, 8)}`)
}
function functionHash(signature) {