努力赚钱
将来的你一定会感谢现在努力的自己!

Etica CLI如何使用 Etica 命令行

Spacemesh-浏览器

全球最大交易所币安

国区邀请链接:https://accounts.suitechsui.cloud/zh-CN/register?ref=16003031 支持86手机号码,网页直接注册。

全球最大交易所币安

国区邀请链接:https://accounts.suitechsui.cloud/zh-CN/register?ref=16003031 支持86手机号码,网页直接注册。

目前不清退的交易所推荐:

1、全球第二大交易所OKX欧意

国区邀请链接: https://www.litesther.com/zh-hans/join/1837888   币种多,交易量大!

国际邀请链接:https://www.okx.com/join/1837888 注册简单,交易不需要实名,新用户能开合约,币种多,交易量大!

2、老牌交易所比特儿现改名叫芝麻开门 :https://www.gateex.cc/signup/XgRDAQ8?ref_type=103  注册成功之后务必在网页端完成 手机号码绑定,大陆号码输入+086即可 ,实名认证。推荐在APP端实名认证初级+高级更方便上传。网页端也可以实名认证。

2、全球最大交易所币安

国区邀请链接:https://accounts.suitechsui.cloud/zh-CN/register-person?ref=16003031&registerChannel=goose 支持86手机号码,网页直接注册。

国际邀请链接https://accounts.binance.com/zh-CN/register?ref=16003031币安注册不了IP地址用香港,居住地选香港,认证照旧,邮箱推荐如gmail、outlook。支持币种多,交易安全!

币安最新国区域名,哪个能用用哪个

更新日期 网址 备注
2022/08/31

www.bianreggroup.com

验证
2022/08/31

www.bianreg.net

验证
2022/08/31

www.binancezh.live

验证
2022/08/31

www.binancezh.biz

验证
2022/08/31

www.binancezh.top

验证
2022/08/20

www.binance.info

验证
2022/08/20

www.binancezh.jp

验证
2022/08/20

www.binancezh.sh

验证

其余域名受到不同程度的污染,导致部分区域无法访问,因此建议使用上面的可用域名

买好币上KuCoinhttps://www.kucoin.com/r/af/1f7w3CoinMarketCap前五的交易所,注册友好操简单快捷!

TraderWagon币安带单:https://www.traderwagon.com/zh-CN/register?ref=zoh4gfu

Bybit最高 $1,020 等您领取 $20 体验金和价值最高 $1,000 的福利卡:https://partner.bybit.com/b/49808

启动控制台

为了启动控制台并开始使用 Etica 命令行:1. 打开第二个 linux 终端
2. 移动到区块链的 core-geth 文件夹
3. 确保您的节点正在另一个窗口上运行并输入此命令以启动控制台:

./build/bin/geth attach

