From 0693817fb55ea74d16f50f211c3a694bbec548fd Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Wed, 31 Jan 2024 15:32:49 +0530 Subject: [PATCH 01/11] update gosdk --- go.mod | 19 +++++++++++-------- go.sum | 38 ++++++++++++++++++++++---------------- go.work.sum | 4 ++++ 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 6ed7bafaa..ecc978c09 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( cloud.google.com/go/storage v1.27.0 github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.11.0 + github.com/0chain/gosdk v1.11.1-0.20240131095622-ff672e0bd530 github.com/Azure/azure-pipeline-go v0.2.2 github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Shopify/sarama v1.28.0 @@ -39,7 +39,7 @@ require ( github.com/inconshreveable/mousetrap v1.0.0 github.com/jcmturner/gokrb5/v8 v8.4.2 github.com/json-iterator/go v1.1.12 - github.com/klauspost/compress v1.16.0 + github.com/klauspost/compress v1.17.0 github.com/klauspost/cpuid/v2 v2.2.4 github.com/klauspost/pgzip v1.2.5 github.com/klauspost/readahead v1.4.0 @@ -87,9 +87,9 @@ require ( go.etcd.io/etcd/client/v3 v3.5.6 go.uber.org/atomic v1.10.0 go.uber.org/zap v1.24.0 - golang.org/x/crypto v0.6.0 + golang.org/x/crypto v0.17.0 golang.org/x/oauth2 v0.5.0 - golang.org/x/sys v0.7.0 + golang.org/x/sys v0.15.0 golang.org/x/time v0.3.0 google.golang.org/api v0.110.0 gopkg.in/yaml.v2 v2.4.0 @@ -106,6 +106,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/StackExchange/wmi v1.2.1 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect github.com/apache/thrift v0.15.0 // indirect github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -161,6 +162,7 @@ require ( github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/herumi/bls-go-binary v1.31.0 // indirect + github.com/hitenjain14/fasthttp v0.0.0-20240129191709-9e0a59b0bd2c // indirect github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect @@ -231,6 +233,7 @@ require ( github.com/tklauser/numcpus v0.6.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/unrolled/secure v1.0.9 // indirect + github.com/valyala/fasthttp v1.51.0 // indirect github.com/xdg/stringprep v1.0.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.dedis.ch/fixbuf v1.0.3 // indirect @@ -239,10 +242,10 @@ require ( go.mongodb.org/mongo-driver v1.4.6 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.9.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect diff --git a/go.sum b/go.sum index 1dda3c41a..afc017b8c 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.11.0 h1:PSD4ohQaaSOsH/sHvfnCbq35Bs5fCtL1g9S4vyvxQOY= -github.com/0chain/gosdk v1.11.0/go.mod h1:DAg/de6vodjEa7CM1/LjElOwntRtNV5lb9rMRaR7fzU= +github.com/0chain/gosdk v1.11.1-0.20240131095622-ff672e0bd530 h1:Bhv4kQfjzn4lRGWkRCZnLoJH3oIqf1bAY7lZSKwSQgE= +github.com/0chain/gosdk v1.11.1-0.20240131095622-ff672e0bd530/go.mod h1:yjFLuyINo6rx9WbV3zf0XZTdyBdNWt6UkI4gTUwRSX0= github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= @@ -170,6 +170,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -870,6 +872,8 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/herumi/bls-go-binary v1.31.0 h1:L1goQ2tMtGgpXCg5AwHAdJQpLs/pfnWWEc3Wog6OhmI= github.com/herumi/bls-go-binary v1.31.0/go.mod h1:O4Vp1AfR4raRGwFeQpr9X/PQtncEicMoOe6BQt1oX0Y= +github.com/hitenjain14/fasthttp v0.0.0-20240129191709-9e0a59b0bd2c h1:j9okwmdumHG3vLk91JG10ZLQXVHD3zM4Uq6Dlv4zTRQ= +github.com/hitenjain14/fasthttp v0.0.0-20240129191709-9e0a59b0bd2c/go.mod h1:RZMcXy7u4S+E97IXYTe7WHZ3+mCYOh4vys8PkIGZeXk= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= @@ -1014,8 +1018,8 @@ github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdY github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= -github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= @@ -1636,6 +1640,8 @@ github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3 github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= +github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= +github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c= @@ -1789,8 +1795,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1894,8 +1900,8 @@ golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1 golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1922,8 +1928,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2026,15 +2032,15 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2046,8 +2052,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/go.work.sum b/go.work.sum index 4ac8196e9..6361dfd90 100644 --- a/go.work.sum +++ b/go.work.sum @@ -476,12 +476,14 @@ golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4= +golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/mobile v0.0.0-20220518205345-8578da9835fd/go.mod h1:pe2sM7Uk+2Su1y7u/6Z8KJ24D7lepUjFZbhFOrmDfuQ= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -501,6 +503,8 @@ golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= From 8992503cf95724ce7c1ebed4c37660609230852f Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Wed, 31 Jan 2024 18:09:37 +0530 Subject: [PATCH 02/11] update chunknumber --- cmd/gateway/zcn/dStorage.go | 6 +++++- cmd/gateway/zcn/gateway-zcn.go | 7 +++++-- cmd/gateway/zcn/multipart.go | 6 +++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/cmd/gateway/zcn/dStorage.go b/cmd/gateway/zcn/dStorage.go index 1347773a8..7c0b1d70f 100644 --- a/cmd/gateway/zcn/dStorage.go +++ b/cmd/gateway/zcn/dStorage.go @@ -292,6 +292,10 @@ func putFile(ctx context.Context, alloc *sdk.Allocation, remotePath, contentType } logger.Info("starting chunked upload") + chunkNumber := 300 + if alloc.DataShards < 3 { + chunkNumber = 600 + } opRequest := sdk.OperationRequest{ OperationType: constants.FileOperationInsert, FileReader: newMinioReader(r), @@ -299,7 +303,7 @@ func putFile(ctx context.Context, alloc *sdk.Allocation, remotePath, contentType RemotePath: remotePath, FileMeta: fileMeta, Opts: []sdk.ChunkedUploadOption{ - sdk.WithChunkNumber(250), + sdk.WithChunkNumber(chunkNumber), }, } diff --git a/cmd/gateway/zcn/gateway-zcn.go b/cmd/gateway/zcn/gateway-zcn.go index 09328fbb7..ea2098d7e 100644 --- a/cmd/gateway/zcn/gateway-zcn.go +++ b/cmd/gateway/zcn/gateway-zcn.go @@ -556,7 +556,10 @@ func (zob *zcnObjects) PutMultipleObjects( if total <= 0 { return nil, fmt.Errorf("no files to upload") } - + chunkNumber := 300 + if zob.alloc.DataShards < 3 { + chunkNumber = 600 + } if total != len(r) || total != len(opts) { return nil, fmt.Errorf("length mismatch of objects with file readers or with options") } @@ -601,7 +604,7 @@ func (zob *zcnObjects) PutMultipleObjects( options := []sdk.ChunkedUploadOption{ sdk.WithEncrypt(false), - sdk.WithChunkNumber(200), + sdk.WithChunkNumber(chunkNumber), } operationRequests[idx] = sdk.OperationRequest{ FileMeta: fileMeta, diff --git a/cmd/gateway/zcn/multipart.go b/cmd/gateway/zcn/multipart.go index ec4ddd6e5..34798f014 100644 --- a/cmd/gateway/zcn/multipart.go +++ b/cmd/gateway/zcn/multipart.go @@ -193,8 +193,12 @@ func (zob *zcnObjects) newMultiPartUpload(localStorageDir, bucket, object string RemotePath: "/" + filepath.Join(bucket, object), MimeType: "application/octet-stream", // can get from request } + chunkNumber := 300 + if zob.alloc.DataShards < 3 { + chunkNumber = 600 + } options := []sdk.ChunkedUploadOption{ - sdk.WithChunkNumber(250), + sdk.WithChunkNumber(chunkNumber), } operationRequest := sdk.OperationRequest{ FileMeta: fileMeta, From 9901435263b0f2fa551876e31f487aa6be0893c1 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Wed, 31 Jan 2024 19:24:57 +0530 Subject: [PATCH 03/11] fix multipart upload --- cmd/gateway/zcn/multipart.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/gateway/zcn/multipart.go b/cmd/gateway/zcn/multipart.go index 34798f014..2d59b26cf 100644 --- a/cmd/gateway/zcn/multipart.go +++ b/cmd/gateway/zcn/multipart.go @@ -161,6 +161,7 @@ func (zob *zcnObjects) newMultiPartUpload(localStorageDir, bucket, object string if err != nil { log.Panicf("upoad part failed, err: %v", err) } + multiPartFile.memFile.Sync() //nolint:errcheck total += cn log.Println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uploaded:", total, " new:", cn) } else { @@ -168,7 +169,7 @@ func (zob *zcnObjects) newMultiPartUpload(localStorageDir, bucket, object string if err != nil { log.Panic(err) } - + multiPartFile.memFile.Sync() //nolint:errcheck total += cn log.Println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uploaded:", total, " new:", cn, " duration:", time.Since(st)) return From c18e21b2740009d736711e8d5d8c464dd37f0945 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Wed, 7 Feb 2024 02:32:48 +0530 Subject: [PATCH 04/11] update gosdk --- go.mod | 4 ++-- go.sum | 8 ++++---- go.work.sum | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index ecc978c09..254fb3c1b 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( cloud.google.com/go/storage v1.27.0 github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.11.1-0.20240131095622-ff672e0bd530 + github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf github.com/Azure/azure-pipeline-go v0.2.2 github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Shopify/sarama v1.28.0 @@ -162,7 +162,7 @@ require ( github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/herumi/bls-go-binary v1.31.0 // indirect - github.com/hitenjain14/fasthttp v0.0.0-20240129191709-9e0a59b0bd2c // indirect + github.com/hitenjain14/fasthttp v0.0.0-20240201092245-8e4835c0e974 // indirect github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect diff --git a/go.sum b/go.sum index afc017b8c..b300ec17a 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.11.1-0.20240131095622-ff672e0bd530 h1:Bhv4kQfjzn4lRGWkRCZnLoJH3oIqf1bAY7lZSKwSQgE= -github.com/0chain/gosdk v1.11.1-0.20240131095622-ff672e0bd530/go.mod h1:yjFLuyINo6rx9WbV3zf0XZTdyBdNWt6UkI4gTUwRSX0= +github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf h1:0EVaQmr5mANzk0GZS70jXVgvnVgd8WUaqVca6duWdrQ= +github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf/go.mod h1:Mr2n7yz2pH2mfr1IZSuQ6Cvtw36UQjV0rYmnyHMBEYg= github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= @@ -872,8 +872,8 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/herumi/bls-go-binary v1.31.0 h1:L1goQ2tMtGgpXCg5AwHAdJQpLs/pfnWWEc3Wog6OhmI= github.com/herumi/bls-go-binary v1.31.0/go.mod h1:O4Vp1AfR4raRGwFeQpr9X/PQtncEicMoOe6BQt1oX0Y= -github.com/hitenjain14/fasthttp v0.0.0-20240129191709-9e0a59b0bd2c h1:j9okwmdumHG3vLk91JG10ZLQXVHD3zM4Uq6Dlv4zTRQ= -github.com/hitenjain14/fasthttp v0.0.0-20240129191709-9e0a59b0bd2c/go.mod h1:RZMcXy7u4S+E97IXYTe7WHZ3+mCYOh4vys8PkIGZeXk= +github.com/hitenjain14/fasthttp v0.0.0-20240201092245-8e4835c0e974 h1:oEjH9SSKBlzwDyYjzZaqRpxo7GlfUJCyRoOk7QHKSDs= +github.com/hitenjain14/fasthttp v0.0.0-20240201092245-8e4835c0e974/go.mod h1:RZMcXy7u4S+E97IXYTe7WHZ3+mCYOh4vys8PkIGZeXk= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= diff --git a/go.work.sum b/go.work.sum index 6361dfd90..e8769e550 100644 --- a/go.work.sum +++ b/go.work.sum @@ -134,6 +134,8 @@ github.com/0chain/gosdk v1.8.5/go.mod h1:JeaXA7gbncHoYbKixUnM58+7S2E9z7IKYY+fV0I github.com/0chain/gosdk v1.10.1-0.20231114143641-51b9f0240b64 h1:DBDslN917WflFB3FFWBU9ISgym5tye0gBVw0N3m7Fmk= github.com/0chain/gosdk v1.10.1-0.20231114143641-51b9f0240b64/go.mod h1:l/c+X5v6RMyzWUib6FFPdK5bTAzAJ7PojhEvELp3LGk= github.com/0chain/gosdk v1.10.1-0.20231210164918-9b9b8e0d5c89/go.mod h1:DAg/de6vodjEa7CM1/LjElOwntRtNV5lb9rMRaR7fzU= +github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf h1:0EVaQmr5mANzk0GZS70jXVgvnVgd8WUaqVca6duWdrQ= +github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf/go.mod h1:Mr2n7yz2pH2mfr1IZSuQ6Cvtw36UQjV0rYmnyHMBEYg= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= @@ -308,6 +310,8 @@ github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR3 github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/herumi/bls-go-binary v1.30.4 h1:djGiorPb4lFVRF/lsyB+EHVGVlcE7CYRmJKu72Vdpnk= +github.com/hitenjain14/fasthttp v0.0.0-20240201092245-8e4835c0e974 h1:oEjH9SSKBlzwDyYjzZaqRpxo7GlfUJCyRoOk7QHKSDs= +github.com/hitenjain14/fasthttp v0.0.0-20240201092245-8e4835c0e974/go.mod h1:RZMcXy7u4S+E97IXYTe7WHZ3+mCYOh4vys8PkIGZeXk= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= @@ -448,6 +452,7 @@ github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBn github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= @@ -505,6 +510,7 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= From d3ab09e0f269692477bdafea892cc26c460b17f0 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sat, 10 Feb 2024 02:36:55 +0530 Subject: [PATCH 05/11] add dir log --- cmd/gateway/zcn/dStorage.go | 20 +++++++++++++++----- go.mod | 2 +- go.sum | 4 ++-- go.work.sum | 6 ++---- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/cmd/gateway/zcn/dStorage.go b/cmd/gateway/zcn/dStorage.go index 7c0b1d70f..ced2106a6 100644 --- a/cmd/gateway/zcn/dStorage.go +++ b/cmd/gateway/zcn/dStorage.go @@ -243,9 +243,23 @@ func getFileReader(ctx context.Context, ctx, ctxCncl = context.WithTimeout(ctx, getTimeOut(uint64(objectInfo.Size))) defer ctxCncl() + r, err := os.Create(localFilePath) + if err != nil { + return nil, nil, "", err + } + + stat, err := r.Stat() + if err != nil { + return nil, nil, "", err + } + if stat.IsDir() { + log.Println("^^^^^^^^getFileReader: file is a directory") + return nil, nil, "", errors.New("file is a directory") + } + log.Println("^^^^^^^^getFileReader: starting download") st := time.Now() - err = alloc.DownloadFile(localFilePath, remotePath, false, &cb, true) + err = alloc.DownloadFileToFileHandler(r, remotePath, false, &cb, true) if err != nil { return nil, nil, "", err } @@ -263,10 +277,6 @@ func getFileReader(ctx context.Context, ds.done = true ds.downloadTime = tm ds.wg.Done() - r, err := os.Open(localFilePath) - if err != nil { - return nil, nil, "", err - } ds.reader = r mu.Unlock() log.Println("^^^^^^^^getFileReader: finish download") diff --git a/go.mod b/go.mod index 254fb3c1b..afd077277 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( cloud.google.com/go/storage v1.27.0 github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf + github.com/0chain/gosdk v1.12.1-0.20240207160420-c93fe2c32a7a github.com/Azure/azure-pipeline-go v0.2.2 github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Shopify/sarama v1.28.0 diff --git a/go.sum b/go.sum index b300ec17a..9233da10d 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf h1:0EVaQmr5mANzk0GZS70jXVgvnVgd8WUaqVca6duWdrQ= -github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf/go.mod h1:Mr2n7yz2pH2mfr1IZSuQ6Cvtw36UQjV0rYmnyHMBEYg= +github.com/0chain/gosdk v1.12.1-0.20240207160420-c93fe2c32a7a h1:Mzx+EXqij/rI/UAaH+3sEud5WTwvtnJIZno8qb5fseY= +github.com/0chain/gosdk v1.12.1-0.20240207160420-c93fe2c32a7a/go.mod h1:Mr2n7yz2pH2mfr1IZSuQ6Cvtw36UQjV0rYmnyHMBEYg= github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= diff --git a/go.work.sum b/go.work.sum index e8769e550..ed3fa2d13 100644 --- a/go.work.sum +++ b/go.work.sum @@ -134,8 +134,8 @@ github.com/0chain/gosdk v1.8.5/go.mod h1:JeaXA7gbncHoYbKixUnM58+7S2E9z7IKYY+fV0I github.com/0chain/gosdk v1.10.1-0.20231114143641-51b9f0240b64 h1:DBDslN917WflFB3FFWBU9ISgym5tye0gBVw0N3m7Fmk= github.com/0chain/gosdk v1.10.1-0.20231114143641-51b9f0240b64/go.mod h1:l/c+X5v6RMyzWUib6FFPdK5bTAzAJ7PojhEvELp3LGk= github.com/0chain/gosdk v1.10.1-0.20231210164918-9b9b8e0d5c89/go.mod h1:DAg/de6vodjEa7CM1/LjElOwntRtNV5lb9rMRaR7fzU= -github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf h1:0EVaQmr5mANzk0GZS70jXVgvnVgd8WUaqVca6duWdrQ= -github.com/0chain/gosdk v1.12.1-0.20240206203835-f95b7551d4bf/go.mod h1:Mr2n7yz2pH2mfr1IZSuQ6Cvtw36UQjV0rYmnyHMBEYg= +github.com/0chain/gosdk v1.12.1-0.20240207160420-c93fe2c32a7a h1:Mzx+EXqij/rI/UAaH+3sEud5WTwvtnJIZno8qb5fseY= +github.com/0chain/gosdk v1.12.1-0.20240207160420-c93fe2c32a7a/go.mod h1:Mr2n7yz2pH2mfr1IZSuQ6Cvtw36UQjV0rYmnyHMBEYg= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= @@ -310,8 +310,6 @@ github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR3 github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/herumi/bls-go-binary v1.30.4 h1:djGiorPb4lFVRF/lsyB+EHVGVlcE7CYRmJKu72Vdpnk= -github.com/hitenjain14/fasthttp v0.0.0-20240201092245-8e4835c0e974 h1:oEjH9SSKBlzwDyYjzZaqRpxo7GlfUJCyRoOk7QHKSDs= -github.com/hitenjain14/fasthttp v0.0.0-20240201092245-8e4835c0e974/go.mod h1:RZMcXy7u4S+E97IXYTe7WHZ3+mCYOh4vys8PkIGZeXk= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= From 16c6527f170c2cccb3f4dbeefaad37f8ff7fd228 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sat, 10 Feb 2024 03:05:38 +0530 Subject: [PATCH 06/11] add log --- cmd/gateway/zcn/dStorage.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmd/gateway/zcn/dStorage.go b/cmd/gateway/zcn/dStorage.go index ced2106a6..b33df9a1d 100644 --- a/cmd/gateway/zcn/dStorage.go +++ b/cmd/gateway/zcn/dStorage.go @@ -252,10 +252,7 @@ func getFileReader(ctx context.Context, if err != nil { return nil, nil, "", err } - if stat.IsDir() { - log.Println("^^^^^^^^getFileReader: file is a directory") - return nil, nil, "", errors.New("file is a directory") - } + log.Println("^^^^^^^^getFileReader: file stat: ", stat.IsDir()) log.Println("^^^^^^^^getFileReader: starting download") st := time.Now() From 8609953b47c42d042f7131600cebb22f1fbe45f0 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sun, 11 Feb 2024 01:36:15 +0530 Subject: [PATCH 07/11] add start log --- cmd/gateway/zcn/dStorage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gateway/zcn/dStorage.go b/cmd/gateway/zcn/dStorage.go index b33df9a1d..e1e9053f7 100644 --- a/cmd/gateway/zcn/dStorage.go +++ b/cmd/gateway/zcn/dStorage.go @@ -206,7 +206,7 @@ func getObjectRef(alloc *sdk.Allocation, bucket, object, remotePath string) (*mi func getFileReader(ctx context.Context, alloc *sdk.Allocation, bucket, object, remotePath string) (*os.File, *minio.ObjectInfo, string, error) { - + log.Println("^^^^^^^^getFileReader start: remotePath: ", remotePath) localFilePath := filepath.Join(tempdir, remotePath) mu.Lock() From 5f7f16e975b4237044d75b3b1d0702d6a911e209 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sun, 11 Feb 2024 01:44:09 +0530 Subject: [PATCH 08/11] add error log --- cmd/gateway/zcn/dStorage.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/gateway/zcn/dStorage.go b/cmd/gateway/zcn/dStorage.go index e1e9053f7..70eb4d72b 100644 --- a/cmd/gateway/zcn/dStorage.go +++ b/cmd/gateway/zcn/dStorage.go @@ -243,13 +243,17 @@ func getFileReader(ctx context.Context, ctx, ctxCncl = context.WithTimeout(ctx, getTimeOut(uint64(objectInfo.Size))) defer ctxCncl() + log.Println("^^^^^^^^getFileReader: creating file handler") + r, err := os.Create(localFilePath) if err != nil { + log.Println("^^^^^^^^getFileReader: error creating file handler: ", err) return nil, nil, "", err } stat, err := r.Stat() if err != nil { + log.Println("^^^^^^^^getFileReader: error getting file stat: ", err) return nil, nil, "", err } log.Println("^^^^^^^^getFileReader: file stat: ", stat.IsDir()) From 6a9bb1f5d310645f9c5d652c92e4b3e24b267f65 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sun, 11 Feb 2024 01:50:24 +0530 Subject: [PATCH 09/11] create temp file --- cmd/gateway/zcn/dStorage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gateway/zcn/dStorage.go b/cmd/gateway/zcn/dStorage.go index 70eb4d72b..dc499d27a 100644 --- a/cmd/gateway/zcn/dStorage.go +++ b/cmd/gateway/zcn/dStorage.go @@ -245,7 +245,7 @@ func getFileReader(ctx context.Context, log.Println("^^^^^^^^getFileReader: creating file handler") - r, err := os.Create(localFilePath) + r, err := os.CreateTemp("", "zcn*") if err != nil { log.Println("^^^^^^^^getFileReader: error creating file handler: ", err) return nil, nil, "", err From 909760d571e7202466fbf8b84056ef2e52347e17 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sun, 11 Feb 2024 02:01:40 +0530 Subject: [PATCH 10/11] use ref name --- cmd/gateway/zcn/dStorage.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cmd/gateway/zcn/dStorage.go b/cmd/gateway/zcn/dStorage.go index dc499d27a..3eb50997e 100644 --- a/cmd/gateway/zcn/dStorage.go +++ b/cmd/gateway/zcn/dStorage.go @@ -245,19 +245,12 @@ func getFileReader(ctx context.Context, log.Println("^^^^^^^^getFileReader: creating file handler") - r, err := os.CreateTemp("", "zcn*") + r, err := os.Create(filepath.Join(tempdir, objectInfo.Name)) if err != nil { log.Println("^^^^^^^^getFileReader: error creating file handler: ", err) return nil, nil, "", err } - stat, err := r.Stat() - if err != nil { - log.Println("^^^^^^^^getFileReader: error getting file stat: ", err) - return nil, nil, "", err - } - log.Println("^^^^^^^^getFileReader: file stat: ", stat.IsDir()) - log.Println("^^^^^^^^getFileReader: starting download") st := time.Now() err = alloc.DownloadFileToFileHandler(r, remotePath, false, &cb, true) From 222a6e6b82ac4dd7b17a22ea1646af36181a63af Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sun, 11 Feb 2024 02:08:48 +0530 Subject: [PATCH 11/11] open reader --- cmd/gateway/zcn/dStorage.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/gateway/zcn/dStorage.go b/cmd/gateway/zcn/dStorage.go index 3eb50997e..f28e1cda2 100644 --- a/cmd/gateway/zcn/dStorage.go +++ b/cmd/gateway/zcn/dStorage.go @@ -245,7 +245,7 @@ func getFileReader(ctx context.Context, log.Println("^^^^^^^^getFileReader: creating file handler") - r, err := os.Create(filepath.Join(tempdir, objectInfo.Name)) + f, err := os.Create(filepath.Join(tempdir, objectInfo.Name)) if err != nil { log.Println("^^^^^^^^getFileReader: error creating file handler: ", err) return nil, nil, "", err @@ -253,7 +253,7 @@ func getFileReader(ctx context.Context, log.Println("^^^^^^^^getFileReader: starting download") st := time.Now() - err = alloc.DownloadFileToFileHandler(r, remotePath, false, &cb, true) + err = alloc.DownloadFileToFileHandler(f, remotePath, false, &cb, true) if err != nil { return nil, nil, "", err } @@ -271,6 +271,7 @@ func getFileReader(ctx context.Context, ds.done = true ds.downloadTime = tm ds.wg.Done() + r, _ := os.Open(filepath.Join(tempdir, objectInfo.Name)) ds.reader = r mu.Unlock() log.Println("^^^^^^^^getFileReader: finish download")