文档介绍:开发指南: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 {