Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - alt

Pages: 1 ... 7 8 9 10 11 12 13 [14] 15 16
196
General Discussion / script for automation test
« on: June 18, 2014, 02:39:00 am »
I have write a  script to test toolkit automation
this can used to test some condition like flood transaction
I think somebody maye need this too
Code: [Select]
#!/usr/bin/expect -f

set timeout -1

set wallet_name "default"
set account_from "alt"
set account_to "delegate-alt"
send_user "wallet name is: $wallet_name\n"
send_user "wallet passphrase: "
stty -echo
expect_user -re "(.*)\n"
stty echo
set wallet_pass $expect_out(1,string)

spawn ./bitshares_client --server --httpport 9989

expect -exact "--- there are now 1 active connections to the p2p network"
expect -exact "(wallet closed) >>> "
send -- "info\r"
expect -exact "(wallet closed) >>> "
send -- "wallet_open $wallet_name\r"
expect -exact "$wallet_name (locked) >>> "
send -- "wallet_unlock 999999\r"
expect -exact "passphrase: "
send -- "$wallet_pass\r"
#expect -exact "$wallet_name (unlocked) >>> "
#send -- "wallet_rescan_blockchain\r"
sleep 2
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_transfer 10 DRINK $account_from $account_to \"test flood...\"\r"
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_transfer 11 DRINK $account_from $account_to \"test flood...\"\r"
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_transfer 12 DRINK $account_from $account_to \"test flood...\"\r"
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_transfer 13 DRINK $account_from $account_to \"test flood...\"\r"
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_account_transaction_history\r"
interact
#expect -exact "$wallet_name (unlocked) >>> "
#send -- "exit\r"
#expect eof

197
1. 安装 ubuntu1404,注意现在只支持64位版本
2. 安装以下依赖包
Code: [Select]
aptitude install git cmake g++ zlib1g-dev libreadline6-dev libdb++-dev libboost-all-dev libssl-dev uuid-dev
3. git 迁出 bitshares_toolkit 代码,并编译
Code: [Select]
    git submodule init
    git submodule update
    mkdir build && cd build
    cmake ..
    make
运行
Code: [Select]
cd programs/client
  cp ../../../tests/genesis.json ./
 ./bitshares_client --server --httpport 9989
4. git 迁出 web_wallet 代码
5. 下载 node , 地址 http://www.nodejs.org/download/ ,下载 linux 下 64位版本并安装
6. 使用超级用户安装 lineman
Code: [Select]
sudo -i
npm install lineman
exit
7. 安装其它依赖包,注意要在 web_wallet 目录下运行
Code: [Select]
cd web_wallet
npm install protractor jasmine-given coffee-script lineman-angular lineman-less
8. 然后编辑 ~/.BitsharesXTS/config.json,注意要配置用户名、密码及htdocs这三项
Code: [Select]
{
  "rpc": {
    "rpc_user": "alt",
    "rpc_password": "alt",
    "rpc_endpoint": "127.0.0.1:0",
    "httpd_endpoint": "0.0.0.0:0",
    "htdocs": "/home/alt/workspace/web_wallet/generated/"
  },
  "default_peers": [
    "107.170.30.182:8764"
  ],
  "ignore_console": false
}
9. 启动 web 钱包服务器
Code: [Select]
lineman run
10. 重新运行 bitshares_client
11. 浏览器内输入 http://localhost:9989 就可以访问 web 钱包了。
如果想在手机上访问,需要把 config.json 中的httpd_endpoint 改为0.0.0.0:0

198
bts 的 p2p 网络建立节点连接依赖于 upnp 特性,所以请大家打开路由器上的 upnp 选项,这样别人才能和你建立连接,
我们的 p2p 网络才足够健壮。否则可能像现在一样,开了一整天,只能建立一个连接。
打开 upnp 不会增加你的安全隐患,关于 upnp 介绍参考以下连接:
http://baike.baidu.com/view/27925.htm

I saw network_num_connections is always 1
so I check the netstat, I am wondering why so many state is SYN_SENT?
It's because of firewall?
or does the p2p network depend on upnp when the node is behind a local gateway?

