Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Develop rebase with main branch (#83)
* Add ordering sequence to params in query (#73) * Add ordering sequence to params Makes possible to add ordering sequence to Query. Fixes #72 Signed-off-by: Rafik Naccache <rafik@fekr.tech> * Add :param ordering_sequence: Signed-off-by: Rafik Naccache <rafik@fekr.tech> * Fix wrong example for :param ordering_sequence: Signed-off-by: Rafik Naccache <rafik@fekr.tech> * fix wrong ordering message construction in query After more documentation I got to the way to construct to ordering object Signed-off-by: Rafik Naccache <rafik@fekr.tech> * remove redundant OR clause to manage ordering_sequence Signed-off-by: Rafik Naccache <rafik@fekr.tech> * Correction after review Signed-off-by: Grzegorz Bazior <bazior@agh.edu.pl> * Migrated from main branch also protobuf files Signed-off-by: G.Bazior <bazior@agh.edu.pl> * Updated proto files with script download-schema.py Signed-off-by: G.Bazior <bazior@agh.edu.pl> * Updated generated from protobuf python files (script compile-proto.py) Signed-off-by: G.Bazior <bazior@agh.edu.pl> Co-authored-by: Rafik NACCACHE <rafik@fekr.tech>
- Loading branch information
Showing
23 changed files
with
2,914 additions
and
946 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Hyperledger Security Policy | ||
|
||
## Reporting a Security Bug | ||
|
||
If you think you have discovered a security issue in any of the Hyperledger | ||
projects, we'd love to hear from you. We will take all security bugs | ||
seriously and if confirmed upon investigation we will patch it within a | ||
reasonable amount of time and release a public security bulletin discussing | ||
the impact and credit the discoverer. | ||
|
||
There are two ways to report a security bug. The easiest is to email a | ||
description of the flaw and any related information (e.g. reproduction | ||
steps, version) to | ||
[security at hyperledger dot org](mailto:security@hyperledger.org). | ||
|
||
The other way is to file a confidential security bug in our | ||
[JIRA bug tracking system](https://jira.hyperledger.org). | ||
Be sure to set the “Security Level” to “Security issue”. | ||
|
||
The process by which the Hyperledger Security Team handles security bugs | ||
is documented further in our | ||
[Defect Response](https://wiki.hyperledger.org/display/HYP/Defect+Response) | ||
page on our [wiki](https://wiki.hyperledger.org). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
protobuf==3.5.1 | ||
grpcio_tools==1.11.0 | ||
six==1.12.0 | ||
PyNaCl==1.4.0 | ||
protobuf==3.12.2 | ||
grpcio_tools==1.21.1 | ||
six==1.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright Soramitsu Co., Ltd. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
import os | ||
import binascii | ||
from iroha import IrohaCrypto | ||
from iroha import Iroha, IrohaGrpc | ||
import sys | ||
|
||
if sys.version_info[0] < 3: | ||
raise Exception('Python 3 or a more recent version is required.') | ||
|
||
print(""" | ||
This example works only through a TLS connection, you must first configure torii_tls_params | ||
https://iroha.readthedocs.io/en/main/configure/torii-tls.html | ||
""") | ||
|
||
IROHA_HOST_ADDR = os.getenv('IROHA_HOST_ADDR', 'localhost') | ||
IROHA_TLS_PORT = os.getenv('IROHA_PORT', '55552') | ||
ADMIN_ACCOUNT_ID = os.getenv('ADMIN_ACCOUNT_ID', 'admin@test') | ||
ADMIN_PRIVATE_KEY = os.getenv( | ||
'ADMIN_PRIVATE_KEY', 'f101537e319568c765b2cc89698325604991dca57b9716b58016b253506cab70') | ||
iroha = Iroha(ADMIN_ACCOUNT_ID) | ||
certificate = """-----BEGIN CERTIFICATE----- | ||
MIIDUDCCAjgCCQCsHEs/sUtihTANBg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KQZdZlsG80xDucBf/VJrKLkQW60CWmXhit0GiZu79LzYMuN | ||
QAGWtoyyaJ7TmCOUR9MpH/2bna429WOhg9/hgMDGdJ9bG1Bm | ||
-----END CERTIFICATE----- | ||
""" | ||
byte_certificate = bytes(certificate, 'utf-8') | ||
net = IrohaGrpc('{}:{}'.format(IROHA_HOST_ADDR, IROHA_TLS_PORT), secure=True, root_certificates=byte_certificate) | ||
|
||
|
||
def trace(func): | ||
""" | ||
A decorator for tracing methods' begin/end execution points | ||
""" | ||
|
||
def tracer(*args, **kwargs): | ||
name = func.__name__ | ||
print('\tEntering "{}"'.format(name)) | ||
result = func(*args, **kwargs) | ||
print('\tLeaving "{}"'.format(name)) | ||
return result | ||
|
||
return tracer | ||
|
||
|
||
@trace | ||
def send_transaction_and_print_status(transaction): | ||
hex_hash = binascii.hexlify(IrohaCrypto.hash(transaction)) | ||
print('Transaction hash = {}, creator = {}'.format( | ||
hex_hash, transaction.payload.reduced_payload.creator_account_id)) | ||
net.send_tx(transaction) | ||
for status in net.tx_status_stream(transaction): | ||
print(status) | ||
|
||
|
||
@trace | ||
def add_coin_to_admin(): | ||
""" | ||
Add 1000.00 units of 'coin#domain' to 'admin@test' | ||
""" | ||
tx = iroha.transaction([ | ||
iroha.command('AddAssetQuantity', | ||
asset_id='coin#domain', amount='1000.00') | ||
]) | ||
IrohaCrypto.sign_transaction(tx, ADMIN_PRIVATE_KEY) | ||
send_transaction_and_print_status(tx) | ||
|
||
|
||
add_coin_to_admin() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.