Skip to content

Instantly share code, notes, and snippets.

View type-inspect.go
package main
import (
"fmt"
"go/ast"
"go/importer"
"go/parser"
"go/token"
"go/types"
"os"
View A.go
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type Something interface{}
View TreeGenerator-elapsedtime.plot
set grid
set title 'TreeGenerator Elapsed Time'
set xlabel 'number of added nodes'
set ylabel 'elapsed(ms)'
plot '/tmp/tg.dat' with points linetype 9 notitle
@spikeekips
spikeekips / dummy.md
Created Dec 5, 2019
Files for github.com/spikeekips/avl
View tokennet-TOKENNET-PUBLIC.md

Tokennet Public Network

SSH Keypair

for i in seoul tokyo california sydney
do
    aws --profile tokennet-public-aws0-$i ec2 import-key-pair --key-name tokennet-public --public-key-material MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyo+KRVKL0e+oA6EcI0bJFETKklKJv/d+c4SHqezQnfjYWjmq9wfJfIhEAl3qPM2eK675YFZ0mxEM8o6wCMv7mSS84tPXHeO3HS1oduc8naE4K3cxbgEFuV5gWan/RBb/kSq0rNzwxTaFD2+Xv8zRHX+GjV7ojmS+15c1FwvptgLe4VGS49JbkVmxJAQm5Vg7Qc5qL/B0qGzzie3bYq1c3CIvo2+ECwEA6cG+y90CZDWOaeZz1TWzXgNtonpG0fIepY5mHFTeeLoEeuRoacz0bU6hHC3rKkeIhn7WKyUHMRDVuxl8lcszh31isR6qj/D6zuD8mBDk4IXEOjYZBEOyuQIDAQAB
    aws --profile tokennet-public-aws1-$i ec2 import-key-pair --key-name tokennet-public --public-key-material MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyo+KRVKL0e+oA6EcI0bJFETKklKJv/d+c4SHqezQnfjYWjmq9wfJfIhEAl3qPM2eK675YFZ0mxEM8o6wCMv7mSS84tPXHeO3HS1oduc8naE4K3cxbgEFuV5gWan/RBb/kSq0rNzwxTaFD2+Xv8zRHX+GjV7ojmS+15c1FwvptgLe4VGS49JbkVmxJAQm5Vg7Qc5qL/B0qGzzie3bYq1c3CIvo2+ECwEA6cG+y90CZDWOaeZz1TWzXgNtonpG0fIepY5mHFTeeLoEeuRoa
View tokennet-INFLATION.md

How Inflation Works

Scenario

  1. make network
  2. make transactions
  3. collect all the balances of accounts
  4. occur inflation
  5. collect all the balances of accounts again
  6. compare the collected balances
View tokennet-INFLATION-TEST.md

INFLATION TEST

$ ansible-playbook -i env/local script/apt-upgrade.yml
$ ansible-playbook -i env/local script/system-time.yml
$ ansible -o -i env/local servers -a date; TZ=UTC date
View tokennet-FAILED-tokennet-public.md

just restart

ansible-playbook -i env/tokennet-public script/tokennet-core-up-forcescp.yml -e path=$(pwd)/../design/tokennet-public/latest/
ansible -i env/tokennet-public tokennet-core -m shell -a 'mv /opt/bos/tmp/db-*.tar.gz /opt/'

backup db

View tokennet-BLOCK-INFLATION.md

Block Inflation In 'horizon'

tokennet-keys 'Test BOS Token Network ; local.test; September 2017'
horizon='http://192.168.99.110:8080'
genesis_seed='SBQKVXRWIN7DM36PKOH73YFS5EC44H3QUPDULXJJZOSXOU7FB4V62IHZ'
common_acocunt='GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5'
#root_account='GAMX6BVPNPWWRGGAUZGT57YG4ZYNI3FO5UHXYSGYBODQVFWIEBWVFDRX'
# this is fake root account
root_account='GC2HXJ25LJLDTEDI7ZXXYWN6KXFLPEPNT67NUQADPU4VYHE7RVBT6MHI'
View tokennet-ATTACH-VOLUME.md

$ ansible -o -i env/tokennet-test servers -m shell -a 'sudo dmesg | grep xvd | grep -v xvda | grep -v "from /dev/hd" | grep "blkfront:"'

$ for i in seoul1 seoul7 seoul5 seoul4 seoul2 seoul6 seoul0 seoul8 seoul9 seoul3 tokyo1 tokyo4 tokyo2 tokyo5 tokyo7 tokyo8 tokyo3 tokyo6 tokyo0 es-seoul0 tokyo9 es-seoul1 es-seoul2 es-seoul3 sydney4 sydney5 sydney6 sydney3 sydney1 sydney8 sydney0 sydney2 sydney7 sydney9 california0 california1 california6 california5 california2 california4 california3 california7 california9 california8; do ansible -o -l $i -i env/tokennet-test servers -m shell -a 'mount | grep "/dev/xvdb"'; done