Skip to content

Instantly share code, notes, and snippets.

View danintel's full-sized avatar

Dan Anderson danintel

View GitHub Profile
@danintel
danintel / run_lint_usage.txt
Created January 27, 2022 19:25
Hyperledger Avalon static source code checker (run_lint)
run_lint: Static source code checker for Hyperledger Avalon project.
Run any combination of pycodestyle, pylint3, and cppcheck on Python and C++ source code.
Usage:
run_lint [-h] [-n] [-s <branch>] -v <subdir> <pycodestyle-python> <pylint3> <pycodestyle-cpp> <cppcheck>
Where:
-h Display this usage message
-n Dry-run. Only print files that would be linted
@danintel
danintel / sawtooth-simple-supply-chain-sawtooth-1.2.3-regression.log
Created October 23, 2019 16:57
Sawtooth Simple Supply Chain Regression with Sawtooth 1.2.3
Attaching to simple-supply-adminer, sawtooth-validator, simple-supply-postgres, sawtooth-devmode-engine-rust-default, sawtooth-settings-tp, sawtooth-rest-api, simple-supply-shell, simple-supply-tp, simple-supply-subscriber, simple-supply-rest-api, curator-app
simple-supply-adminer | PHP 7.3.10 Development Server started at Wed Oct 23 16:18:49 2019
simple-supply-postgres | The files belonging to this database system will be owned by user "postgres".
simple-supply-postgres | This user must also own the server process.
simple-supply-postgres |
simple-supply-postgres | The database cluster will be initialized with locale "en_US.utf8".
simple-supply-postgres | The default database encoding has accordingly been set to "UTF8".
simple-supply-postgres | The default text search configuration will be set to "english".
simple-supply-postgres |
simple-supply-postgres | Data page checksums are disabled.
@danintel
danintel / sha256-assembly-tracing.txt
Last active June 4, 2019 18:20
Tracing %rsp in OpenSSL SHA-256 AVX2 function sha256_block_data-order_avx2
%RSP Value PERL/ASM SOURCE (file sha512-x86_64.pl )
============ ===================================================
.type ${func}_avx2,\@function,3
.align 64
${func}_avx2: #DAN: function sha256_block_data_order_avx2
.cfi_startproc
.Lavx2_shortcut:
7fffffffd708 #DAN: %rsp value on function entry
mov %rsp,%rax # copy %rsp
@danintel
danintel / aws-sawtooth-marketplace.txt
Last active March 8, 2019 20:05
Using AWS with the Pre-built Sawtooth Supply Chain Instance
Using AWS with the Pre-built Sawtooth Supply Chain Instance
By Dan Anderson (February 1, 2019)
These instructions create an "Free Tier" AWS instance running Sawtooth Marketplace on Sawtooth 0.8.9.
The instance is pre-release and old (2017) (the current Sawtooth release, December 2018, is 1.1)
1. Go to AWS Marketplace "Hyperledget Sawtooth Supply Chain" at
https://aws.amazon.com/marketplace/pp/B077FLR7V5
2. Click "Sign in or Create a new account" in the upper right
<!-- wget http://localhost:8008/receipts?id=50c090ffd3f0529b406b1896084a445c4fdb08a06ce1dc0d56a2b2b16d41a74745975b679843f84fb7659915567870018eaadb2eff3b84795fc3b7ca29e58a2a
REST-API is documented at https://sawtooth.hyperledger.org/docs/core/releases/latest/rest_api.htm -->
{
"data": [
{
"data": [],
"events": [],
"id": "50c090ffd3f0529b406b1896084a445c4fdb08a06ce1dc0d56a2b2b16d41a74745
975b679843f84fb7659915567870018eaadb2eff3b84795fc3b7ca29e58a2a",
@danintel
danintel / protobuf.patch
Created June 21, 2018 15:52
Patch to add Protobuf (Protocol Buffer) serializatio to Sawtooth Cookiejar application
13 pyclient/cookiejar_client.py
@@ -33,6 +33,10 @@
from sawtooth_sdk.protobuf.batch_pb2 import BatchHeader
from sawtooth_sdk.protobuf.batch_pb2 import Batch
+from sys import path
+path.append('../proto')
+from cookiejar_pb2 import CookiejarTransaction
+
@danintel
danintel / cbor.patch
Created June 21, 2018 15:51
Patch to add CBOR serialization to Sawtooth Cookiejar application
Showing with 20 additions and 8 deletions.
1 pyclient/Dockerfile
@@ -38,6 +38,7 @@ RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sou
python3-cbor \
python3-cchardet=2.0a3-1 \
python3-chardet=2.3.0-1 \
+ python3-cbor \
python3-colorlog \
python3-cov-core \
@danintel
danintel / sawtooth-simple-wallet-interest-feature.patch
Created May 24, 2018 17:25
sawtooth-simple-wallet new feature demo: interest
# https://github.com/askmish/sawtooth-simplewallet
28 pyclient/wallet/simplewallet_cli.py
@@ -71,6 +71,22 @@ def add_deposit_parser(subparsers, parent_parser):
type=str,
help='the name of customer to deposit to')
+def add_interest_parser(subparsers, parent_parser):
+ parser = subparsers.add_parser(
+ 'interest',
@danintel
danintel / TcpServerPosix.c.patch
Last active April 18, 2018 16:11
Patch to add IPv6 Support to the Microsoft/IBM TPM 2.0 Simulator on SourceForge
--- src/TcpServerPosix.c.ori 2016-11-16 10:31:54.000000000 -0800
+++ src/TcpServerPosix.c 2018-04-18 09:10:00.000000000 -0700
@@ -82,6 +82,9 @@
#include "TcpServerPosix_fp.h"
#include "Simulator_fp.h"
+#define IPVER(len) ((len) == sizeof(struct sockaddr_in6) ? 6 : \
+ ((len) == sizeof(struct sockaddr_in) ? 4 : 0))
+
#ifndef __IGNORE_STATE__