tangle-accelerator
解析 request,並以 JSON 格式 response,使用 cJSON 實做
下列 function 需要 serialization:
core function 皆會使用到 entangled/cclient
,參考到 IOTA cclient 使用指南
為了使用 dcurl 進行 PoW 加速,我們需要
實做 attachToTangle 流程
send_transfer
Flowfinalize
transaction_sesrialize_to_flex_trits
offset | start | len |
---|---|---|
SIGNATURE_MESSAGE_FRAGMENT_OFFSET | 0 | 6561 |
ADDRESS_TRINARY_OFFSET | 6561 | 243 |
VALUE_TRINARY_OFFSET | 6804 | 81 |
OBSOLETE_TAG_TRINARY_OFFSET | 6885 | 81 |
TIMESTAMP_TRINARY_OFFSET | 6966 | 27 |
CURRENT_INDEX_TRINARY_OFFSET | 6993 | 27 |
LAST_INDEX_TRINARY_OFFSET | 7020 | 27 |
BUNDLE_TRINARY_OFFSET | 7047 | 243 |
TRUNK_TRANSACTION_TRINARY_OFFSET | 7290 (2430 tryte) | 243 |
BRANCH_TRANSACTION_TRINARY_OFFSET | 7533 (2511 tryte) | 243 |
TAG_TRINARY_OFFSET | 7776 | 81 |
ATTACHMENT_TIMESTAMP_ TRINARY_OFFSET |
7857 (2619 tryte) | 27 |
ATTACHMENT_TIMESTAMP_ LOWER_BOUND_TRINARY_OFFSET |
7884 | 27 |
ATTACHMENT_TIMESTAMP_ UPPER_BOUND_TRINARY_OFFSET |
7911 (2637 tryte) | 27 |
NONCE_TRINARY_OFFSET | 7938 (2646 tryte) | 81 |
transaction_sesrialize_to_flex_trits
def as_tryte_string(self):
# type: () -> TransactionTrytes
"""
Returns a TryteString representation of the transaction.
"""
return TransactionTrytes(
self.signature_message_fragment
+ self.address.address
+ self.value_as_trytes
+ self.legacy_tag
+ self.timestamp_as_trytes
+ self.current_index_as_trytes
+ self.last_index_as_trytes
+ self.bundle_hash
+ self.trunk_transaction_hash
+ self.branch_transaction_hash
+ self.tag
+ self.attachment_timestamp_as_trytes
+ self.attachment_timestamp_lower_bound_as_trytes
+ self.attachment_timestamp_upper_bound_as_trytes
+ self.nonce
)
Transfer
typedef struct _transfer {
transfer_type_e type;
const flex_trit_t *address;
const flex_trit_t *tag;
int64_t value;
uint64_t timestamp;
void *meta; // extend informations depended on transfer type.
} transfer_t;
3 types of transfer, each one has its own meta data structure:
DATA
typedef struct _transfer_data {
const flex_trit_t *data;
size_t len;
} transfer_data_t;
VALUE_OUT
typedef struct _transfer_value_out {
const flex_trit_t *seed;
uint8_t security;
uint64_t seed_index;
} transfer_value_out_t;
VALUE_IN
typedef struct _transfer_value_in {
// can have up to 2187 trytes as data
size_t len;
const flex_trit_t *data;
} transfer_value_in_t;
Transfer Iterator
transfer_iterator_new
transfer_iterator_next
unkown nouns
remainder
in prepare_transfersbundle
, address
, tag
, obsolete_tag
, timestamp
, current_index
, last_index
message
value
, signature
value
, signature
transfer_iterator_new
, why do we still need bundle_finalize
?cache server 不能獨立於 tangle-accelerator 的原因
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing