git ls-files | xargs wc -l
您正在查看: Surou 发布的文章
统计github本地仓库的代码行数
基于Bancor 算法两种资源互换的算法讲解
场景
BCS Token 购买 FF 资源
算法文字描述
FF Bancor 算法过程中,并不是将 BCS 和 FF 直接用价格曲线进行兑换,而是引入了中间 token——FFCORE,对应于 Bancor 中的 Smart Token。
BCS 到 FF 的兑换过程就涉及了两个公式,所以上文中用一个公式来举例就很不严谨,只是为了定性的说明价格特性。
从代码中可看到BCS与FFCORE的兑换公式为:
其中,E为BCS到FFCORE所能兑换的数量,R是FFCORE的初始发行总量,C1为当前BCS余量,T1为用于购买的FF数量,F为常量参数
将上述公式的进行反向整理设计,即可得到FFCORE与交易额的兑换公式为:
其中,T2是准备购入的FF数量;C2为可分配的FF余量。将中间变量E代入即可得出用于购买的BCS数量(T1)与可兑换到的FF数量(T2)之间的关系。
为方便直观的理解,可以对公式进行简化,得到:
可以看到随着可买FF余量(C2)的降低或者BCS数量(C1)的增多,FF的价格会加速增长(即同样付出T1的BCS下,可换取到的FF数量T2变少了)
cleos get table name,无法精准定位
当get table索引是name 时,无法精准查询
因为cleos 传入的参数默认是字符串,需要对应的转换参数
--key-type name
例如
cleos -u https://api.eosnewyork.io:443 get table eosio eosio voters --key-type name -L 111111111122 -l 1
参考
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
执行命令查看输出log
mysqld --console
D:\Program Files\mysql-8.0.19-winx64>mysqld --console
2020-04-03T03:29:17.907577Z 0 [System] [MY-010116] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe (mysqld 8.0.19) starting as process 4772
2020-04-03T03:29:17.909125Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2020-04-03T03:29:19.799340Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-04-03T03:29:19.819720Z 0 [System] [MY-010931] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe: ready for connections. Version: '8.0.19' socket: '' port: 0 MySQL Community Server - GPL.
2020-04-03T03:29:19.822756Z 0 [ERROR] [MY-010131] [Server] TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS
2020-04-03T03:29:19.825137Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-04-03T03:29:19.878167Z 0 [Warning] [MY-011311] [Server] Plugin mysqlx reported: 'All I/O interfaces are disabled, X Protocol won't be accessible'
2020-04-03T03:29:20.525948Z 0 [System] [MY-010910] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.19) MySQL Community Server - GPL.
关键错误
TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS
解决方案
修改my.ini
,添加shared-memory
2059 – 身份验证插件’caching_sha2_password’-navicat连接异常
这个问题是由于我的MySQL的的的更新至8版本以上了,在安装的时候我并没有指定用户登入密码加密方式,所以默认被设置为caching_sha2_password
解决方法:
mysql> show variables like 'default_authentication_plugin';
Variable_name | Value |
---|---|
default_authentication_plugin | caching_sha2_password |
查看本地mysql用户的信息
mysql> select host,user,plugin from mysql.user;
host | user | plugin |
---|---|---|
localhost | mysql.infoschema | caching_sha2_password |
localhost | mysql.session | caching_sha2_password |
localhost | mysql.sys | caching_sha2_password |
localhost | root | caching_sha2_password |
注意 caching_sha2_password, 只修改root的密码加密方式就可以了
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
mysql> select host,user,plugin from mysql.user;
host | user | plugin |
---|---|---|
localhost | mysql.infoschema | caching_sha2_password |
localhost | mysql.session | caching_sha2_password |
localhost | mysql.sys | caching_sha2_password |
localhost | root | mysql_native_password |
最新回复
fzd: 请问这个解决了吗
StarkWare explained: layer 2 solution provider of dYdX and iMMUTABLE R11; BitKeep News: [...]Layer 2: https://...
一文读懂 StarkWare:dYdX 和 Immutable 背后的 L2 方案 R11; BitKeep 博客: [...]Layer 2:Comparing Laye...
http://andere.strikingly.com/: Regards, Great stuff!
surou: 需要先执行提案合约申请,等待出块节点地址同意后,才会进...
heco: WARN [11-19|11:26:09.459] N...
P: 你好,我在heco链上遇到了“tx fee excee...
Peng: 楼主安装成功了吗?我正在同步区块链,一天了,差不多才同...
joyhu: 你好,请问下安装好之后如何获取到bee.yaml配置文...
kaka: 支票最终怎么提币呢?
归档
April 2024March 2024January 2024December 2023November 2023October 2023September 2023August 2023July 2023June 2023April 2023March 2023February 2023January 2023December 2022November 2022October 2022August 2022July 2022June 2022May 2022March 2022February 2022January 2022December 2021November 2021October 2021September 2021August 2021July 2021June 2021May 2021April 2021March 2021February 2021January 2021December 2020November 2020October 2020September 2020July 2020June 2020May 2020April 2020March 2020February 2020January 2020December 2019November 2019October 2019September 2019August 2019July 2019June 2019May 2019April 2019March 2019February 2019January 2019December 2018November 2018October 2018September 2018August 2018July 2018June 2018