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 / main.go
Created January 28, 2020 16:05
libp2p echo server with hardcoded keypair
package main
import (
"bufio"
"context"
"encoding/hex"
"flag"
"fmt"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-core/crypto"
@igor-egorov
igor-egorov / client.cpp
Last active January 13, 2020 14:24
libp2p secio debug files
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include <chrono>
#include <iostream>
#include <memory>
#include <spdlog/sinks/stdout_color_sinks.h>
@igor-egorov
igor-egorov / run-raspiroha.sh
Last active July 18, 2019 16:37
How to run Iroha on raspi using dmitriyselivanov/iroha_armv7l:latest
cd ~
git clone https://github.com/hyperledger/iroha.git
docker network create iroha-network
docker run --name some-postgres \
--network='iroha-network' \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=mysecretpassword \
@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')
@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"
#include "obj_counter.hpp"
class Block : public ::google::protobuf::Message, public ::ObjCounter<Block>
@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>
@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 / 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 / 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.')