Skip to content

Instantly share code, notes, and snippets.

View jaekwon's full-sized avatar

Jae Kwon jaekwon

View GitHub Profile
Create:
Serverside:
POST /api/v1/wallet/create
?id
&secret
&wallet
&coin
response: {
diff --git a/src/init.cpp b/src/init.cpp
index b358734..45bf9f7 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -415,7 +415,7 @@ bool AppInit2()
{
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s'"), mapArgs["-paytxfee"].c_str()));
- if (nTransactionFee > 0.25 * COIN)
+ if (nTransactionFee > 25.0 * COIN)
* tx_id is a random string nonce of 32 characters that identifies a single request.
You can send multiple requests with the same tx_id, and it will only go through once, so
you can do retries safely when there is a network problem.
NOTE: tx_id does not guarantee that a request will successfully go through,
it only guarantees that the server will only see it once. If the server crashes while
processing a request of a given tx_id, you may have to make another request with
a new tx_id.
* Make sure your wallet names are exactly 12 characters long.
* <coin> is ‘BTC’, ‘DOG’, etc.
* All requests must additionally include ‘user_id’ and ‘secret’ parameters.
@jaekwon
jaekwon / gist:fa6fca0b0d6602f88c73
Created November 25, 2014 03:13
Testing the effect of Sybil columns on eigenvectors
import numpy as np
from numpy import linalg as LA
M = np.random.random((3,3))
# Normalize columns
M_norms = np.apply_along_axis(LA.norm, 0, M)
M = M / M_norms
# Create a sybil column
# append rows of zeros (nobody in original M votes for it)
// Check out the development branch
git checkout development
git pull origin development
// Remove old data
rm ~/.tendermint/config.json
rm -rf ~/.tendermint/data/*
// Rebuild tendermint
go build -o github.com/tendermint/tendermint/cmd
@jaekwon
jaekwon / gist:b80fe2bcc1d077e3c40d
Created January 6, 2015 21:28
test genesis.json for Tendermint
{
"Accounts": [
{
"Address": "6070ff17c39b2b0a64ca2bc431328037fa0f4760",
"Amount": 200000000
}
],
"Validators": [
{
"PubKey": "01206bd490c212e701a2136eeea04f06fa4f287ee47e2b7a9b5d62edd84cd6ad9753",
@jaekwon
jaekwon / gist:504e1424b08494cf23b2
Created February 17, 2015 23:13
PoC7/8 Opcodes
0x00 STOP 0x30 ADDRESS 0x60 PUSH1 0x80 DUP1 0xA0 LOG0
0x01 ADD 0x31 BALANCE 0x61 PUSH2 0x81 DUP2 0xA1 LOG1
0x02 MUL 0x32 ORIGIN 0x62 PUSH3 0x82 DUP3 0xA2 LOG2
0x03 SUB 0x33 CALLER 0x63 PUSH4 0x83 DUP4 0xA3 LOG3
0x04 DIV 0x34 CALLVALUE 0x64 PUSH5 0x84 DUP5 0xA4 LOG4
0x05 SDIV 0x35 CALLDATALOAD 0x65 PUSH6 0x85 DUP6
0x06 MOD 0x36 CALLDATASIZE 0x66 PUSH7 0x86 DUP7 0xF0 CREATE
0x07 SMOD 0x37 CALLDATACOPY 0x67 PUSH8 0x87 DUP8 0xF1 CALL
0x08 ADDMOD 0x38 CODESIZE 0x68 PUSH9 0x88 DUP9 0xF2 CALLCODE
0x09 MULMOD 0x39 CODECOPY 0x69 PUSH10 0x89 DUP10 0xF3 RETURN
@jaekwon
jaekwon / gist:1863914d728ef5fbe676
Created March 27, 2015 18:40
Testing ReadBinary from interface reflection type
diff --git a/binary/reflect_test.go b/binary/reflect_test.go
index d8055f5..ac54236 100644
--- a/binary/reflect_test.go
+++ b/binary/reflect_test.go
@@ -2,6 +2,7 @@ package binary
import (
"bytes"
+ "fmt"
"reflect"
INFO[04-02|19:50:25] Running round action module=consensus height=72872 round=0 step=RoundStepPrecommit roundAction="RoundAction{H:72872 R:0 A:RoundActionCommit}" startTime=2015-04-02T19:50:15-0700
INFO[04-02|19:50:25] Running round action module=consensus height=72872 round=0 step=RoundStepCommit roundAction="RoundAction{H:72872 R:0 A:RoundActionTryFinalize}" startTime=2015-04-02T19:50:15-0700
INFO[04-02|19:50:28] Running round action module=consensus height=72873 round=0 step=RoundStepNewHeight roundAction="RoundAction{H:72873 R:0 A:RoundActionPropose}" startTime=2015-04-02T19:50:28-0700
INFO[04-02|19:50:31] Running round action module=consensus height=72873 round=0 step=RoundStepPropose roundAction="RoundAction{H:72873 R:0 A:RoundActionPrevote}" startTime=2015-04-02T19:50:28-0700
INFO[04-02|19:50:35] Running round action module=consensus height=72873 round=0 step=RoundStepPrevote roundAction="RoundAction{H:7
@jaekwon
jaekwon / default.cfg
Created May 5, 2015 01:34
default.cfg
{
"Remotes": [
"http://navytoad.chaintest.net:46662",
"http://whiteferret.chaintest.net:46662",
"http://magentagriffin.chaintest.net:46662",
"http://greensalamander.chaintest.net:46662",
"http://blackshadow.chaintest.net:46662",
"http://pinkpenguin.chaintest.net:46662",
"http://polkapig.chaintest.net:46662"
],