If it doesn't work, type: 
./build/bin/geth attach http://127.0.0.1:8545 
(replace http://127.0.0.1:8545 by the rpc url of your node if different) 
                                        

加载 Etica 智能合约

为了通过命令行与 Etica 智能合约进行交互,在这一部分中,我们将解释如何在第二个窗口上启动控制台并加载 Etica 智能合约1. 打开第二个 linux 终端
2. 移动到区块链的 core-geth 文件夹
3. 确保您的节点正在另一个窗口上运行并输入此命令以加载 etica 智能合约:

var abi = [{"constant":true,"inputs":[],"name":"PERIOD_EDITOR_REWARD_RATIO","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"supply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"tokens","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"PROPOSERS_INCREASER","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"diseasesbyIds","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastRewardEthBlockNumber","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getMiningDifficulty","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"nonce","type":"uint256"},{"name":"challenge_digest","type":"bytes32"}],"name":"mint","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"IntervalsPeriodsCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"accessibleSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"tokens","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"STAKING_DURATION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"chunksCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getMiningTarget","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"proposals","outputs":[{"name":"id","type":"uint256"},{"name":"proposed_release_hash","type":"bytes32"},{"name":"disease_id","type":"bytes32"},{"name":"period_id","type":"uint256"},{"name":"chunk_id","type":"uint256"},{"name":"proposer","type":"address"},{"name":"title","type":"string"},{"name":"description","type":"string"},{"name":"freefield","type":"string"},{"name":"raw_release_hash","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"proposalsbyIndex","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DISEASE_CREATION_AMOUNT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DEFAULT_VOTING_TIME","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"LAST_PERIOD_COST_UPDATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DEFAULT_REVEALING_TIME","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"APPROVAL_THRESHOLD","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_totalMiningSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"uint256"}],"name":"diseasechunks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"diseases","outputs":[{"name":"disease_hash","type":"bytes32"},{"name":"name","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getMiningReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"propsdatas","outputs":[{"name":"starttime","type":"uint256"},{"name":"endtime","type":"uint256"},{"name":"finalized_time","type":"uint256"},{"name":"status","type":"uint8"},{"name":"prestatus","type":"uint8"},{"name":"istie","type":"bool"},{"name":"nbvoters","type":"uint256"},{"name":"slashingratio","type":"uint256"},{"name":"forvotes","type":"uint256"},{"name":"againstvotes","type":"uint256"},{"name":"lastcuration_weight","type":"uint256"},{"name":"lasteditor_weight","type":"uint256"},{"name":"approvalthreshold","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getChallengeNumber","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"UNRECOVERABLE_ETI","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"bosoms","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"stakes","outputs":[{"name":"amount","type":"uint256"},{"name":"endTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"initiatormsg","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"chunks","outputs":[{"name":"id","type":"uint256"},{"name":"diseaseid","type":"bytes32"},{"name":"idx","type":"uint256"},{"name":"title","type":"string"},{"name":"desc","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"REWARD_INTERVAL","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"uint256"}],"name":"diseaseproposals","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokensMinted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"diseasesCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastRewardTo","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"SEVERITY_LEVEL","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"tokenOwner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"bytes32"}],"name":"commits","outputs":[{"name":"amount","type":"uint256"},{"name":"timestamp","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"nonce","type":"uint256"},{"name":"challenge_digest","type":"bytes32"},{"name":"challenge_number","type":"bytes32"},{"name":"testTarget","type":"uint256"}],"name":"checkMintSolution","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"epochCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"diseaseProposalsCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_MAXIMUM_TARGET","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"IntervalsPeriods","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"miningTarget","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"challengeNumber","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"address"}],"name":"votes","outputs":[{"name":"proposal_hash","type":"bytes32"},{"name":"approve","type":"bool"},{"name":"is_editor","type":"bool"},{"name":"amount","type":"uint256"},{"name":"voter","type":"address"},{"name":"timestamp","type":"uint256"},{"name":"is_claimed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"nonce","type":"uint256"},{"name":"challenge_digest","type":"bytes32"},{"name":"challenge_number","type":"bytes32"}],"name":"getMintDigest","outputs":[{"name":"digesttest","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PROPOSAL_DEFAULT_VOTE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proposalsCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"tokens","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"PERIOD_CURATION_REWARD_RATIO","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_BLOCKS_PER_READJUSTMENT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"inflationrate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERIODS_PER_THRESHOLD","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"name":"chunkproposals","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"stakesAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"latestDifficultyPeriodStarted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"blockreward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PeriodsIssuedCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"periodrewardtemp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"stakesCounters","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"periodsCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_MINIMUM_TARGET","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"tokenOwner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"chunkProposalsCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"diseaseChunksCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PROTOCOL_RATIO_TARGET","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"periods","outputs":[{"name":"id","type":"uint256"},{"name":"interval","type":"uint256"},{"name":"curation_sum","type":"uint256"},{"name":"editor_sum","type":"uint256"},{"name":"reward_for_curation","type":"uint256"},{"name":"reward_for_editor","type":"uint256"},{"name":"forprops","type":"uint256"},{"name":"againstprops","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"PeriodsIssued","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"blockedeticas","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"period_id","type":"uint256"},{"indexed":false,"name":"interval","type":"uint256"}],"name":"CreatedPeriod","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"diseaseindex","type":"uint256"},{"indexed":false,"name":"title","type":"string"}],"name":"NewDisease","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposed_release_hash","type":"bytes32"},{"indexed":true,"name":"_proposer","type":"address"},{"indexed":true,"name":"diseasehash","type":"bytes32"},{"indexed":true,"name":"chunkid","type":"uint256"}],"name":"NewProposal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"chunkid","type":"uint256"},{"indexed":true,"name":"diseasehash","type":"bytes32"}],"name":"NewChunk","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"voter","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"proposal_hash","type":"bytes32"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"voter","type":"address"},{"indexed":false,"name":"fee","type":"uint256"},{"indexed":false,"name":"proposal_hash","type":"bytes32"}],"name":"NewFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"voter","type":"address"},{"indexed":false,"name":"duration","type":"uint256"},{"indexed":false,"name":"proposal_hash","type":"bytes32"}],"name":"NewSlash","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_voter","type":"address"},{"indexed":false,"name":"votehash","type":"bytes32"}],"name":"NewCommit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_voter","type":"address"},{"indexed":true,"name":"_proposal","type":"bytes32"}],"name":"NewReveal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"staker","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"NewStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"staker","type":"address"},{"indexed":false,"name":"stakeamount","type":"uint256"}],"name":"StakeClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"tokens","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tokenOwner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"tokens","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"blockreward","type":"uint256"},{"indexed":false,"name":"epochCount","type":"uint256"},{"indexed":false,"name":"newChallengeNumber","type":"bytes32"}],"name":"Mint","type":"event"},{"constant":false,"inputs":[{"name":"_staker","type":"address"},{"name":"_amount","type":"uint256"}],"name":"eticatobosoms","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_stakeidx","type":"uint256"}],"name":"stakeclmidx","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_endTime","type":"uint256"},{"name":"_min_limit","type":"uint256"},{"name":"_maxidx","type":"uint256"}],"name":"stakescsldt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_stakeidx","type":"uint256"},{"name":"_snapamount","type":"uint256"}],"name":"stakesnap","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_staker","type":"address"}],"name":"stakescount","outputs":[{"name":"slength","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"createdisease","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_diseasehash","type":"bytes32"},{"name":"_title","type":"string"},{"name":"_description","type":"string"},{"name":"raw_release_hash","type":"string"},{"name":"_freefield","type":"string"},{"name":"_chunkid","type":"uint256"}],"name":"propose","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"updatecost","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"},{"name":"_votehash","type":"bytes32"}],"name":"commitvote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_proposed_release_hash","type":"bytes32"},{"name":"_approved","type":"bool"},{"name":"_vary","type":"string"}],"name":"revealvote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_proposed_release_hash","type":"bytes32"}],"name":"clmpropbyhash","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_diseasehash","type":"bytes32"},{"name":"_title","type":"string"},{"name":"_description","type":"string"}],"name":"createchunk","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"tokenOwner","type":"address"}],"name":"bosomsOf","outputs":[{"name":"_bosoms","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"string"}],"name":"getdiseasehashbyName","outputs":[{"name":"_diseasehash","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}] 

4.粘贴该行并按Enter

5. 加载 Etica 智能合约的地址:

var address = 0x34c61EA91bAcdA647269d4e310A86b875c09946f;

6. 加载 Etica 智能合约:

var EticaContract = web3.eth.contract(abi).at("0x34c61EA91bAcdA647269d4e310A86b875c09946f");

调用 Etica 智能合约 GET 函数

获取地址的 ETI 余额:

web3.fromWei(EticaContract.balanceOf('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

获取地址的怀余额:

web3.fromWei(EticaContract.bosomsOf('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

获取地址的 ETI 质押:

web3.fromWei(EticaContract.stakesAmount('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

将 ETI 锁定在地址的投票系统中:

web3.fromWei(EticaContract.blockedeticas('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

获取地址的权益数量:

EticaContract.stakescount('0x2a674CC92dE583590f96135F6259553EaAABeD28');

获取地址的权益数量:

EticaContract.stakesCounters('0x2a674CC92dE583590f96135F6259553EaAABeD28');

获得地址的第 n 个股份:

EticaContract.stakes('0x2a674CC92dE583590f96135F6259553EaAABeD28', 1); // Get 1st stake of address '0x2a674CC92dE583590f96135F6259553EaAABeD28'
EticaContract.stakes('0x2a674CC92dE583590f96135F6259553EaAABeD28', 2); //  Get 2nd stake of address '0x2a674CC92dE583590f96135F6259553EaAABeD28'
EticaContract.stakes('0x2a674CC92dE583590f96135F6259553EaAABeD28', 3); // Get 3rd stake of address '0x2a674CC92dE583590f96135F6259553EaAABeD28'
// returns stake if exists:
// returned array result correspond to this:
// struct Stake{
//  uint amount; // stake amount in ETI wei (need to divide by 10^18 to get ETI amount)
//  uint endtime; // timestamp in second of when the stake becomes claimable
// }
        

从地址和提交哈希获取提交:

EticaContract.commits('0x2a674CC92dE583590f96135F6259553EaAABeD28', '0xzoiin85suhduih45zuhziuhzhi'); // replace 0x2a674CC92dE583590f96135F6259553EaAABeD28 by an address and 0xzoiin85suhduih45zuhziuhzhi with your commit hash
// returns commit if exists:
// returned array result correspond to this:
// struct Commit{
//  uint amount;
//  uint timestamp; // epoch time of the vote
// }
        

通过特定地址对提案进行投票:
备注:一旦提交被披露,它就会成为被考虑的实际投票。否则提交不会成为投票

EticaContract.votes('0x2a979a78e48bba15ec0586eeeb4029dd361ff4b844b00c9ba22a78184c558c23', '0x2a674CC92dE583590f96135F6259553EaAABeD28'); // Get vote on Proposal '0x2a979a78e48bba15ec0586eeeb4029dd361ff4b844b00c9ba22a78184c558c23'  by address '0x2a674CC92dE583590f96135F6259553EaAABeD28'
// returns vote if exists:
// returned array result correspond to this:
// struct Vote{
//  bytes32 proposal_hash; // proposed_release_hash of proposal
//  bool approve;
//  bool is_editor;
//  uint amount;
//  address voter; // address of the voter
//  uint timestamp; // epoch time of the vote
//  bool is_claimed; // keeps track of whether or not vote has been claimed to avoid double claim on same vote
// }
        

获取当前的采矿挑战编号:

EticaContract.challengeNumber();

获取当前挖矿难度:

EticaContract.getMiningDifficulty();

获取开采的 ETI 区块总数:

EticaContract.epochCount();

获取当前的批准阈值:

EticaContract.APPROVAL_THRESHOLD();
// returns current approval threshold in integer format
// example: 5030 means 50.30%, 6324 means 60.24% ...
        

获取 ETI 供应:

web3.fromWei(EticaContract.supply(), 'ether');
// (Note: Actual ETI circulating supply is less because this shows total ETI ever issued 
// without taking into account eti burnt by fees, diseases creation ...)          
        

获得曾经开采的总 ETI:

web3.fromWei(EticaContract._totalMiningSupply(), 'ether');
// (Note: doesn't take into account ETI issued for research rewards ...) 
// ETI for research rewards are not mined but issued for each new period         
        

获取当前区块奖励:

web3.fromWei(EticaContract.getMiningReward(), 'ether');

获取最后一个 ETI 矿工地址:

EticaContract.lastRewardTo();

获取上一个 ETI 铸币厂的区块号:

EticaContract.lastRewardEthBlockNumber();

获取疾病数量:

EticaContract.diseasesCounter();

按名称获取疾病哈希:

EticaContract.getdiseasehashbyName('Malaria');
// returns disease's hash if name exists
        

通过哈希获取疾病指数:

EticaContract.diseasesbyIds('0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e');
// returns disease index if hash exists
        

按指数得病:

EticaContract.diseases(1);
EticaContract.diseases(2);
...
// returns disease if index exists, the max index is number of diseases
// number of diseases can be obtained with diseasesCounter() function above
        

获取疾病的提案数量:

EticaContract.diseasesProposalsCounter();

得病第n个提案:

EticaContract.diseaseproposals('0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e', 1); // Get 1st proposal of disease '0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e' 
EticaContract.diseaseproposals('0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e', 2); // Get 2nd proposal of disease '0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e'
...
// returns the proposal's hash if proposal exists, the max index is number of proposals for specified disease
// number of proposals can be obtained with diseaseProposalsCounter() function above
        

获取疾病的块数:

EticaContract.diseasesChunksCounter();

获取疾病的块:

EticaContract.diseasechunks('0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e', 1); // Get 1st chunk of disease '0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e' 
EticaContract.diseasechunks('0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e', 2); // Get 2nd chunk of disease '0xf6d8716087544b8fe1a306611913078dd677450d90295497e433503483ffea6e'
...
// returns the chunk's ID if chunk exists, the max index is number of chunks for specified disease
// number of chunks can be obtained with diseaseChunksCounter() function above
        

获取块数:

EticaContract.chunksCounter();

按索引获取块:

EticaContract.chunks(1);
EticaContract.chunks(2);
...
// returns chunk if index exists, the max index is number of chunks
// result array conrrespond to this:
// struct Chunk{
//  uint id;
//  bytes32 diseaseid; // hash of the disease
//  uint idx;
//  string title;
//  string desc;
// }
// number of chunks can be obtained with chunksCounter() function above
        

通过索引获取块的提案:(
为块提交的提案)

EticaContract.chunkproposals(1,1); // get 1st chunk's 1st proposal
// EticaContract.chunkproposals(1,2); // get 1st chunk's 2nd proposal
// EticaContract.chunkproposals(2,1); // get 2nd chunk's 1st proposal
...
// returns proposal hash
        

获取区块的提案数量:(
为区块提交的提案数量)

EticaContract.chunkProposalsCounter(1); // get chunk number of  (1 is chunk_id)
EticaContract.chunkProposalsCounter(2); // get chunk number of proposals (2 is chunk_id)
...
// returns chunk number of proposals
          

获取提案数量:

EticaContract.proposalsCounter();

按索引获取提案哈希:

EticaContract.proposalsbyIndex(1);
EticaContract.proposalsbyIndex(2);
...
// returns proposal's hash if index exists, the max index is number of proposals
// number of proposals can be obtained with proposalsCounter() function above
        

通过哈希获取提案:

EticaContract.proposals('0x2a979a78e48bba15ec0586eeeb4029dd361ff4b844b00c9ba22a78184c558c23');
EticaContract.proposals('0xc2328b05d5833bbf24ecbabb6b6ad203560e4809de79cfd24b98ca7775207f4c');
...
// returns proposal if hash exists (hash can be obtained with proposalsbyIndex() function above)
// result array conrrespond to this:
//struct Proposal{
//  uint id;
//  bytes32 proposed_release_hash; // Hash of "raw_release_hash + name of Disease"
//  bytes32 disease_id;
//  uint period_id;
//  uint chunk_id;
//  address proposer; // address of the proposer
//  string title; // Title of the Proposal
//  string description; // Description of the Proposal
//  string freefield;
//  string raw_release_hash;
// }
        

通过 Hash 获取提案数据:

EticaContract.propsdatas('0x2a979a78e48bba15ec0586eeeb4029dd361ff4b844b00c9ba22a78184c558c23');
EticaContract.propsdatas('0xc2328b05d5833bbf24ecbabb6b6ad203560e4809de79cfd24b98ca7775207f4c');
...
// returns proposal if hash exists (hash can be obtained with proposalsbyIndex() function above)
// result array conrrespond to this:
// struct ProposalData{

// uint starttime; // epoch time of the proposal
//  uint endtime;  // voting limite
//  uint finalized_time; // when first clmpropbyhash() was called
//  ProposalStatus status; // Only updates once, when the voting process is over
//  ProposalStatus prestatus; // Updates During voting process
//  bool istie;  // will be initialized with value 0. if prop is tie it won't slash nor reward participants
//  uint nbvoters;
//  uint slashingratio; // solidity does not support float type. So will emulate float type by using uint
//  uint forvotes;
//  uint againstvotes;
//  uint lastcuration_weight; // period curation weight of proposal
//  uint lasteditor_weight; // period editor weight of proposal
//  uint approvalthreshold; // proposal approvalthreshold
// }
        

获取周期数(至少有一个提案的周数):

EticaContract.periodsCounter();

从其索引中获取期间:

EticaContract.periods(1);
EticaContract.periods(2);          
...
// returns period if index exists, the max index is number of periods
// result array conrrespond to this:
// struct Period{
//  uint id;
//  uint interval;
//  uint curation_sum; // used for proposals weight system
//  uint editor_sum; // used for proposals weight system
//  uint reward_for_curation; // total ETI issued to be used as Period reward for Curation
//  uint reward_for_editor; // total ETI issued to be used as Period reward for Editor
//  uint forprops; // number of accepted proposals in this period
//  uint againstprops; // number of rejected proposals in this period
// }
// number of periods can be obtained with periodsCounter() function above
        

进行交易

为了使用命令行进行交易,您需要完成第 1 步(启动控制台并加载 Etica 智能合约)。如果您还没有,请执行第 1 步,然后返回此处

1.通过运行以下命令解锁您的帐户
:(用您的地址替换“0x5oyf640557999a82aa1fe7c92d06b628f352C845”,用您地址的密码替换“Ge852zUoik52hyfl8521Kbsgq”)

web3.personal.unlockAccount('0x5oyf640557999a82aa1fe7c92d06b628f352C845', 'Ge852zUoik52hyfl8521Kbsgq')

确保检查您的账户 EGAZ 余额,如果没有足够的 EGAZ txs 将被拒绝:

web3.fromWei(web3.eth.getBalance('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether')

现在您已准备好使用解锁帐户进行交易

转移ETI (获得胸部)

先决条件:在您的地址上有 ETI。

检查 ETI 余额:

web3.fromWei(EticaContract.balanceOf('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

此命令将 1.5 ETI 从 ‘0x2a674CC92dE583590f96135F6259553EaAABeD28’ 转移到地址 ‘0xeD2fA378d1311A9C4527b235b74a2e66A1c396d4’:
更改数量替换 web3.toWei(‘1.5’, ‘ether’) 中的 1.5

EticaContract.transfer('0xeD2fA378d1311A9C4527b235b74a2e66A1c396d4', web3.toWei(1.5, 'ether'), {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000});

Stake ETI (获得胸部)

先决条件:在您的地址上有 ETI。

检查 ETI 余额:

web3.fromWei(EticaContract.balanceOf('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

此命令质押 1.2 ETI:
更改金额替换 web3.toWei(‘1.2’, ‘ether’) 中的 1.2

EticaContract.eticatobosoms('0x2a674CC92dE583590f96135F6259553EaAABeD28', web3.toWei('1.2', 'ether'), {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})

制造疾病

先决条件:您的地址上至少有 100 个 ETI。

检查 ETI 余额:

web3.fromWei(EticaContract.balanceOf('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

此命令会将疾病 Malaria 添加到网络:(
由于 Malaria 已经存在,因此不会通过 Tx,但您可以创建尚未添加到网络的任何疾病)

EticaContract.createdisease('Malaria', {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})

创建块

先决条件:您的地址上至少有 5 个 ETI。

检查 ETI 余额:

web3.fromWei(EticaContract.balanceOf('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

此命令将块添加到疾病:

(以下命令不会通过,因为您需要将“diseasehashhere”替换为 Etica Blockchain 疾病的哈希值之一。)
不要忘记用新的块标题和描述替换“测试块”和“测试块描述”

EticaContract.createchunk('diseasehashhere','Test chunk', 'Test chunk description', {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})

提交提案

先决条件:您的地址上至少有 10 个胸部。

检查 BOSOMS 余额:

web3.fromWei(EticaContract.bosomsOf('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

a) 此命令将向疾病提交提案(没有特定块):

(以下命令不会通过,因为您需要将“diseasehashhere”替换为 Etica Blockchain 疾病的哈希值之一。)
此外,您需要将“IPFSHASHHERE”替换为您的提案 IPFS 哈希
不要忘记替换“测试提案”和“测试”提案描述’由您的提案标题和描述

EticaContract.propose('diseasehashhere','Proposal title', 'Proposal description', 'IPFS hash here', 'Freefield add additional info here',0, {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:1000000})

b) 为特定块向疾病提交提案:

验证您的块 id 对应于正确的块:

EticaContract.chunks(1)   // replace 1 by your chunk id
// results correspond to this:
//struct Chunk{
//  uint id;  // id of the chunk at protocol level
//  bytes32 diseaseid; // hash of the disease
//  uint idx; // index of the chunk within the disease. For instance if the chunk was the 4th chunk added to this disease this index value will be 4
//  string title;
//  string desc;   // description
//}
                                    

如果块 ID 是正确的,则使用以下命令创建提案:
替换字段(对于块 ID 替换为数字而不是字符串,例如,如果块 ID 为 1,则替换为 1 而不是“1”)

EticaContract.propose('diseasehashhere','Proposal title', 'Proposal description', 'IPFS hash here', 'Freefield add additional info here',chunkid, {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:1000000})

提交投票

先决条件:您的地址上至少有一些 BOSOMS 并计算了投票的哈希值:

检查 BOSOMS 余额:

web3.fromWei(EticaContract.bosomsOf('0x2a674CC92dE583590f96135F6259553EaAABeD28'), 'ether');

以下是如何获取您的投票提交的哈希值:
如何计算投票哈希值

此命令将为提交哈希 ‘0x524e9b9941ea6bfb289ec7d0f90c4b744906d579d982134b40a1e6c52fd42a81’ 进行价值 1.18 ETI 的投票提交:

EticaContract.commitvote(web3.toWei('1.18', 'ether'), '0x524e9b9941ea6bfb289ec7d0f90c4b744906d579d982134b40a1e6c52fd42a81', {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})
// note you can increase your commits. To increase just make a new commit to same hash                                                
                                              

检查提交:
用你的地址
替换 0x2a674CC92dE583590f96135F6259553EaAABeD28 用你的投票哈希替换 0x524e9b9941ea6bfb289ec7d0f90c4b744906d579d982134b40a1e6c52fd42a81

EticaContract.commits('0x2a674CC92dE583590f96135F6259553EaAABeD28', '0x524e9b9941ea6bfb289ec7d0f90c4b744906d579d982134b40a1e6c52fd42a81')

显示投票

先决条件:提案必须处于揭示阶段,并且您必须对该提案进行投票。

此命令显示投票:

(以下命令不会通过,因为您需要将 ‘0x0123197fdd119eb692e5c2c8a29b27ed6abc9b298eda52c828f61624b1ca4a6e’ 替换为提案的哈希值。)
如果您投票支持该提案,请将 false 替换为 true。将 ‘secretphrasehere’ 替换为您的密码短语,如果此投票提交没有密码短语,则将其留空

EticaContract.revealvote('0x0123197fdd119eb692e5c2c8a29b27ed6abc9b298eda52c828f61624b1ca4a6e',false,'', {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})

索赔提案

先决条件:该提案必须已通过其披露阶段,并且您必须已经对该提案进行了重新投票。

该命令要求投票:

(用提案的哈希替换 ‘0x0123197fdd119eb692e5c2c8a29b27ed6abc9b298eda52c828f61624b1ca4a6e’。)

EticaContract.clmpropbyhash('0x0123197fdd119eb692e5c2c8a29b27ed6abc9b298eda52c828f61624b1ca4a6e', {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})

认领股权

先决条件:该提案必须已通过其披露阶段,并且您必须已经对该提案进行了重新投票。

此命令要求权益:

 

EticaContract.stakeclmidx(1, {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})   // this command claims your stake whose index is 1
EticaContract.stakeclmidx(2, {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})   // this command claims your stake whose index is 2                                        
                                      

股权整合

先决条件:你需要在你的地址上有几个股份。

此命令合并权益(减少权益总数):

 

EticaContract.stakescsldt(_endTime, _min_limit, _maxidx, {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})   // this command cconsolidate your stakes

股权快照

先决条件:没有先决条件,你只需要至少有一个股份。

此命令捕捉桩(将桩分成两个桩):

快照价值 2.07 ETI。如果最初的股份价值 10 ETI,它将把股份分成 2.07 ETI 的股份和另外 7.93 ETI 的股份

EticaContract.stakesnap(1, web3.toWei(2.07,'ether'), {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000})   // this command snap a stake
// EticaContract.stakesnap(_stakeidx, web3.toWei(_snapamount,'ether'), {from: '0x2a674CC92dE583590f96135F6259553EaAABeD28', gas:200000}) 
// _stakeidx : The index of the stake you want to snap
// _snapamount : The amount of the new stake (must be less than previous ) 
                                      

目前不清退的交易所推荐:

1、全球第二大交易所OKX欧意

国区邀请链接: https://www.litesther.com/zh-hans/join/1837888   币种多,交易量大!

国际邀请链接:https://www.okx.com/join/1837888 注册简单,交易不需要实名,新用户能开合约,币种多,交易量大!

2、老牌交易所比特儿现改名叫芝麻开门 :https://www.gateex.cc/signup/XgRDAQ8?ref_type=103  注册成功之后务必在网页端完成 手机号码绑定,大陆号码输入+086即可 ,实名认证。推荐在APP端实名认证初级+高级更方便上传。网页端也可以实名认证。

2、全球最大交易所币安

国区邀请链接:https://accounts.suitechsui.cloud/zh-CN/register-person?ref=16003031&registerChannel=goose 支持86手机号码,网页直接注册。

国际邀请链接https://accounts.binance.com/zh-CN/register?ref=16003031币安注册不了IP地址用香港,居住地选香港,认证照旧,邮箱推荐如gmail、outlook。支持币种多,交易安全!

币安最新国区域名,哪个能用用哪个

更新日期 网址 备注
2022/08/31

www.bianreggroup.com

验证
2022/08/31

www.bianreg.net

验证
2022/08/31

www.binancezh.live

验证
2022/08/31

www.binancezh.biz

验证
2022/08/31

www.binancezh.top

验证
2022/08/20

www.binance.info

验证
2022/08/20

www.binancezh.jp

验证
2022/08/20

www.binancezh.sh

验证

其余域名受到不同程度的污染,导致部分区域无法访问,因此建议使用上面的可用域名

买好币上KuCoinhttps://www.kucoin.com/r/af/1f7w3CoinMarketCap前五的交易所,注册友好操简单快捷!

TraderWagon币安带单:https://www.traderwagon.com/zh-CN/register?ref=zoh4gfu

Bybit最高 $1,020 等您领取 $20 体验金和价值最高 $1,000 的福利卡:https://partner.bybit.com/b/49808

火必所有用户现在可用了,但是要重新注册账号火币https://www.huobi.com

全球最大交易所币安

国区邀请链接:https://accounts.suitechsui.cloud/zh-CN/register?ref=16003031 支持86手机号码,网页直接注册。

全球最大交易所币安

国区邀请链接:https://accounts.suitechsui.cloud/zh-CN/register?ref=16003031 支持86手机号码,网页直接注册。

赞(0) 打赏
未经允许不得转载:我爱收益 » Etica CLI如何使用 Etica 命令行

相关推荐

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