Code: [Select]
alt@alt-ThinkPad-T430s ~ $ netstat -nap | grep bitshares
tcp        0      0 0.0.0.0:5678            0.0.0.0:*               LISTEN      22148/bitshares_cli
tcp        0      0 127.0.0.1:5679          0.0.0.0:*               LISTEN      22148/bitshares_cli
tcp        0      0 127.0.0.1:5680          0.0.0.0:*               LISTEN      22148/bitshares_cli
tcp        0      1 10.10.40.72:5678        223.65.189.69:5679      SYN_SENT    22148/bitshares_cli
tcp        0      1 10.10.40.72:5678        79.173.81.171:5678      SYN_SENT    22148/bitshares_cli
tcp        0      1 10.10.40.72:5678        223.65.189.69:36560     SYN_SENT    22148/bitshares_cli
tcp        0      0 10.10.40.72:5678        107.170.30.182:5678     ESTABLISHED 22148/bitshares_cli
tcp        0      1 10.10.40.72:5678        171.105.59.67:5678      SYN_SENT    22148/bitshares_cli
tcp        0      1 10.10.40.72:5678        42.2.241.201:5678       SYN_SENT    22148/bitshares_cli
tcp        0      1 10.10.40.72:5678        112.64.144.162:5678     SYN_SENT    22148/bitshares_cli
tcp        0      1 10.10.40.72:5678        93.48.105.80:5678       SYN_SENT    22148/bitshares_cli

Right now it depends upon UPNP...

199
Keyhotee / please set rules for ID
« on: April 04, 2014, 03:48:36 am »
Please disable case sensitive!!
and some other rules for the ID, like disable space.
you can ask toast, he had make some  rules for the  domain name.
It's a good chance!
It's very bad with no rules.
at least we should disable space, I can register a ID of "bytemaster " or "bytemaster               "
who want a ID system like this?

and we should disable utf8 charset
because too much special charset, like chinese space: "bytemaster "

200
General Discussion / use git subtree to instead of git submodule
« on: March 21, 2014, 01:38:19 am »
Dan,  I am a little  confused with git submodule, mabe git subtree is more suitable for us?
Quote
https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt
git-subtree(1)
==============

NAME
----
git-subtree - Merge subtrees together and split repository into subtrees


SYNOPSIS
--------
[verse]
'git subtree' add -P <prefix> <commit>
'git subtree' add -P <prefix> <repository> <ref>
'git subtree' pull -P <prefix> <repository> <ref>
'git subtree' push -P <prefix> <repository> <ref>
'git subtree' merge -P <prefix> <commit>
'git subtree' split -P <prefix> [OPTIONS] [<commit>]


DESCRIPTION
-----------
Subtrees allow subprojects to be included within a subdirectory
of the main project, optionally including the subproject's
entire history.

For example, you could include the source code for a library
as a subdirectory of your application.

Subtrees are not to be confused with submodules, which are meant for
the same task. Unlike submodules, subtrees do not need any special
constructions (like .gitmodule files or gitlinks) be present in
your repository, and do not force end-users of your
repository to do anything special or to understand how subtrees
work. A subtree is just a subdirectory that can be
committed to, branched, and merged along with your project in
any way you want.

They are also not to be confused with using the subtree merge
strategy. The main difference is that, besides merging
the other project as a subdirectory, you can also extract the
entire history of a subdirectory from your project and make it
into a standalone project. Unlike the subtree merge strategy
you can alternate back and forth between these
two operations. If the standalone library gets updated, you can
automatically merge the changes into your project; if you
update the library inside your project, you can "split" the
changes back out again and merge them back into the library
project.

For example, if a library you made for one application ends up being
useful elsewhere, you can extract its entire history and publish
that as its own git repository, without accidentally
intermingling the history of your application project.

[TIP]
In order to keep your commit messages clean, we recommend that
people split their commits between the subtrees and the main
project as much as possible. That is, if you make a change that
affects both the library and the main application, commit it in
two pieces. That way, when you split the library commits out
later, their descriptions will still make sense. But if this
isn't important to you, it's not *necessary*. git subtree will
simply leave out the non-library-related parts of the commit
when it splits it out into the subproject later.

201
General Discussion / problem about bit asset amount
« on: March 05, 2014, 01:50:16 pm »
the data struct for amount of xts/bitasset is unit128
Code: [Select]
struct unit123{
      private:
          uint64_t hi;
          uint64_t lo;
  };
hi/lo has a limit with 2^64=18446744073709551616
here is the asset class
Code: [Select]
  asset::asset( float d, asset::type t )
  :unit(t)
  {
     amount = fc::uint128(double(d) * COIN,0);
  }
Code: [Select]
#define COIN                          (100000000ll)
so the amount has a limit about 2^64/COIN=184467440737
No problem to use this for amount of xfs, but It can't work with bitasset like bitusd.

202
中文 (Chinese) / 觉得bts攻击仍然未解决
« on: March 01, 2014, 09:49:33 am »

I have a laundry list of items that need to be addressed.  There have been a number of requests discussed in this thread and in the attack thread that are causing some delays.   Things I need to handle are:

1) Enforce minimal market depth.
2) Increase default collateral requirement to 10x.
3) Fix a bug where wallet loading errors erase wallet contents.
4) Cover a position without requiring additional capital.
针对bts交易攻击,以上是 bm 的4点修改计划。今天bm又提交了部分代码,市场深度是要求买单/卖单都有1%的xts。
Quote
Initial code for tracking market depth prior

