Skip to content

Instantly share code, notes, and snippets.

View igor-egorov's full-sized avatar
💮

Igor Egorov igor-egorov

💮
View GitHub Profile
@igor-egorov
igor-egorov / Iroha_Core_Concepts.md
Created August 8, 2018 09:38
Iroha Core Concepts (review)

Iroha Core Concepts - Draft (Grammar and understandability)

Why does Iroha run in a network? How can one gain a better understanding of the objects, both inside and outside the system? How do peers in the network collaborate and decide on which data to put into the blockchain? We will look at the Core Concepts and terminology used by Iroha in this section.

Account : An Iroha entity that is able to perform a specified set of actions or permissions. Each account belongs to one of multiple existing domains. An account is associated with zero or more roles.

There are two categories of permissions in Iroha, Permissions and Grantable Permissions. Only Grantable Permissions can be assigned to an account directly. Grantable Permissions allow an account to perform some action on behalf of another account.

Ametsuchi

@igor-egorov
igor-egorov / script.sh
Created August 8, 2018 18:02
Run tx-example.py on Iroha from master branch
git clone -b master --depth=1 git@github.com:hyperledger/iroha.git iroha
cd iroha
docker pull hyperledger/iroha:latest
docker network create iroha-network
docker run --name some-postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=mysecretpassword \
@igor-egorov
igor-egorov / perfo.py
Created February 1, 2019 16:23
HL Iroha TxStatusStream performance degradation
#!/usr/bin/env python3
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
from irohalib import Iroha, IrohaCrypto, IrohaGrpc
import uuid
import time
@igor-egorov
igor-egorov / iroha-replay-repro.py
Created February 14, 2019 17:11
Iroha replay test repro
#!/usr/bin/env python3
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
import sys
if sys.version_info[0] < 3:
raise Exception('Python 3 or a more recent version is required.')
@igor-egorov
igor-egorov / statuses.py
Created February 21, 2019 18:50
Iroha status stream test
#!/usr/bin/env python3
from iroha import Iroha, IrohaCrypto, IrohaGrpc
import uuid
import binascii
address = 'localhost:50051'
admin_key = 'f101537e319568c765b2cc89698325604991dca57b9716b58016b253506cab70'
admin_id = 'admin@test'
domain = admin_id.split('@')[1]
@igor-egorov
igor-egorov / combine-test.build-log
Created February 21, 2019 20:04
combine-latest-until-first-build-error-log
====================[ Build | combine_latest_until_first_completed_test | Debug ]====
"/Users/igor/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/183.5429.37/CLion.app/Contents/bin/cmake/mac/bin/cmake" --build /Users/igor/cpp/iroha/cmake-build-debug --target combine_latest_until_first_completed_test -- -j8
[ 66%] Built target google_test
[100%] Built target reactive_extensions_rxcpp
[100%] Building CXX object test/module/libs/common/CMakeFiles/combine_latest_until_first_completed_test.dir/combine_latest_until_first_completed_test.o
In file included from /Users/igor/cpp/iroha/test/module/libs/common/combine_latest_until_first_completed_test.cpp:11:
In file included from /usr/local/include/boost/variant.hpp:17:
/usr/local/include/boost/variant/variant.hpp:387:9: error: destructor called on non-final 'IntervalObservebleHelper' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
operand.~T(); // must be noexcept
^
@igor-egorov
igor-egorov / obj_counter.hpp
Created March 6, 2019 09:14
Objects Counter C++
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef IROHA_OBJ_COUNTER_HPP
#define IROHA_OBJ_COUNTER_HPP
#include <atomic>
#include <iostream>
#include <mutex>
#include "obj_counter.hpp"
class Block : public ::google::protobuf::Message, public ::ObjCounter<Block>
@igor-egorov
igor-egorov / pending_txs_storage_impl.cpp
Created April 10, 2019 12:38
debuggable pending transactions storage
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include "pending_txs_storage/impl/pending_txs_storage_impl.hpp"
#include <sstream>
#include "interfaces/transaction.hpp"
@igor-egorov
igor-egorov / get_acc_txs.py
Created May 17, 2019 15:06
GetAccountTransactions pagination sample
#!/usr/bin/env python3
from iroha import Iroha, IrohaCrypto, IrohaGrpc
import binascii
admin_private = '85025c609c7cf82c1e8d6f398bdb28f6b799a49874e9215a3835df0c92c9ec14'
iroha = Iroha('admin@hoge')
net = IrohaGrpc('localhost:50051')