You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 30, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
-80Lines changed: 0 additions & 80 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,86 +104,6 @@ To create a new transaction, you will need to interact with the `transactor` pac
104
104
fmt.Println(finalTx.Hash())
105
105
```
106
106
107
-
### Batching, chunking and recombining
108
-
109
-
Arweave currently has a 3MB transaction limit. To let you be able to upload more than 3MB of data, this library lets you chunk your data into multiples chunks, and upload these chunks to the weave. These chunks are all backlinked to their previous chunk (except the first one) so all you need to use to retrieve all the chunks is the last chunk's address (the "tip" of this linked list).
110
-
111
-
So far the library has been tested with Tarred and Gzipped files (it's a good idea to compress your files, you'll be paying less fees to the network!)
112
-
113
-
#### Creating chunks
114
-
115
-
To create chunks, use the `chunker` package. Currently the chunker takes 500KB chunks, encodes it to the same encoding as the Arweave (Raw Base64 URL encoding) and adds it to a transaction.
116
-
117
-
```golang
118
-
f, err:= os.Open("example.tar.gz")
119
-
if err != nil {
120
-
//...
121
-
}
122
-
info, err:= f.Stat()
123
-
if err != nil {
124
-
//...
125
-
}
126
-
chunker, err:= chunker.NewChunker(f, info.Size())
127
-
if err != nil {
128
-
//...
129
-
}
130
-
chunks, err:= chunker.ChunkAll()
131
-
if err != nil {
132
-
//...
133
-
}
134
-
```
135
-
136
-
#### Sending a batch of transactions
137
-
138
-
To directly do both the chunking and the batch sending of transaction, you can use the `batchchunker` package. The package needs to wait for a single transaction to be mined before sending a new one. This will take a significant amount of time as the Arweave has a ~2 minute block time.
Recombining all the chunks needs to be done from the tip of the batch chain (the last transaction sent). The function will grab all the chunks and recombine it into an io.Writer.
163
-
164
-
```golang
165
-
// in this example, we will save the data as a file
0 commit comments