Skip to content

Instantly share code, notes, and snippets.

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

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

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

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'

$ 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

@spikeekips
spikeekips / l.sh
Last active December 17, 2019 10:37
languagetool
#!/bin/sh
##################################################################
# Copyright 2008 Spike^ekipS <spikeekips@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@spikeekips
spikeekips / OS X network optimize.txt
Created September 30, 2019 03:26 — forked from snoby/OS X network optimize.txt
OSX Sierra Network Performance Tweaks
#
# Reboot into recovery mode (cmd +r ) and in the terminal
#
nvram boot-args="serverperfmode=1 ncl=262144"
#reboot
#
# In regular mode
global:
policy:
interval_broadcast_init_ballot_in_join: 5s
timeout_wait_vote_result_in_join: 6s
timeout_wait_ballot: 6s
blocks:
- height: 1
round: 10
- height: 5
#!/usr/bin/env python
import os
import time
import functools
import json
from colors import green, blue, red
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
#!/bin/sh
##################################################################
# Copyright 2008 Spike^ekipS <spikeekips@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#