Requires at least 1% of the shares to be on each side of the market
before automatic trading will execute for a given pair.
有几个问题:
1. 对xts有16个资产,如果想交易,买单卖单就要保证至少 32%的xts挂在市场上,不知道这样是否会压抑市场交易?
2. 这个市场深度好像无法有效保护攻击,有10%xts 就很可能发动攻击。
比如bitusd的买单,总共有4万个xts,要买4000万个bitusd。我先挂 1xts买 1万亿bitusd,再按10倍抵押,拿40万个xts,发行10亿亿个bitusd,把买单打穿,同时我的最低价成交,获得1万亿 bitusd。
实际攻击成本可能更低。在市场上bitusd买单本来就不多,比如 4千个xts的时候,我自己挂1个xts买1万亿bitusd,同时挂4万个xts买10亿亿bitusd(仅仅是为了满足市场深度的限制,不需要成交)。然后我只需要拿出10倍抵押,也就是4万个xts发行10亿亿bitusd,最后卖给自己1万亿。

我觉得解决办法应该抓住两个重点:
1. 对发行bitusd的卖单可以做延迟,比如1小时之后才能成交,这样买单会有博弈,发行的bitusd无法保证被自己拿到,增加攻击风险。
2. 对发行bitusd的价格可以做限制,比如涨跌幅度不能超过10倍。

203
新的白皮书下,系统有几点小变化比较意外:
1. 爆仓可能产生无法cover 的空头
2. 通过销毁xfs(交易费)达到分红的目的,但这样网络xfs总量会一直减少,不知是否有隐患。
3. 分红需要客户端做额外处理,二次运算才能得到持有的  xfs 数量
4. 交易撮合算法会销毁 bitusd,导致有些空头永远无法 cover

我又想了一个方案,可以理解为给BTS网络增加一个特殊账号,代表公司账户,我叫它robot。
这个账户实际是不存在,所有跟它有关的操作是在BTS代码内写死的。
1. 所有交易费及爆仓手续费,都是公司利润,不要销毁,应该转给 robot。
2. 所有因价格不匹配导致的价格差利润,不要销毁,转给robot。
3. 爆仓算法很简单,把抵押和空头直接转移给robot,空头由robot账户内对应的资产cover。

robot的资金可以看做大家的盈利,因为它减少流通了,它持有的越多,就代表大家盈利越多。
进一步,可以给 robot 制定一些市场规则,用来增加价格稳定性,比如:

涨幅超过10%时,成交算法中 robot 可以卖掉部分;超过20%,再卖部分。。。。
反之跌幅超过10%,则买


204
中文 (Chinese) / 再讨论下新白皮书的分红解决方案
« on: February 19, 2014, 01:43:01 am »
BTS网络可以赚取交易费盈利,从而给所有持有 xts  者分红。
所有被直接销毁的交易费就是BTS网络赚取的利润,因为xts总量减少,所以每个xts相对升值了。
客户端钱包显示的用户xts余额,实际上是 xts 数量*400万/(400万-总的销毁交易费)。为便于描述,我把单位定义为 yts吧。

下面问题就来了

比如我最开始挂了个单子,卖 1yts,换 1000 usd。这个单子一致没成交。现在 xts 分红了,总量只有399万了。
我这个卖单是继续 1yts 换 1000 usd,还是变成  400/399 yts 换100usd?
现在的代码中会按 400/399 yts 卖出去。就是把本该属于我的分红,通过降价转移到了买家那里。

经过和网友们讨论,yidaidaxie给出了一个方案,在成交算法中要考虑到分红。多出的 yts应退还给我。

除了成交算法,强制平仓里面也应该考虑这个因素,不要忽略分红导致的 xts 增值。

205
中文 (Chinese) / 有人准备在XT上买bitUSD吗?
« on: February 17, 2014, 10:46:03 am »
按照最新分配规则,如果XT失败,创建新的链会保证XT上BTS持有者的权益,按XT 上的BTS持有分配。
那么XT上作为担保的BTS以及直接持有的BTS,在新链上的价值是相同的。而XT上的bitUSD在新链上没任何价值。
这样的分配方式很明显,最大利益倾向作为抵押的BTS(因为它对应的债务全抵消了),其次是持有的BTS,而bitUSD最倒霉。
在这样的预期下,你会选择卖BTS换 bitUSD吗?你会在什么价位卖BTS?如果有人拿美金买BTS,你又会出什么价位呢?
又选择在什么价位发行bitUSD呢?

我愿意在10000bitUSD/bts 卖1个BTS,而200美金/bts的价格,我就愿意卖一部分BTS。
而仅仅在 10bitUSD/bts 价位发行bitUSD。

