Skip to content

Instantly share code, notes, and snippets.

View jmjatlanta's full-sized avatar

John M. Jones jmjatlanta

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jmjatlanta on github.
  • I am jmjatlanta (https://keybase.io/jmjatlanta) on keybase.
  • I have a public key ASAF3Nqn3SJKkWiep11tfEK2paGPUGqU5KyfmamSR0etPgo

To claim this, I am signing this object:

@jmjatlanta
jmjatlanta / asset_tests.cpp
Created June 6, 2018 12:50
Test for asset::amount_to_string
/*
* Copyright (c) 2018 Bitshares Foundation, and contributors.
*
* The MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@jmjatlanta
jmjatlanta / bitshares_compile_windows.md
Created June 15, 2018 19:03
Compile Bitshares-Core for Windows
@jmjatlanta
jmjatlanta / bitshares_build_win32.md
Last active July 29, 2018 22:02
Build Bitshares-Core on Windows

Note: This is a work in progress. I am still diagnosing an issue that seems to be related to cmake/boost. I am posting this here to hopefully help others and someday find the time to fix my cmake/boost issue.

Windows - Visual Studio 2015 Update 1

Prerequisites for Bitshares Core

  • 64-bit Windows operating system. These instructions were created with Windows 10 on an Intel PC.
  • Visual Studio Community 2015 Update 1. Note: There seem to be problems compiling with Visual Studio versions above 2015 Update 1 (including VS2017).
  • Perl. Active Perl was used for this document. It is assumed that it is in your PATH.
  • CMake. Version 3.11 was used for this document. It is assumed that it is in your PATH.
  • NASM is needed to compile OpenSSL. It is assumed that it is in your PATH.
@jmjatlanta
jmjatlanta / Makefile
Last active September 3, 2018 13:50
What happens when you use an thread-unsafe collection
CC=g++
CFLAGS=-g
DEPS=
%.o: %.cpp $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
test_threadsafe: test_threadsafe.o
$(CC) -g -O0 -lSegFault -o test_threadsafe $^ -lpthread -rdynamic
@jmjatlanta
jmjatlanta / test_yield.cpp
Created September 28, 2018 11:20
What happens when a thread with a lock yields
/***
* This is a test to demonstrate what happens when a thread with
* a lock yields
*/
#include <thread>
#include <mutex>
#include <iostream>
std::mutex blocker;
std::mutex logger;
@jmjatlanta
jmjatlanta / thread_tests.cpp
Created January 23, 2019 01:40
Testing fc::thread with fc::mutex (fragment)
/****
* Attempt to have fc::threads use fc::mutex when yield() causes a context switch
*/
BOOST_AUTO_TEST_CASE( yield_with_mutex )
{
// set up thread pool
uint16_t num_threads = 5;
std::vector<fc::thread*> thread_collection;
for(uint16_t i = 0; i < num_threads; i++)
thread_collection.push_back(new fc::thread("My" + std::to_string(i)));
1950456,1950598c1950456,1950598
< {"id":"1.10.29277","expiration_time":"2019-05-17T15:06:15","proposed_transaction":{"ref_block_num":0,"ref_block_prefix":0,"expiration":"2019-05-17T15:06:15","operations":[[0,{"fee":{"amount":50000,"asset_id":"1.3.0"},"from":"1.2.466056","to":"1.2.382882","amount":{"amount":500000,"asset_id":"1.3.5303"},"memo":{"from":"BTS7gDsXig5wwDjZRr7ewx2w1fvcefG23pNnppc3BBcEPeTK2Z7M5","to":"BTS6yQ2HkAWfZvrGTwHSDQyBxNgAGqbsNYT9gkqpQks7iZ2FFwqib","nonce":"202400808233984","message":"d3762680875af8f92ed67b66df9f829a"},"extensions":[]}]],"extensions":[]},"required_active_approvals":["1.2.466056"],"available_active_approvals":["1.2.1016553","1.2.1016563"],"required_owner_approvals":[],"available_owner_approvals":[],"available_key_approvals":[],"proposer":"1.2.1016502"}
< {"id":"1.10.29908","expiration_time":"2019-05-16T10:15:32","proposed_transaction":{"ref_block_num":0,"ref_block_prefix":0,"expiration":"2019-05-16T10:15:32","operations":[[23,{"fee":{"amount":13061,"asset_id":"1.3.0"},"fee_pay
1950456,1950598c1950456,1950598
< {"id":"1.10.29277","expiration_time":"2019-05-17T15:06:15","proposed_transaction":{"ref_block_num":0,"ref_block_prefix":0,"expiration":"2019-05-17T15:06:15","operations":[[0,{"fee":{"amount":50000,"asset_id":"1.3.0"},"from":"1.2.466056","to":"1.2.382882","amount":{"amount":500000,"asset_id":"1.3.5303"},"memo":{"from":"BTS7gDsXig5wwDjZRr7ewx2w1fvcefG23pNnppc3BBcEPeTK2Z7M5","to":"BTS6yQ2HkAWfZvrGTwHSDQyBxNgAGqbsNYT9gkqpQks7iZ2FFwqib","nonce":"202400808233984","message":"d3762680875af8f92ed67b66df9f829a"},"extensions":[]}]],"extensions":[]},"required_active_approvals":["1.2.466056"],"available_active_approvals":["1.2.1016553","1.2.1016563"],"required_owner_approvals":[],"available_owner_approvals":[],"available_key_approvals":[],"proposer":"1.2.1016502"}
< {"id":"1.10.29908","expiration_time":"2019-05-16T10:15:32","proposed_transaction":{"ref_block_num":0,"ref_block_prefix":0,"expiration":"2019-05-16T10:15:32","operations":[[23,{"fee":{"amount":13061,"asset_id":"1.3.0"},"fee_pay
@jmjatlanta
jmjatlanta / genesis.json
Last active June 26, 2019 15:01
genesis.json for private testnet with HTLC
{
"initial_timestamp": "2016-01-18T09:18:25",
"max_core_supply": "1000000000000000",
"initial_parameters": {
"current_fees": {
"parameters": [[
0,{
"fee": 2000000,
"price_per_kbyte": 1000000
}