everFinance / goar

Arweave http client and wallet implemented in go, Arweave SDK
Apache License 2.0
142 stars 45 forks source link

Sending data more than one chunks fail. #33

Closed oday0311 closed 2 years ago

oday0311 commented 2 years ago

sample 1), data is less than one chunk, will success

func TestWallet_SendDataSpeedUp01(t *testing.T) { // arNode := "https://arweave.net" // w, err := NewWalletFromPath("./example/testKey.json", arNode) // your wallet private key // assert.NoError(t, err)

//data := []byte("aaa this is a goar test small size file data") // small file
data := make([]byte, 255*1024)
for i := 0; i < len(data); i++ {
    data[i] = byte('b' + i)
}
tags := []types.Tag{
    {Name: "GOAR", Value: "SMDT"},
}
id, err := testWallet.SendDataSpeedUp(data, tags, 50)
assert.NoError(t, err)
t.Logf("tx hash: %s", id)

}

==========================

sample 2) data size 10 chunks. return with the following error: Unable to upload Transaction: 400, , Transaction verification failed.

func TestWallet_SendDataSpeedUp01(t *testing.T) { // arNode := "https://arweave.net" // w, err := NewWalletFromPath("./example/testKey.json", arNode) // your wallet private key // assert.NoError(t, err)

//data := []byte("aaa this is a goar test small size file data") // small file
data := make([]byte, 255*1024*10)
for i := 0; i < len(data); i++ {
    data[i] = byte('b' + i)
}
tags := []types.Tag{
    {Name: "GOAR", Value: "SMDT"},
}
id, err := testWallet.SendDataSpeedUp(data, tags, 50)
assert.NoError(t, err)
t.Logf("tx hash: %s", id)

}

zyjblockchain commented 2 years ago
image

I test about 7.5 MB file for upload to arweave is ok your case return 400, means your transaction signature verify failed. please check your tx signature, you can use utils.VerifyTransaction() function to check your sign

oday0311 commented 2 years ago

I am using the same code and account just change the data part from data := make([]byte, 255 1024) to data := make([]byte, 255 1024 * 10),

can you try this sample? func TestWallet_SendDataSpeedUp01(t *testing.T) {

zyjblockchain commented 2 years ago
image

it is ok

dmitrymomot commented 2 years ago

I have the same error. @oday0311, how did you solve it?

oday0311 commented 2 years ago

@dmitrymomot , I skip this , I still think there maybe some bug in this, but not that important to me , so I turn to some other place.