group transactions

All transactions are sets of operations that must be applied atomically. Transactions must refer to a recent block that defines the context of the operation so that they assert a known binding to the object id's referenced in the transaction.

Rather than specify a full block number, we only specify the lower 16 bits of the block number which means you can reference any block within the last 65,536 blocks which is 3.5 days with a 5 second block interval or 18 hours with a 1 second interval.

All transactions must expire so that the network does not have to maintain a permanent record of all transactions ever published. A transaction may not have an expiration date too far in the future because this would require keeping too much transaction history in memory.

The block prefix is the first 4 bytes of the block hash of the reference block number, which is the second 4 bytes of the block_id_type (the first 4 bytes of the block ID are the block number)

Note: A transaction which selects a reference block cannot be migrated between forks outside the period of ref_block_num.time to (ref_block_num.time + rel_exp * interval). This fact can be used to protect market orders which should specify a relatively short re-org window of perhaps less than 1 minute. Normal payments should probably have a longer re-org window to ensure their transaction can still go through in the event of a momentary disruption in service.

It is not recommended to set the ref_block_num, ref_block_prefix, and expiration fields manually. Call the appropriate overload of set_expiration instead.

Summary

Members Descriptions
public voidverify_authority(const vector< operation > & ops,const flat_set< public_key_type > & sigs,const std::function< const authority *(account_id_type)> & get_active,const std::function< const authority *(account_id_type)> & get_owner,uint32_t max_recursion,bool allow_committee,const flat_set< account_id_type > & active_aprovals,const flat_set< account_id_type > & owner_approvals)
structgraphene::chain::subscribe_operation Creates a subscription to author. This function is used by consumers..
structgraphene::chain::subscribe_by_author_operation Creates a subscription to author. This function is used by author.
structgraphene::chain::automatic_renewal_of_subscription_operation This function is used to allow/disallow automatic renewal of expired subscription.
structgraphene::chain::disallow_automatic_renewal_of_subscription_operation This virtual operation disallows automatic renewal of subscription if consumer doesn't have enought balance to renew expired subscription.
structgraphene::chain::renewal_of_subscription_operation This virtual operation is used to lengthen expired subscription.
structgraphene::chain::transaction groups operations that should be applied atomically
structgraphene::chain::signed_transaction adds a signature to a transaction
structgraphene::chain::processed_transaction captures the result of evaluating the operations contained in the transaction

Members

public voidverify_authority(const vector< operation > & ops,const flat_set< public_key_type > & sigs,const std::function< const authority *(account_id_type)> & get_active,const std::function< const authority *(account_id_type)> & get_owner,uint32_t max_recursion,bool allow_committee,const flat_set< account_id_type > & active_aprovals,const flat_set< account_id_type > & owner_approvals)

