Documentation ¶
Index ¶
Constants ¶
View Source
const ( ArweaveSignType = 1 ED25519SignType = 2 EthereumSignType = 3 SolanaSignType = 4 )
View Source
const ( SuccessTxStatus = "Success" PendingTxStatus = "Pending" MAX_CHUNK_SIZE = 256 * 1024 MIN_CHUNK_SIZE = 32 * 1024 NOTE_SIZE = 32 HASH_SIZE = 32 // concurrent submit chunks min size DEFAULT_CHUNK_CONCURRENT_NUM = 50 // default concurrent number // number of bits in a big.Word WordBits = 32 << (uint64(^big.Word(0)) >> 63) // number of bytes in a big.Word WordBytes = WordBits / 8 BranchNodeType = "branch" LeafNodeType = "leaf" // Maximum amount of chunks we will upload in the body. MAX_CHUNKS_IN_BODY = 1 // Amount we will delay on receiving an error response but do want to continue. ERROR_DELAY = 1000 * 40 )
View Source
const ( BUNDLER_HOST = "https://node1.bundlr.network" MIN_BUNDLE_BINARY_SIZE = 1044 )
about bundle
Variables ¶
View Source
var FATAL_CHUNK_UPLOAD_ERRORS = map[string]struct{}{
"{\"error\":\"disk_full\"}": {},
"{\"error\":\"invalid_json\"}": {},
"{\"error\":\"chunk_too_big\"}": {},
"{\"error\":\"data_path_too_big\"}": {},
"{\"error\":\"offset_too_big\"}": {},
"{\"error\":\"data_size_too_big\"}": {},
"{\"error\":\"chunk_proof_ratio_not_attractive\"}": {},
"{\"error\":\"invalid_proof\"}": {},
}
Errors from /chunk we should never try and continue on.
View Source
var SigConfigMap = map[int]SigMeta{ ArweaveSignType: { SigLength: 512, PubLength: 512, SigName: "arweave", }, ED25519SignType: { SigLength: 64, PubLength: 32, SigName: "ed25519", }, EthereumSignType: { SigLength: 65, PubLength: 65, SigName: "ethereum", }, SolanaSignType: { SigLength: 64, PubLength: 32, SigName: "solana", }, }
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Nonce string `json:"nonce"` PreviousBlock string `json:"previous_block"` Timestamp int64 `json:"timestamp"` LastRetarget int64 `json:"last_retarget"` Diff interface{} `json:"diff"` Height int64 `json:"height"` Hash string `json:"hash"` IndepHash string `json:"indep_hash"` Txs []string `json:"txs"` TxRoot string `json:"tx_root"` TxTree interface{} `json:"tx_tree"` HashList interface{} `json:"hash_list"` HashListMerkle string `json:"hash_list_merkle"` WalletList string `json:"wallet_list"` RewardAddr string `json:"reward_addr"` Tags []interface{} `json:"tags"` RewardPool interface{} `json:"reward_pool"` // always string WeaveSize interface{} `json:"weave_size"` // always string BlockSize interface{} `json:"block_size"` // always string CumulativeDiff interface{} `json:"cumulative_diff"` SizeTaggedTxs interface{} `json:"size_tagged_txs"` Poa POA `json:"poa"` UsdToArRate []string `json:"usd_to_ar_rate"` ScheduledUsdToArRate []string `json:"scheduled_usd_to_ar_rate"` Packing25Threshold string `json:"packing_2_5_threshold"` StrictDataSplitThreshold string `json:"strict_data_split_threshold"` }
type Bundle ¶
type Bundle struct { Items []BundleItem `json:"items"` BundleBinary []byte BundleDataReader *os.File }
type BundleItem ¶
type BundleItem struct { SignatureType int `json:"signatureType"` Signature string `json:"signature"` Owner string `json:"owner"` // utils.Base64Encode(pubkey) Target string `json:"target"` // optional, if exist must length 32, and is base64 str Anchor string `json:"anchor"` // optional, if exist must length 32, and is base64 str Tags []Tag `json:"tags"` Data string `json:"data"` Id string `json:"id"` TagsBy string `json:"tagsBy"` // utils.Base64Encode(TagsBytes) for retry assemble item ItemBinary []byte `json:"-"` DataReader *os.File `json:"-"` }
type BundlrResp ¶
type GetChunk ¶
type NetworkInfo ¶
type NetworkInfo struct { Network string `json:"network"` Version int64 `json:"version"` Release int64 `json:"release"` Height int64 `json:"height"` Current string `json:"current"` Blocks int64 `json:"blocks"` Peers int64 `json:"peers"` QueueLength int64 `json:"queue_length"` NodeStateLatency int64 `json:"node_state_latency"` }
type Node ¶
type Node struct { ID []byte Type string // "branch" or "leaf" DataHash []byte // only leaf node MinByteRange int // only leaf node MaxByteRange int ByteRange int // only branch node LeftChild *Node // only branch node RightChild *Node // only branch node }
Node include leaf node and branch node
type Transaction ¶
type Transaction struct { Format int `json:"format"` ID string `json:"id"` LastTx string `json:"last_tx"` Owner string `json:"owner"` // utils.Base64Encode(wallet.PubKey.N.Bytes()) Tags []Tag `json:"tags"` Target string `json:"target"` Quantity string `json:"quantity"` Data string `json:"data"` // base64.encode DataReader *os.File `json:"-"` // when dataSize too big use dataReader, set Data = "" DataSize string `json:"data_size"` DataRoot string `json:"data_root"` Reward string `json:"reward"` Signature string `json:"signature"` // Computed when needed. Chunks *Chunks `json:"-"` }
type TransactionChunk ¶
type TransactionOffset ¶
Click to show internal directories.
Click to hide internal directories.