Skip to content

Instantly share code, notes, and snippets.

View Warchant's full-sized avatar
🐻
Rust go brrr

Bohdan Warchant

🐻
Rust go brrr
View GitHub Profile
include "key.fbs";
include "primitives.fbs";
include "asset.fbs";
namespace iroha;
table Account {
pubKey: PublicKey (required); // primary key for account
alias: string;
@Warchant
Warchant / case.py
Created April 10, 2017 00:39
merkle tree test case
import sha3
import hashlib
def h(s):
return hashlib.sha3_256(s).digest()
# a tree with 4 leafs
d = [0] * (4*2-1)
# store 8 roots for 8 pushes
@Warchant
Warchant / custom_network.yml
Created April 23, 2017 13:32
Docker recipes
version: '3'
services:
oracle:
image: alexeiled/docker-oracle-xe-11g
container_name: oracle
hostname: oracle
dns_search: 188.130.155.34
privileged: true
shm_size: 2g
################################
# libuv #
################################
ExternalProject_Add(libuv_libuv
GIT_REPOSITORY "https://github.com/libuv/libuv.git"
CONFIGURE_COMMAND ./autogen.sh && ./configure
BUILD_IN_SOURCE 1
BUILD_COMMAND $(MAKE)
INSTALL_COMMAND "" # remove install step
TEST_COMMAND "" # remove test step
@Warchant
Warchant / genconfig.sh
Last active August 28, 2017 13:49
Start OpenVPN server using docker painlessly
#!/bin/sh
if [ -z "$1" ]; then
echo "Provide 1 argument: name of the client"
exit 1
fi
name=$1
docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full $name nopass
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient $1 > $1.ovpn
@Warchant
Warchant / sonarqube-docker-compose.yml
Last active June 30, 2025 15:13
docker-compose file to setup production-ready sonarqube
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:

Proposal for smart contracts in iroha

author: Bohdan Vanieiev

According to the list of commands and queries implemented in iroha current design of commands and queries is not good, because:

  1. It lacks low level commands, which allow to build arbitrary programs, required for proper smart contracts implementation. In other words, the system has only high-level commands such as transfer asset, therefore is limited in features.
  2. It is hard to extend running system with new commands and queries, because iroha has to be recompiled after addition of new features.
  3. It is hard to add new commands or queries to the source code, because addition requires changes in 7+ different parts of iroha.

Other blockchains

/**
* Copyright Soramitsu Co., Ltd. 2017 All Rights Reserved.
* http://soramitsu.co.jp
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@Warchant
Warchant / smcts.md
Last active April 10, 2018 07:57
Smart Contracts

Smart contract analysis

Introduction

A smart contract is a computer protocol intended to facilitate, verify, or enforce the negotiation or performance of a contract. Smart contracts were first proposed by Nick Szabo in 1996 [5].

A smart contract is a set of promises, specified in digital form, including protocols within which the parties perform on these promises, -- Nick Szabo [1].

Good analogy to understand smart contracts better:

Optimizations in iroha:

1. move definitions of non-template classes to cpp files from hpp.

must have

This helps to reduce amount of header dependencies, and compile definitions exactly once. Also this helps to follow ODR (One Definition Rule).

RULE: it is always an error to place definitions with external linkage to .hpp files. (hyperledger-iroha/iroha#787, rule 1)