1. 在明显的不公平预期下,市场能达成共识吗?
2. 在这样的预期下,XT上的bitUSD能和美金挂钩吗?

206
中文 (Chinese) / 修改强制平仓算法
« on: February 17, 2014, 07:53:26 am »
I have an idea about margin call.
For example, I short 1000 usd with 2bts  backing.
when the price is up to 1000 usd /1.5  bts, margin call excute.
forced  execute  a buy order: buy 1000 usd with price 1000usd/1.5bts.
this buy order can not be cancel.
and 5% fee of bts will assessed.

the one who hold bitusd have two choice: sell bitusd with 1000usd/1.5bts, or hold continue to sell for more high price.

From this we can avoid to create bitusd with no backing.
比如我以2bts抵押发行了 1000 bitusd。
当bitusd涨到超过 1000 usd/1.5bts 时会执行强制平仓。
网络强制挂出一个买单:按  1000usd/1.5bts 的价格,买 1000 usd。
这个买单无法撤销。5% 的平仓费用被扣除。

持有bitusd的人有两种选择:按1000usd/1.5bts 价格卖掉获利;或者选择继续持有等待更高价格,当然风险自担。
这样能避免生成无抵押的 bitusd。

207
中文 (Chinese) / 再问爆仓算法
« on: February 16, 2014, 03:20:13 pm »
拿 bts /usd 市场看,假如现有很多买单了

10000 usd 0.01 bts/usd
800 usd 0.009 bts/usd
800 usd 0.008 bts/usd
.....

我先挂一个买单
100,000,000 usd 0.00000001 bts/usd
排在最末尾

然后我挂一个 short 操作
按 0.000000001 bts/usd 价格发行 1000,000,000 usd

是不是所有买单都能成交?大家都拿到了 bitusd,我自己也拿到了 100,000,000 bitusd。
然后下一次,我的 short 会被强制平仓,损失所有抵押的 1bts。

最终结果是 我会有1bts 抵押损失,留下大量 bitusd 空头,及 100,000,000 bitusd

208
中文 (Chinese) / 请教强制平仓的算法
« on: February 10, 2014, 12:28:13 am »
按白皮书所说,应该是按当前市场的最高买价判断是否需要强制平仓。
如果需要强制平仓,选取欠缺幅度最大的空头,用冻结的 bts 以当前市场上的卖单价强制成交。
问题是,如果当前市场上的卖单价很高,保证金不够用怎么办?甚至极端情况下,当前市场上根本就没有卖单呢?

Quote
User’s   who   do   not   negotiate   a   trade   ‘off   chain’   can   place   their   bids/asks   on   chain.   After   a   miner
has   processed   all   transactions   he   has   received,   he   will   pair   all   compatible   bids/asks   in   highest
bid   to   lowest   ask   order.   Once   all   trades   that   can   be   made   are   made,   the   block   chain   will   be   left
with   buy/sell   spread   of   unfulfilled   orders.   These   orders   represent   the   market   consensus   that   the
true   price   is   above   the   buy   and   below   the   sell.   At   this   point,   the   buy   price   is   checked   against
the   margin   requirements   of   all   short   positions   and   any   short   position   with   insufficient   margin   is
forced to accept the current sell price with the lowest margin position being executed first.
中文翻译
Quote
那些不愿意进行“离链”谈判的用户可以将他们的买卖单放入块链当中。当矿工处理完接受到的所有交易数据时,他会把所有相容的买卖单按最高的买入价和最低的卖出价顺序配对。一旦所有能够匹配的交易完成,块链会将剩下未履行的买卖单列表。这些订单表示市场的共识价格在在买入价和卖出价之间。这个时候,会根据买入价检查所有空头仓位的保证金要求,所有保证金不足的空头仓位都会按当前卖出价进行强制平仓,保证金欠缺幅度最大的空头仓位将被首先平掉。

209
中文 (Chinese) / 鲨鱼池作品:Bitshare Girl
« on: February 08, 2014, 02:06:44 pm »

“Everything in the world is about sex except sex. Sex is about power.”

― Oscar Wilde

在BitGirl 网络,每个女孩子可以把自己作为资产发布,包括:
1. BitGirlPic:此资产用来看女孩照片
2. BitGirlLive: 用来看女孩 liveshow
3. 其它自定义资产

其他人用 bts 购买这些资产后可以享受相应服务。

210
General Discussion / Bitshare Girl
« on: February 08, 2014, 01:48:36 pm »
“Everything in the world is about sex except sex. Sex is about power.”

― Oscar Wilde

In this chain, every girl can claim herself as a custom bitaccess, include:
1. BitGirlPic: use this  to watch the pictures.
2. BitGirlLive:   use this to watch the live show.
everyone can buy/sell these bitacces with bts to accept service

Pages: 1 ... 7 8 9 10 11 12 13 [14] 15 16