1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| System.out.println("============= 自定义数据签名 ==============="); String sign = Ecc.sign(pk,"is京東價as看到可可是是是@#¥%……&*(CVBNM《d "); System.out.println("sign :" + sign + " \n "); System.out.println("============= 转账数据序列化 ==============="); String data = Ecc.parseTransferData("fromaccount", "toaccount", "10.0020 SYS", "测试123abcdo./,./!@##$%"); System.out.println("seriz data :" + data); System.out.println("transfer eq eosjs seriz " + data.equals(eosjs_transfer_seriz)+" \n ");
System.out.println("============= 创建账户数据序列化 ==============="); String data1 = Ecc.parseAccountData("eosio", "espritbloc1.","EOS8eAX54cJtAngV2V22WZhRCW7e4sTAZz1mC5U22vp8mAGuFdMXx","EOS8FPooohZiiCAYXahWCQRxgXXzUbS2gNELAeYCUgGdDMbd2FHQT"); System.out.println("seriz data :" + data1); System.out.println("account eq eosjs seriz " + data1.equals(eosjs_account_seriz));
System.out.println("\n******************* Ecc End *******************\n\n\n"); System.out.println("******************* Rpc Start *******************\n"); Rpc rpc = new Rpc("http://47.106.221.171:8888"); System.out.println("============= 转账 ==============="); try { Transaction t1 = rpc.transfer("5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3","espritblocke", "inita","initb", "12.2821 MSP", ""); System.out.println("转账成功 = " + t1.getTransactionId()+" \n "); }catch(Exception ex) { ex.printStackTrace(); } System.out.println("============= 创建账户并且抵押 ==============="); try { Transaction t2 = rpc.createAccount("5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3","eosio","ccccc..bbbbb", "EOS8eAX54cJtAngV2V22WZhRCW7e4sTAZz1mC5U22vp8mAGuFdMXx","EOS8eAX54cJtAngV2V22WZhRCW7e4sTAZz1mC5U22vp8mAGuFdMXx", 8192l, "0.01 SYS","0.01 SYS", 0l); System.out.println("创建成功 = " + t2.getTransactionId()+" \n "); }catch(Exception ex) { ex.printStackTrace(); } System.out.println("============= 创建账户不抵押 ==============="); try { Transaction t3 = rpc.createAccount("5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3","eosio","bbbb..54321", "EOS8eAX54cJtAngV2V22WZhRCW7e4sTAZz1mC5U22vp8mAGuFdMXx","EOS8eAX54cJtAngV2V22WZhRCW7e4sTAZz1mC5U22vp8mAGuFdMXx", 8192l); System.out.println("创建成功 = " + t3.getTransactionId()+" \n "); }catch(Exception ex) { ex.printStackTrace(); } System.out.println("============= 代理投票 ==============="); try { List<String> produces = new ArrayList<>(); produces.add("pppppeeeeooo"); produces.add("mdddssssddds"); produces.add("mdjddjddddds"); rpc.voteproducer("5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3", "epskdkdsddss","iuewjdkslsdc",produces); } catch (Exception e) { e.printStackTrace(); } System.out.println("============= 关闭余额为0的token ==============="); try { rpc.close("5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3", "合约账户", "关闭账户", "0.0000 IPOS"); }catch(ApiException e) { e.printStackTrace(); }catch(Exception ex) { ex.printStackTrace(); } System.out.println("\n******************* Rpc End *******************");
|