tail -f命令可以查看文件更新的记录,但是在wsl中,可能无法正常工作。
经查找发现,Linux是通过inotify来获取文件变动的,但是不知道是bug还是什么原因,感知不到文件变动,造成此问题。
解决方案:
tail -f ---disable-inotify info.log
tail -f命令可以查看文件更新的记录,但是在wsl中,可能无法正常工作。
经查找发现,Linux是通过inotify来获取文件变动的,但是不知道是bug还是什么原因,感知不到文件变动,造成此问题。
解决方案:
tail -f ---disable-inotify info.log
通过cleos 查询账户RAM余额
cleos -u http://127.0.0.1:8888 get account zer41iyhahwp
...
memory:
quota: 9.366 KiB used: 3.078 KiB
但实际创建账户时,RAM购买量为8192
byte
通过查询用户资源表
cleos -u http://127.0.0.1:8888 get table bitconch zer41iyhahwp userres
$ cleos -u http://127.0.0.1:8888 get table eosio zer41iyhahwp userres
{
"rows": [{
"owner": "zer41iyhahwp",
"net_weight": "10.00000000 EOS",
"cpu_weight": "10.00000000 EOS",
"ram_bytes": 8191
}
],
"more": false
}
ram_bytes
的数据与创建时RAM数据基本(所差1byte是因为,购买RAM通过Bancor估价代币购买,会与实际少许误差)一致。那cleos查出的数据差距在哪?下面跟下系统合约源代码
set_resource_limits( res_itr->owner, res_itr->ram_bytes + ram_gift_bytes, net, cpu );
发现设置资源的位置加上附加的ram_gift_bytes
ram_gift_bytes
具体数值(跳转github)static constexpr int64_t ram_gift_bytes = 1400;
所以,查询账户RAM比实际购买多的部分为合约设置时赠送的部分(忽略运算误差)。
9.366 KiB = 8191 byte + 1400 byte
数据库中只保留最新的100条记录,旧纪录删除
// 最多100条
besthistory_tables besthistory_table(_self, _self.value);
total_count = 0;
auto itr_besthistory = besthistory_table.rbegin();
while(itr_besthistory != besthistory_table.rend()){
if(total_count >= 99){
auto itr = besthistory_table.erase(--itr_besthistory.base());
itr_besthistory = std::reverse_iterator(itr);
} else {
total_count++;
itr_besthistory++;
}
}
今天EOSIO官方开发提交的(New options for api nodes - 2.0) 审核通过了。
允许评估通过p2p 网络接收的事务(如果有效)
默认值true
允许评估和中继API事务(如果有效)
默认值true
在“投机”模式下:数据库包含区块链中的交易状态变化,直到头块以及尚未包含在区块链中的某些交易。
数据库仅通过区块链中直到头部的交易包含状态更改; 如果有效,将中继节点接收到的事务。
p2p-accept-transactions = false
api-accept-transactions = true
数据库仅包含区块链中直到主块的事务的状态更改;
通过P2P网络接收到的交易不会被中继,并且无法通过链API推送交易。
(不推荐使用此模式:可使用 p2p-accept-transactions和api-accept-transactions同为false代替)
数据库仅包含区块链中直到最后一个不可逆块的事务的状态更改;
通过P2P网络接收到的交易不会被中继,并且无法通过链API推送交易。
p2p-accept-transactions = false
api-accept-transactions = false
当read-only
和irreversible
模式下,api-accept-transactions
和p2p-accept-transactions
会强制修改为false
.
此时 2.0.4 以支持此更新
https://github.com/EOSIO/eos/releases/tag/v2.0.4
在read-only该选项read-mode的参数nodeos已被弃用。这是可能实现与相同的行为read-mode = head,p2p-accept-transactions = false和api-accept-transactions = false
使用read-mode = irreversiblenow需要进行设置p2p-accept-transactions = false并api-accept-transactions = false避免在启动时进行断言