1 / 18
文档名称:

开发指南:BUMO,存证,JAVA,开发指南x.docx

格式:docx   大小:17KB   页数:18页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

开发指南:BUMO,存证,JAVA,开发指南x.docx

上传人:wawa 2022/6/30 文件大小:17 KB

下载得到文件列表

开发指南:BUMO,存证,JAVA,开发指南x.docx

文档介绍

文档介绍:开发指南:BUMO,存证,JAVA,开发指南x
 开发指南:BUMO 存证 JAVA 开发指南 BUMO 存证 JAVA 开发指南 BUMO 开发概述 BUMO 是新一代商用级基础公链。通过创新的共识算法(BU Firework)、主链-imit = ();
 // Transaction initiation account"s nonce + 1
 Long nonce = 8L;
  // Generate a new account to be activated
 Keypair keypair = ();
 ((keypair, true));
 String destAccount = ();
  // 1. Get the account address to send this transaction
 String activateAddresss = getAddressByPrivateKey(activatePrivateKey);
  // 2. Build activateAccount
 AccountActivateOperation operation = new AccountActivateOperation();
 (activateAddresss);
 (destAccount);
 (initBalance);
 (activate account);
  String[] signerPrivateKeyArr = {activatePrivateKey};
 // Record txhash for subsequent confirmation of the real result of the transaction.
 // After recommending five blocks, call again through txhash `Get the transaction information
 // from the transaction Hash"(see example: getTxByHash ()) to confirm the final result of the transaction
 String txHash = submitTransaction(signerPrivateKeyArr, activateAddresss, operation, nonce, gasPrice, feeLimit);
 if (txHash != null) {
 (hash: + txHash);
 }
 }
  完整代码见:-sdk-java/blob/master/examples/src/main/java/io/bumo/sdk/example/
 记录存证信息 将存证信息记录在区块链上会被永久存储 获得账户的序列号 每个账户都维护着自己的序列号,该序列号从 1 起先,依次递增,一个序列号标记着一个该账户的交易 代码示例:
 public long getAccountNonce() {
  long nonce = 0;
  // Init request
  String accountAddress = [资方账户地址];
  AccountGetNonceRequest request = new AccountGetNonceRequest();
  (accountAddress);
 // Call getNonce
  AccountGetNonceResponse response = ().getNonce(request);
  if (0 == ()) {
  nonce = ().getNonce();
  } else {