struct graphene::chain::subscribe_operation {#structgraphene_1_1chain_1_1subscribe__operation}

struct graphene::chain::subscribe_operation
  : public graphene::chain::base_operation

Creates a subscription to author. This function is used by consumers..

Summary

Members Descriptions
publicassetfee
publicaccount_id_typefrom
publicaccount_id_typeto
publicassetprice
public inlineaccount_id_typefee_payer() const
public voidvalidate() const

Members

publicassetfee {#structgraphene_1_1chain_1_1subscribe__operation_1acb7a085f300bff0aefb13df641487a92}

publicaccount_id_typefrom {#structgraphene_1_1chain_1_1subscribe__operation_1ad10ae674de0619194518d789c1b0caa0}

publicaccount_id_typeto {#structgraphene_1_1chain_1_1subscribe__operation_1afb48d07b9a1122e01ebdd28c8776bc3e}

publicassetprice {#structgraphene_1_1chain_1_1subscribe__operation_1ac82721762665c806fa7bb51c5e8a642e}

public inlineaccount_id_typefee_payer() const {#structgraphene_1_1chain_1_1subscribe__operation_1a6519d7d3b74f1e86a36157d244879e2f}

public voidvalidate() const {#structgraphene_1_1chain_1_1subscribe__operation_1a555cb4072a23340670a959fc45e431e5}

struct graphene::chain::subscribe_by_author_operation {#structgraphene_1_1chain_1_1subscribebyauthor__operation}

struct graphene::chain::subscribe_by_author_operation
  : public graphene::chain::base_operation

Creates a subscription to author. This function is used by author.

Summary

Members Descriptions
publicassetfee
publicaccount_id_typefrom
publicaccount_id_typeto
public inlineaccount_id_typefee_payer() const
public voidvalidate() const

Members

publicassetfee {#structgraphene_1_1chain_1_1subscribebyauthor__operation_1a3ecba607b0eaae7cdd18c8cceb2fb9ed}

publicaccount_id_typefrom {#structgraphene_1_1chain_1_1subscribebyauthor__operation_1affc67818634471921a9f49f22340364d}

publicaccount_id_typeto {#structgraphene_1_1chain_1_1subscribebyauthor__operation_1a3c59cb46561ff6007217541eaba833fe}

public inlineaccount_id_typefee_payer() const {#structgraphene_1_1chain_1_1subscribebyauthor__operation_1a42a24b0ec906209641c30a215b2fbfa4}

public voidvalidate() const {#structgraphene_1_1chain_1_1subscribebyauthor__operation_1a5d4a67f68bc292ea76b2a94ef87d7e49}

struct graphene::chain::automatic_renewal_of_subscription_operation {#structgraphene_1_1chain_1_1automaticrenewalofsubscriptionoperation}

struct graphene::chain::automatic_renewal_of_subscription_operation
  : public graphene::chain::base_operation

This function is used to allow/disallow automatic renewal of expired subscription.

Summary

Members Descriptions
publicassetfee
publicaccount_id_typeconsumer
publicsubscription_id_typesubscription
public boolautomatic_renewal
public inlineaccount_id_typefee_payer() const
public inline voidvalidate() const

Members

publicassetfee {#structgraphene_1_1chain_1_1automaticrenewalofsubscriptionoperation_1adfd029ba516969e0a01c02abe2d00de6}

publicaccount_id_typeconsumer {#structgraphene_1_1chain_1_1automaticrenewalofsubscriptionoperation_1a099ac99981d4d113904cbd36b361e111}

publicsubscription_id_typesubscription {#structgraphene_1_1chain_1_1automaticrenewalofsubscriptionoperation_1aeacde8eeb3161cfb5f17544cc0c23fa1}

public boolautomatic_renewal {#structgraphene_1_1chain_1_1automaticrenewalofsubscriptionoperation_1a8aabbbfedcc508a37899a21dbe959c35}

public inlineaccount_id_typefee_payer() const {#structgraphene_1_1chain_1_1automaticrenewalofsubscriptionoperation_1a478e631ddbf5ac86c82c7668efbe4444}

public inline voidvalidate() const {#structgraphene_1_1chain_1_1automaticrenewalofsubscriptionoperation_1a944afe1a87e2f97c40462c3fca0a87d5}

struct graphene::chain::disallow_automatic_renewal_of_subscription_operation {#structgraphene_1_1chain_1_1disallowautomaticrenewalofsubscription__operation}

struct graphene::chain::disallow_automatic_renewal_of_subscription_operation
  : public graphene::chain::base_operation

This virtual operation disallows automatic renewal of subscription if consumer doesn't have enought balance to renew expired subscription.

Summary

Members Descriptions
publicassetfee
publicaccount_id_typeconsumer
publicsubscription_id_typesubscription
public inlineaccount_id_typefee_payer() const
public inline voidvalidate() const

Members

publicassetfee {#structgraphene_1_1chain_1_1disallowautomaticrenewalofsubscription__operation_1a914a68b6c9b8ec4dbeeface186ef09fa}

publicaccount_id_typeconsumer {#structgraphene_1_1chain_1_1disallowautomaticrenewalofsubscription__operation_1a1d6154adc4f4d1b4d6963f0297434cfc}

publicsubscription_id_typesubscription {#structgraphene_1_1chain_1_1disallowautomaticrenewalofsubscription__operation_1afae598265e120aff87b5dff114138c21}

public inlineaccount_id_typefee_payer() const {#structgraphene_1_1chain_1_1disallowautomaticrenewalofsubscription__operation_1aaf6d7991e14b8566f748d2375f3054f9}

public inline voidvalidate() const {#structgraphene_1_1chain_1_1disallowautomaticrenewalofsubscription__operation_1a148489019f606ab05612ef6941e448fc}

struct graphene::chain::renewal_of_subscription_operation {#structgraphene_1_1chain_1_1renewalofsubscription__operation}

struct graphene::chain::renewal_of_subscription_operation
  : public graphene::chain::base_operation

This virtual operation is used to lengthen expired subscription.

Summary

Members Descriptions
publicassetfee
publicaccount_id_typeconsumer
publicsubscription_id_typesubscription
public inlineaccount_id_typefee_payer() const
public inline voidvalidate() const

Members

publicassetfee {#structgraphene_1_1chain_1_1renewalofsubscription__operation_1a81ec6a4caf6ea3ce86fd98a7643edf58}

publicaccount_id_typeconsumer {#structgraphene_1_1chain_1_1renewalofsubscription__operation_1a995117f8188c13cb513f6fc790f86c7c}

publicsubscription_id_typesubscription {#structgraphene_1_1chain_1_1renewalofsubscription__operation_1a85ff4276f1028c6b299cc0fe72e8db8c}

public inlineaccount_id_typefee_payer() const {#structgraphene_1_1chain_1_1renewalofsubscription__operation_1a8141f5c77b227d039254264d335ada2d}

public inline voidvalidate() const {#structgraphene_1_1chain_1_1renewalofsubscription__operation_1a3524b08c9f15feebc81766ca2877e287}

struct graphene::chain::transaction {#structgraphene_1_1chain_1_1transaction}

groups operations that should be applied atomically

Summary

Members Descriptions
public uint16_tref_block_num Least significant 16 bits from the reference block number. If relative_expiration is zero, this field must be zero as well.
public uint32_tref_block_prefix The first non-block-number 32-bits of the reference block ID. Recall that block IDs have 32 bits of block number followed by the actual block hash, so this field should be set using the second 32 bits in the block_id_type
public fc::time_point_secexpiration This field specifies the absolute expiration for this transaction.
public vector<operation>operations
publicextensions_typeextensions
publicdigest_typedigest() const Calculate the digest for a transaction.
publictransaction_id_typeid() const
public voidvalidate() const
publicdigest_typesig_digest(constchain_id_type& chain_id) const Calculate the digest used for signature validation.
public voidset_expiration(fc::time_point_sec expiration_time)
public voidset_reference_block(constblock_id_type& reference_block)
public template<typename Visitor>
inline vector< typename Visitor::result_type >visit(Visitor && visitor)
visit all operations
public template<typename Visitor>
inline vector< typename Visitor::result_type >visit(Visitor && visitor) const
public voidget_required_authorities(flat_set<account_id_type> & active,flat_set<account_id_type> & owner,vector<authority> & other) const

Members

public uint16_tref_block_num {#structgraphene_1_1chain_1_1transaction_1a3c3667e1bb02ad8f694f41206436e9cf}

Least significant 16 bits from the reference block number. If relative_expiration is zero, this field must be zero as well.

public uint32_tref_block_prefix {#structgraphene_1_1chain_1_1transaction_1afcebf54b05d6254e6ea53aecdd075975}

The first non-block-number 32-bits of the reference block ID. Recall that block IDs have 32 bits of block number followed by the actual block hash, so this field should be set using the second 32 bits in the block_id_type

public fc::time_point_secexpiration {#structgraphene_1_1chain_1_1transaction_1a31fbf0cfaa89497d13fc35fb51319a32}

This field specifies the absolute expiration for this transaction.

public vector<operation>operations {#structgraphene_1_1chain_1_1transaction_1a8013003bb366e3a6a7f61eae96cd1281}

publicextensions_typeextensions {#structgraphene_1_1chain_1_1transaction_1a4f405d9c07b4655ef38e4388852caf38}

publicdigest_typedigest() const {#structgraphene_1_1chain_1_1transaction_1aba25fb0435684c2088b0d0ae5e0d27d2}

Calculate the digest for a transaction.

publictransaction_id_typeid() const {#structgraphene_1_1chain_1_1transaction_1a94f1f38f5bdcb2e5041f964ca6b99d5b}

public voidvalidate() const {#structgraphene_1_1chain_1_1transaction_1adbd10db7270e459e93daf28da33010c8}

publicdigest_typesig_digest(constchain_id_type& chain_id) const {#structgraphene_1_1chain_1_1transaction_1a5b988fc8d032e5d8c9ef4b605834cf07}

Calculate the digest used for signature validation.

public voidset_expiration(fc::time_point_sec expiration_time) {#structgraphene_1_1chain_1_1transaction_1a6d70681972cbabd916c52fb63b6091c6}

public voidset_reference_block(constblock_id_type& reference_block) {#structgraphene_1_1chain_1_1transaction_1a8571a6eb56aad9899093eb15fa18b43d}

public template<typename Visitor>
inline vector< typename Visitor::result_type >visit(Visitor && visitor) {#structgraphene_1_1chain_1_1transaction_1a870f3054c7403dbce2b21a7253b2a1d1}

visit all operations

public template<typename Visitor>
inline vector< typename Visitor::result_type >visit(Visitor && visitor) const {#structgraphene_1_1chain_1_1transaction_1a927bed92680e17e9790a598a64f79943}

public voidget_required_authorities(flat_set<account_id_type> & active,flat_set<account_id_type> & owner,vector<authority> & other) const {#structgraphene_1_1chain_1_1transaction_1a3d4d00f25924c74f600064951a83f5e1}

struct graphene::chain::signed_transaction {#structgraphene_1_1chain_1_1signed__transaction}

struct graphene::chain::signed_transaction
  : public graphene::chain::transaction

adds a signature to a transaction

Summary

Members Descriptions
public vector<signature_type>signatures
public inlinesigned_transaction(consttransaction& trx)
public constsignature_type&sign(constprivate_key_type& key,constchain_id_type& chain_id) signs and appends to signatures
publicsignature_typesign(constprivate_key_type& key,constchain_id_type& chain_id) const returns signature but does not append
public set<public_key_type>get_required_signatures(constchain_id_type& chain_id,const flat_set<public_key_type> & available_keys,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_active,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_owner,uint32_t max_recursion) const The purpose of this method is to identify some subset of available_keys that will produce sufficient signatures for a transaction. The result is not always a minimal set of signatures, but any non-minimal result will still pass validation.
public voidverify_authority(constchain_id_type& chain_id,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_active,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_owner,uint32_t max_recursion) const
public set<public_key_type>minimize_required_signatures(constchain_id_type& chain_id,const flat_set<public_key_type> & available_keys,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_active,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_owner,uint32_t max_recursion) const This is a slower replacement for get_required_signatures() which returns a minimal set in all cases, including some cases where get_required_signatures() returns a non-minimal set.
public flat_set<public_key_type>get_signature_keys(constchain_id_type& chain_id) const
public inline voidclear() Removes all operations and signatures.

Members

public vector<signature_type>signatures {#structgraphene_1_1chain_1_1signed__transaction_1a11b7f1817059ccae1ea5f176a505834e}

public inlinesigned_transaction(consttransaction& trx) {#structgraphene_1_1chain_1_1signed__transaction_1a9be0388e8af36733e314ac2793452984}

public constsignature_type&sign(constprivate_key_type& key,constchain_id_type& chain_id) {#structgraphene_1_1chain_1_1signed__transaction_1a99cd8014861f5371b466b2dba00551f2}

signs and appends to signatures

publicsignature_typesign(constprivate_key_type& key,constchain_id_type& chain_id) const {#structgraphene_1_1chain_1_1signed__transaction_1a96b0d1c656b2c480d5f2ddd627a34e45}

returns signature but does not append

public set<public_key_type>get_required_signatures(constchain_id_type& chain_id,const flat_set<public_key_type> & available_keys,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_active,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_owner,uint32_t max_recursion) const {#structgraphene_1_1chain_1_1signed__transaction_1a206cfe6280cdc3c22ed63a4fcf949dff}

The purpose of this method is to identify some subset of available_keys that will produce sufficient signatures for a transaction. The result is not always a minimal set of signatures, but any non-minimal result will still pass validation.

public voidverify_authority(constchain_id_type& chain_id,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_active,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_owner,uint32_t max_recursion) const {#structgraphene_1_1chain_1_1signed__transaction_1ad98a778f0c7ab667c73ac32eab84dc9c}

public set<public_key_type>minimize_required_signatures(constchain_id_type& chain_id,const flat_set<public_key_type> & available_keys,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_active,const std::function< constauthority](#structgraphene_1_1chain_1_1authority) *([account_id_type)> & get_owner,uint32_t max_recursion) const {#structgraphene_1_1chain_1_1signed__transaction_1a35191145a0b5831d587b24cce88daf93}

This is a slower replacement for get_required_signatures() which returns a minimal set in all cases, including some cases where get_required_signatures() returns a non-minimal set.

public flat_set<public_key_type>get_signature_keys(constchain_id_type& chain_id) const {#structgraphene_1_1chain_1_1signed__transaction_1a79c5278bbae117d149f84cf58d1ab3e2}

public inline voidclear() {#structgraphene_1_1chain_1_1signed__transaction_1ab99f3eb4824b38719f2158f0d256a321}

Removes all operations and signatures.

struct graphene::chain::processed_transaction {#structgraphene_1_1chain_1_1processed__transaction}

struct graphene::chain::processed_transaction
  : public graphene::chain::signed_transaction

captures the result of evaluating the operations contained in the transaction

When processing a transaction some operations generate new object IDs and these IDs cannot be known until the transaction is actually included into a block. When a block is produced these new ids are captured and included with every transaction. The index in operation_results should correspond to the same index in operations.

If an operation did not create any new object IDs then 0 should be returned.

Summary

Members Descriptions
public vector<operation_result>operation_results
public inlineprocessed_transaction(constsigned_transaction& trx)
publicdigest_typemerkle_digest() const

Members

public vector<operation_result>operation_results {#structgraphene_1_1chain_1_1processed__transaction_1a93aa1fc128d6cb9bd068e31ac72cf4f5}

public inlineprocessed_transaction(constsigned_transaction& trx) {#structgraphene_1_1chain_1_1processed__transaction_1a842a78049046ba07ad411831efea462f}

publicdigest_typemerkle_digest() const {#structgraphene_1_1chain_1_1processed__transaction_1a348571d7429c14a3b847c03ebaba545a}