Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
da32de7
:sparkles: added integration test github action
shravanshetty1 May 9, 2021
6c49f89
:wrench: add integration tests to make file
shravanshetty1 May 9, 2021
4bbe9d2
:green-heart: debugging integration test github action
shravanshetty1 May 9, 2021
b640f26
:green_heart: attempting to fix integration-test github action
shravanshetty1 May 9, 2021
c00e672
:white_check_mark: added testdata controller and added working GetAll…
shravanshetty1 May 9, 2021
5e098a1
:white_check_mark:
shravanshetty1 May 9, 2021
5ca5b5b
:white_check_mark: add GetFileStats rpc integration test
shravanshetty1 May 9, 2021
1a88e6a
:white_check_mark: GetObjectPath integration tests
shravanshetty1 May 9, 2021
92a7530
:white_check_mark: added list entities integration tests
shravanshetty1 May 9, 2021
374535b
:white_check_mark: added GetReferencePath integration test
shravanshetty1 May 9, 2021
2d399fc
:white_check_mark: added GetObjectTree rpc integration tests
shravanshetty1 May 9, 2021
1adbfe5
Merge branch 'master' into 88-integration-tests-2
shravanshetty1 May 9, 2021
bb6e89f
:recycle: moved go.mod to parent Directory and updated import paths
shravanshetty1 May 10, 2021
6c28e36
:recycle: fixed test and lint
shravanshetty1 May 10, 2021
a59c6d4
:green_heart: fixing build github action
shravanshetty1 May 10, 2021
aa14e96
Revert ":recycle: fixed test and lint"
shravanshetty1 May 10, 2021
f9767c0
:recycling: change make test and make lint commands
shravanshetty1 May 10, 2021
fda9187
:sparkles: added server reflection for grpc
shravanshetty1 May 12, 2021
491244d
:memo: added docs relating to how to interact with grpc api's
shravanshetty1 May 12, 2021
794d0de
:sparkles: pointed get allocation handler to grpc
shravanshetty1 May 14, 2021
9be4c22
:sparkles: pointed getfilemeta and getfilestats handler to equivalent…
shravanshetty1 May 15, 2021
6d472dc
:sparkles: pointed all read http handlers to grpc handler
shravanshetty1 May 16, 2021
cf11e5c
:sparkles: updated grpc handlers to handle client signatures
shravanshetty1 May 16, 2021
4867ea2
:green_heart: attempting to fix tests
shravanshetty1 May 16, 2021
db33877
:sparkles: implemented listingdatatoref function and fixed some tests
shravanshetty1 May 16, 2021
19e953e
Merge pull request #128 from 0chain/123-grpc-server-rerflection
Sriep May 17, 2021
149118e
:sparkles: make sure conversion functions can handle nil and other ed…
shravanshetty1 May 17, 2021
5d5911a
Merge branch 'grpc' into 121-gomod-parent
shravanshetty1 May 17, 2021
8fe2a19
:added: grpc response handler functions
shravanshetty1 May 17, 2021
c260249
Merge pull request #124 from 0chain/121-gomod-parent
Sriep May 17, 2021
89ff675
Merge branch 'grpc' into 68-http-to-grpc-handler-2
shravanshetty1 May 17, 2021
f796055
Merge pull request #136 from 0chain/68-http-to-grpc-handler-2
Sriep May 19, 2021
fcec8d4
:sparkles: removed redundant request context and moved script folder …
shravanshetty1 May 20, 2021
92538aa
Delete clean-up.sh
shravanshetty1 May 20, 2021
378d34e
:green_heart: fixing github action
shravanshetty1 May 20, 2021
0ca8975
Merge branch '89-grpc-req-context' of github.com:0chain/blobber into …
shravanshetty1 May 20, 2021
bc76432
Merge branch 'grpc' into 88-integration-tests-2
shravanshetty1 May 21, 2021
163688e
:white_check_mark: updated tests and added table driven tests
shravanshetty1 May 21, 2021
fc7383c
:green_heart: fix tests
shravanshetty1 May 21, 2021
55b3dd1
Merge pull request #140 from 0chain/89-grpc-req-context
shravanshetty1 May 21, 2021
8f586d0
Merge branch 'grpc' into 88-integration-tests-2
shravanshetty1 May 21, 2021
f2d004a
:white_check_mark: updated tests to handle metadata
shravanshetty1 May 21, 2021
577a6a0
:green_heart: fix test
shravanshetty1 May 21, 2021
a32fcf2
:white_check_mark: updated tests
shravanshetty1 May 21, 2021
4cc64a6
:art: refactor to remove circular dependencies
shravanshetty1 May 22, 2021
2fbade9
Merge pull request #144 from 0chain/143-refactor-circular-dep
shravanshetty1 May 22, 2021
ddb32f3
Merge branch 'grpc' into 88-integration-tests-2
shravanshetty1 May 22, 2021
1f7d3c3
added integration test to make file to fix github action
shravanshetty1 May 22, 2021
caf3733
:art: simplified test implementation
shravanshetty1 May 23, 2021
02da8de
:green_heart: remove uneeded github actions
shravanshetty1 May 23, 2021
71e06a3
:green_heart: renamed github action to test
shravanshetty1 May 23, 2021
3019901
Merge pull request #120 from 0chain/88-integration-tests-2
shravanshetty1 May 23, 2021
0505a3e
:sparkles: added grpc equivalent of commit api
shravanshetty1 May 23, 2021
85e46a9
update attributes grpc added
senpathi May 26, 2021
c3599c4
update attributes grpc tests added
senpathi May 26, 2021
b7e9679
tests updated to simpler test methods
senpathi May 26, 2021
f478722
mock files
senpathi May 26, 2021
21e7c0c
common changes added to grpc
senpathi May 26, 2021
3846f16
mock files
senpathi May 26, 2021
87e350c
Merge branch 'common-changes-object-operation-grpc' into 137-grpc-upd…
senpathi May 26, 2021
6d28261
copy object handler grpc added
senpathi May 26, 2021
2e165d5
copy object handler grpc tests added
senpathi May 26, 2021
5f4ee7e
rename object handler grpc added
senpathi May 26, 2021
77dda14
rename object handler grpc tests added
senpathi May 26, 2021
89921d3
download file handler grpc added
senpathi May 26, 2021
d0a4a7e
read maker entity interface implemented
senpathi May 26, 2021
aaeaddc
download file handler grpc tests added
senpathi May 26, 2021
cd7af0f
refs #165, added .proto config for CalculateHashHandler
vivekv96 May 27, 2021
10c15ed
refs #165, updated .proto config, added CalculateHashHandler skeleton
vivekv96 May 27, 2021
df20081
refs #165, migrated CalculateHashHandler to GRPC
vivekv96 May 27, 2021
66a3af2
refs #165, updated .proto config
vivekv96 May 27, 2021
b46fba0
:white_check_mark: refs #165, added tests
vivekv96 May 27, 2021
3e17121
:memo: updated the grpc developer docs
shravanshetty1 May 27, 2021
f0fed3c
:construction_worker: Updated the generated-files-integrity section o…
vivekv96 May 28, 2021
3c2c22b
:green_heart: Fixed protoc version mismatch issue
vivekv96 May 28, 2021
557240c
:white_check_mark: added unit tests
shravanshetty1 May 29, 2021
0949276
upload file handler grpc added
senpathi May 30, 2021
b6b6cc9
upload file handler grpc tests added
senpathi May 30, 2021
f71e01c
:hammer: attached debugger to blobber in debug mode
shravanshetty1 May 30, 2021
d2d5e19
missing file from previous commit
shravanshetty1 May 30, 2021
f55016b
Merge pull request #173 from 0chain/170-debugger-docker
shravanshetty1 May 30, 2021
5dc0272
workflow updated for pull requests
senpathi May 30, 2021
75984a2
workflow updated for pull requests
senpathi May 30, 2021
efa819e
workflow updated for pull requests
senpathi May 30, 2021
d0d4c0f
workflow updated for pull requests
senpathi May 30, 2021
7f014d5
workflow updated for pull requests
senpathi May 30, 2021
2373252
proto versions mismatch fixed
senpathi May 30, 2021
00f16ca
proto versions mismatch fixed
senpathi May 30, 2021
d8edc7b
proto versions mismatch fixed
senpathi May 30, 2021
34ca017
proto versions mismatch fixed
senpathi May 30, 2021
dea8a98
proto versions mismatch fixed
senpathi May 30, 2021
2f28181
Merge branch 'grpc' into 147-grpc-commit-method
shravanshetty1 May 30, 2021
a6c4de3
:white_check_mark: add integration tests
shravanshetty1 May 30, 2021
f1e98e3
:memo: updated the grpc developer docs
shravanshetty1 May 30, 2021
05c008d
:memo: changed section order in grpc developer docs
shravanshetty1 May 30, 2021
401cc9d
:memo: added missing punctuation grpc developer docs
shravanshetty1 May 30, 2021
76b7e4a
:adhesive_bandage: changed .proto file rpc url to v2, and added conve…
vivekv96 May 31, 2021
83ab5c9
:sparkles: migrated CommitMetaTxnHandler to gRPC
vivekv96 May 31, 2021
3fff85a
Merge pull request #168 from 0chain/165-calculate-hash-grpc
shravanshetty1 May 31, 2021
9e93648
Merge pull request #167 from 0chain/126-add-dev-docs
shravanshetty1 May 31, 2021
738191d
Merge branch 'grpc' into 147-grpc-commit-method
shravanshetty1 May 31, 2021
95a906c
missing changes from previous commit
shravanshetty1 May 31, 2021
f4ff3af
:bug: adding correct grpc gateway handler
shravanshetty1 May 31, 2021
c1a81f9
:package: updating grpc generated files
shravanshetty1 May 31, 2021
a73ef17
Merge pull request #150 from 0chain/147-grpc-commit-method
shravanshetty1 May 31, 2021
13ee27c
go lint timeout updated
senpathi May 31, 2021
e972f71
v2 in request path fixed
senpathi May 31, 2021
34621cb
empty file deleted
senpathi May 31, 2021
a8f0c00
:twisted_rightwards_arrows: resolved merge conflicts with grpc branch
vivekv96 Jun 1, 2021
c6d0803
:white_check_mark: added integration tests
vivekv96 Jun 1, 2021
0423ba7
reviews applied
senpathi Jun 1, 2021
13f88b3
mocks
senpathi Jun 1, 2021
58d82a9
reviews applied
senpathi Jun 1, 2021
5e3242c
reviews applied
senpathi Jun 1, 2021
e5984e8
endpoint version updated
senpathi Jun 1, 2021
d9f85a5
reviews applied
senpathi Jun 1, 2021
935a25b
mocks
senpathi Jun 1, 2021
05e22d7
:white_check_mark: added unit tests
vivekv96 Jun 2, 2021
44c55ca
:sparkles: refs #164, migrated CollaboratorHandler to gRPC
vivekv96 Jun 2, 2021
9dc6285
reviews applied
senpathi Jun 2, 2021
ac11bb9
Merge pull request #175 from 0chain/163-commit-meta-txn
shravanshetty1 Jun 2, 2021
a8d912c
:white_check_mark: refs #164, added unit tests
vivekv96 Jun 3, 2021
cbb944c
:twisted_rightwards_arrows: resolved merge conflicts with grpc branch
vivekv96 Jun 3, 2021
2938813
:white_check_mark: fixes #164, added integration tests
vivekv96 Jun 3, 2021
845f459
:wrench: fixes #164, added HTTP Methods to handler definition
vivekv96 Jun 3, 2021
f444a2d
Merge branch 'grpc' into 137-backup
senpathi Jun 5, 2021
71d4de5
conflicts resolved with grpc
senpathi Jun 5, 2021
62ac65e
Merge branch 'grpc' into 153-backup
senpathi Jun 5, 2021
cc965f9
153 conflicts resolved with grpc
senpathi Jun 5, 2021
b9c5dc3
Merge branch 'grpc' into 156-backup
senpathi Jun 5, 2021
7603fb4
156 conflicts resolved with grpc
senpathi Jun 5, 2021
f43c1f7
156 conflicts resolved with grpc
senpathi Jun 5, 2021
c9b36cb
Merge branch 'grpc' into 158-backup
senpathi Jun 5, 2021
62328ce
158 conflicts resolved with grpc
senpathi Jun 5, 2021
fb87b06
Merge pull request #185 from 0chain/164-collaborator-allocation
shravanshetty1 Jun 5, 2021
dd4b27f
Merge branch 'grpc' into 169-backup
senpathi Jun 5, 2021
7e3ade8
169 conflicts resolved with grpc
senpathi Jun 5, 2021
0140cd7
Merge branch 'grpc' into 137-backup
senpathi Jun 5, 2021
b2701f4
137 conflicts resolved with grpc ii
senpathi Jun 5, 2021
2180be1
Merge branch 'grpc' into 153-backup
senpathi Jun 5, 2021
bc47664
153 conflicts resolved with grpc ii
senpathi Jun 5, 2021
8fddd85
153 conflicts resolved with grpc ii
senpathi Jun 5, 2021
6c63228
Merge pull request #152 from senpathi/137-grpc-update-object-attribut…
shravanshetty1 Jun 7, 2021
54aa9e1
Merge branch 'grpc' into 153-backup
senpathi Jun 7, 2021
a41eabd
153 conflicts resolved with grpc iii
senpathi Jun 7, 2021
e3368a1
Merge pull request #155 from senpathi/153-grpc-copy-handler
shravanshetty1 Jun 15, 2021
71f6458
:sparkles: pointed getallocation grpc to http
shravanshetty1 Jun 15, 2021
a48c03e
:sparkles: grpc -> http getfilemetadata
shravanshetty1 Jun 15, 2021
3d3cd2f
:sparkles: grpc -> http getfilstats
shravanshetty1 Jun 15, 2021
d14d661
:sparkles: grpc -> http listentities
shravanshetty1 Jun 15, 2021
17356e0
:sparkles: grpc -> http objectpath
shravanshetty1 Jun 15, 2021
15cb22c
:sparkles: grpc -> http referencePath
shravanshetty1 Jun 15, 2021
9f12e10
:sparkles: grpc -> http objecttree
shravanshetty1 Jun 15, 2021
f370af4
:sparkles: grpc -> http commithash
shravanshetty1 Jun 15, 2021
d48605f
:sparkles: grpc -> http collaboratos and commitmeta
shravanshetty1 Jun 15, 2021
d085d2c
:sparkles: grpc -> http commit
shravanshetty1 Jun 15, 2021
598a163
fixing lint
shravanshetty1 Jun 15, 2021
2cefbd0
:sparkles: grpc -> http object_operation handlers
shravanshetty1 Jun 15, 2021
3cba91e
fixing lint errors
shravanshetty1 Jun 15, 2021
aa831b6
Merge pull request #212 from 0chain/211-grpc-http
shravanshetty1 Jun 15, 2021
f1e82db
adding missing test
shravanshetty1 Jun 15, 2021
af5a317
:art: renaming converter functions
shravanshetty1 Jun 15, 2021
f2022dc
:art: adding responsehandler functions for external dependencies
shravanshetty1 Jun 15, 2021
199339c
Merge pull request #213 from 0chain/grpc-patch-1
shravanshetty1 Jun 15, 2021
86d056f
Merge branch 'grpc' into 156-backup
senpathi Jun 15, 2021
3b916bb
grpc -> http implemented for rename handler
senpathi Jun 15, 2021
6c799b2
Merge branch 'grpc' into 156-backup
senpathi Jun 15, 2021
23b7a80
grpc merge resolved for rename handler
senpathi Jun 15, 2021
b9bf3ba
Merge pull request #157 from senpathi/156-grpc-rename-object-handler
shravanshetty1 Jun 16, 2021
d021ae9
Merge branch 'master' into grpc
shravanshetty1 Jun 16, 2021
e1f2731
missing changes from previous commit
shravanshetty1 Jun 16, 2021
b1a5f83
deleting mock package
shravanshetty1 Jun 16, 2021
a5bc5df
test file deleted
senpathi Jun 17, 2021
61d3822
Merge branch 'grpc' into 158-backup
senpathi Jun 17, 2021
90057e2
grpc -> http download handler updated and resolved conflicts
senpathi Jun 17, 2021
47e1fac
go lint error fixed on store handler
senpathi Jun 17, 2021
802a04d
delete mocks
senpathi Jun 18, 2021
2fa95d9
Merge pull request #160 from senpathi/158-grpc-download-file-handler
shravanshetty1 Jun 19, 2021
6e91654
Merge branch 'grpc' into 169-backup
senpathi Jun 20, 2021
c6bcd74
grpc -> http upload handler merged grpc
senpathi Jun 20, 2021
23817e4
:white_check_mark: added tests for getcalculatehash
shravanshetty1 Jun 21, 2021
ab33a2c
:green_heart: fixing ci
shravanshetty1 Jun 21, 2021
dbb7bef
readding server reflection
shravanshetty1 Jun 21, 2021
1530df8
grpc_gateway implementation
senpathi Jun 21, 2021
e280e34
integration tests inited for upload
senpathi Jun 27, 2021
054dfc1
Merge branch 'grpc' into 169-backup
senpathi Jun 27, 2021
c2978ef
resolve conflicts with grpc
senpathi Jun 27, 2021
d3e7720
integrated tests WIP
senpathi Jun 27, 2021
266ad76
upload handler integrated tests implemented
senpathi Jun 27, 2021
5327565
upload handler integrated tests implemented
senpathi Jun 27, 2021
3c600d3
upload attributes handler integrated tests implemented
senpathi Jun 28, 2021
ad10f77
update attributes handler integrated tests implemented
senpathi Jun 28, 2021
f217228
copy object handler integrated tests implemented
senpathi Jun 28, 2021
77f6db7
rename object handler integrated tests implemented
senpathi Jun 28, 2021
25229dd
download handler request multipart implemented
senpathi Jun 28, 2021
5852f50
download handler request multipart writer closed
senpathi Jun 28, 2021
8f1028a
download handler integration tests WIP
senpathi Jun 28, 2021
1d29d5a
download handler integration tests WIP
senpathi Jun 28, 2021
0cadb69
download handler integration tests edit makefile
senpathi Jun 28, 2021
5ba8617
upload handler grpc method name changed
senpathi Jun 30, 2021
8c43d1e
Merge pull request #172 from senpathi/169-grpc-upload-file-handler
shravanshetty1 Jun 30, 2021
c89ec9b
Merge branch 'grpc' into 216-grpc-integration-tests
senpathi Jun 30, 2021
05433ac
:zap: added support for gzip compression
shravanshetty1 Jun 30, 2021
1f14848
Merge branch 'grpc' of github.com:0chain/blobber into grpc
shravanshetty1 Jun 30, 2021
62dd5f4
:bug: grpc port is now optional
shravanshetty1 Jun 30, 2021
2c81950
make file mkdir removed and added to test file
senpathi Jun 30, 2021
5ec5481
lint fixed
senpathi Jun 30, 2021
7381c2d
permission changes added
senpathi Jun 30, 2021
5ddf11c
:bug: added correct http methods to some of the grpc methods for grpc…
shravanshetty1 Jun 30, 2021
4f4d560
add permission to test workflow
senpathi Jun 30, 2021
edf127a
:bug: added tools package to track tool dependency and updated grpc r…
shravanshetty1 Jun 30, 2021
33903b0
remove permission to test workflow
senpathi Jun 30, 2021
8e2f479
add permission to test workflow makefile
senpathi Jun 30, 2021
718247d
add permission to test
senpathi Jun 30, 2021
ac85f3e
add sudo permission to test in makefile
senpathi Jun 30, 2021
fa1999e
remove chmod in test file
senpathi Jun 30, 2021
fe6bba1
Merge pull request #229 from senpathi/216-grpc-integration-tests
shravanshetty1 Jun 30, 2021
e6f0053
Merge branch 'master' into grpc
shravanshetty1 Jul 2, 2021
4f7c2be
updated grpc files
shravanshetty1 Jul 2, 2021
a410534
:bug: fixed broken tests
shravanshetty1 Jul 2, 2021
a4b937a
:art: fixed package naming convention
shravanshetty1 Jul 7, 2021
a88f7aa
:bug: fixed compile errors
shravanshetty1 Jul 7, 2021
eed3e4e
:art: seperated integration tests into different files
shravanshetty1 Jul 7, 2021
2712e8c
missing files from previous commit
shravanshetty1 Jul 7, 2021
a2480a5
:bug: fixing tests
shravanshetty1 Jul 7, 2021
e6e2c1b
:green_heart: fixing tests
shravanshetty1 Jul 7, 2021
2650d79
:art: reformatted proto file according to convention
shravanshetty1 Jul 7, 2021
70cb70a
:art: created new file for response creator functions
shravanshetty1 Jul 7, 2021
09fdce5
fix lint errors
shravanshetty1 Jul 7, 2021
936fb11
Merge pull request #243 from 0chain/149-refactor
shravanshetty1 Jul 7, 2021
34d5438
:sparkles: changing default grpc port to 31501
shravanshetty1 Jul 7, 2021
fc38b31
Merge branch 'grpc' of github.com:0chain/blobber into grpc
shravanshetty1 Jul 7, 2021
8534f3b
fixing grpc port in test
shravanshetty1 Jul 7, 2021
1123584
:sparkles: server now handles grpc-web requests
shravanshetty1 Jul 7, 2021
161f904
Merge branch 'master' into grpc
shravanshetty1 Jul 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ on:
release:
types:
- published
pull_request:
paths-ignore:
- '**.md'

env:
BLOBBER_REGISTRY: ${{ secrets.BLOBBER_REGISTRY }}
VALIDATOR_REGISTRY: ${{ secrets.VALIDATOR_REGISTRY }}

jobs:
build:
test:
runs-on: ubuntu-20.04
steps:
- name: Install Go
Expand All @@ -25,21 +28,15 @@ jobs:
- uses: satackey/action-docker-layer-caching@v0.0.11
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
- name: Build
- name: Build test environment and run tests
run: |
./docker.local/bin/blobber.init.setup.sh
docker network create --driver=bridge --subnet=198.18.0.0/15 --gateway=198.18.0.255 testnet0
./docker.local/bin/build.blobber.sh
test:
runs-on: ubuntu-20.04
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14.x
- uses: actions/checkout@v2
- name: Test
run: make test

cd docker.local/blobber1
../bin/blobber.start_bls.sh </dev/null &>/dev/null &
cd ../..
make integration-tests
lint:
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -76,10 +73,9 @@ jobs:
git reset --hard
- name: Generate Files
run: |
cd code/go/0chain.net/blobbercore
./scripts/generate-grpc.sh
- name: Fail if any file has changed
run: if output=$(git status --porcelain) && [ -z "$output" ]; then exit 0; else git status; exit 1; fi;
run: if output=$(git status --porcelain) && [ -z "$output" ]; then exit 0; else git status; git diff; exit 1; fi;

dockerize_blobber:
runs-on: ubuntu-20.04
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.PHONY: test lint
.PHONY: test lint integration-tests

test:
cd code/go/0chain.net; go test ./...;
go test ./...;

lint:
cd code/go/0chain.net; golangci-lint run;
golangci-lint run --timeout 2m0s;

integration-tests:
sudo go test ./... -args integration;
4 changes: 2 additions & 2 deletions code/go/0chain.net/blobber/integration_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
package main

import (
"0chain.net/core/logging"
"github.com/0chain/blobber/code/go/0chain.net/core/logging"

crpc "0chain.net/conductor/conductrpc" // integration tests
crpc "github.com/0chain/blobber/code/go/0chain.net/conductor/conductrpc" // integration tests
)

// start lock, where the miner is ready to connect to blockchain (BC)
Expand Down
74 changes: 44 additions & 30 deletions code/go/0chain.net/blobber/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,30 @@ import (
"runtime"
"strconv"
"time"
"go.uber.org/zap"

"google.golang.org/grpc/reflection"

"github.com/0chain/blobber/code/go/0chain.net/blobbercore/allocation"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/challenge"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/config"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/handler"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/readmarker"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/writemarker"
"github.com/0chain/blobber/code/go/0chain.net/core/build"
"github.com/0chain/blobber/code/go/0chain.net/core/chain"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/core/encryption"
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
. "github.com/0chain/blobber/code/go/0chain.net/core/logging"
"github.com/0chain/blobber/code/go/0chain.net/core/node"

"github.com/0chain/gosdk/zcncore"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/spf13/viper"

"github.com/0chain/gosdk/zcncore"
"0chain.net/blobbercore/allocation"
"0chain.net/blobbercore/challenge"
"0chain.net/blobbercore/config"
"0chain.net/blobbercore/datastore"
"0chain.net/blobbercore/filestore"
"0chain.net/blobbercore/handler"
"0chain.net/blobbercore/readmarker"
"0chain.net/blobbercore/writemarker"
"0chain.net/core/build"
"0chain.net/core/chain"
"0chain.net/core/common"
"0chain.net/core/encryption"
"0chain.net/core/node"
"0chain.net/core/logging"
. "0chain.net/core/logging"
"go.uber.org/zap"
)

var startTime time.Time
Expand All @@ -41,7 +44,7 @@ var filesDir *string
var metadataDB *string

func initHandlers(r *mux.Router) {
r.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
mc := chain.GetServerChain()

fmt.Fprintf(w, "<div>Running since %v ...\n", startTime)
Expand Down Expand Up @@ -285,7 +288,7 @@ func healthCheckOnChainWorker() {

func setup(logDir string) error {
// init blockchain related stuff
zcncore.SetLogFile(logDir + "/0chainBlobber.log", false)
zcncore.SetLogFile(logDir+"/0chainBlobber.log", false)
zcncore.SetLogLevel(3)
if err := zcncore.InitZCNSDK(serverChain.BlockWorker, config.Configuration.SignatureScheme); err != nil {
return err
Expand Down Expand Up @@ -335,7 +338,7 @@ func main() {
flag.Parse()

config.SetupDefaultConfig()
config.SetupConfig()
config.SetupConfig("./config")

config.Configuration.DeploymentMode = byte(*deploymentMode)

Expand Down Expand Up @@ -364,10 +367,6 @@ func main() {
panic("Please specify --port which is the port on which requests are accepted")
}

if *grpcPortString == "" {
panic("Please specify --grpc_port which is the grpc port on which requests are accepted")
}

reader, err := os.Open(*keysFile)
if err != nil {
panic(err)
Expand Down Expand Up @@ -452,11 +451,14 @@ func main() {
methodsOk := handlers.AllowedMethods([]string{"GET", "HEAD", "POST", "PUT",
"DELETE", "OPTIONS"})

rl := common.ConfigRateLimits()
common.ConfigRateLimits()
initHandlers(r)

grpcServer := handler.NewServerWithMiddlewares(rl)
handler.RegisterGRPCServices(r, grpcServer)
grpcServer := handler.NewGRPCServerWithMiddlewares(common.NewGRPCRateLimiter(), r)

if config.Development() {
reflection.Register(grpcServer)
}

rHandler := handlers.CORS(originsOk, headersOk, methodsOk)(r)
if config.Development() {
Expand All @@ -482,12 +484,24 @@ func main() {

Logger.Info("Ready to listen to the requests")
startTime = time.Now().UTC()
go func(grpcPort string) {
go func(gp *string) {
var grpcPort string
if gp != nil {
grpcPort = *gp
}

if grpcPort == "" {
Logger.Error("Could not start grpc server since grpc port has not been specified." +
" Please specify the grpc port in the --grpc_port build arguement to start the grpc server")
return
}

Logger.Info("listening too grpc requests on port - " + grpcPort)
lis, err := net.Listen("tcp", fmt.Sprintf(":%s", grpcPort))
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
log.Fatal(grpcServer.Serve(lis))
}(*grpcPortString)
}(grpcPortString)
log.Fatal(server.ListenAndServe())
}
8 changes: 4 additions & 4 deletions code/go/0chain.net/blobbercore/allocation/allocationchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"context"
"errors"

"0chain.net/blobbercore/datastore"
"0chain.net/blobbercore/reference"
"0chain.net/core/common"
"0chain.net/core/logging"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/core/logging"

"go.uber.org/zap"
"gorm.io/gorm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"encoding/json"
"path/filepath"

"0chain.net/blobbercore/reference"
"0chain.net/blobbercore/stats"
"0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/stats"
"github.com/0chain/blobber/code/go/0chain.net/core/common"

. "0chain.net/core/logging"
. "github.com/0chain/blobber/code/go/0chain.net/core/logging"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions code/go/0chain.net/blobbercore/allocation/copyfilechange.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"encoding/json"
"path/filepath"

"0chain.net/blobbercore/reference"
"0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/core/common"

"gorm.io/datatypes"
)
Expand Down
10 changes: 5 additions & 5 deletions code/go/0chain.net/blobbercore/allocation/deletefilechange.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"encoding/json"
"path/filepath"

"0chain.net/blobbercore/datastore"
"0chain.net/blobbercore/filestore"
"0chain.net/blobbercore/reference"
"0chain.net/core/common"
. "0chain.net/core/logging"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
. "github.com/0chain/blobber/code/go/0chain.net/core/logging"

"go.uber.org/zap"
)
Expand Down
2 changes: 1 addition & 1 deletion code/go/0chain.net/blobbercore/allocation/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"time"

"0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/core/common"

"gorm.io/gorm"
"gorm.io/gorm/clause"
Expand Down
10 changes: 5 additions & 5 deletions code/go/0chain.net/blobbercore/allocation/newfilechange.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"path/filepath"
"strings"

"0chain.net/blobbercore/filestore"
"0chain.net/blobbercore/reference"
"0chain.net/blobbercore/stats"
"0chain.net/blobbercore/util"
"0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/stats"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/util"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
)

type NewFileChange struct {
Expand Down
12 changes: 6 additions & 6 deletions code/go/0chain.net/blobbercore/allocation/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"errors"
"fmt"

"0chain.net/blobbercore/datastore"
"0chain.net/core/chain"
"0chain.net/core/common"
. "0chain.net/core/logging"
"0chain.net/core/node"
"0chain.net/core/transaction"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/core/chain"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
. "github.com/0chain/blobber/code/go/0chain.net/core/logging"
"github.com/0chain/blobber/code/go/0chain.net/core/node"
"github.com/0chain/blobber/code/go/0chain.net/core/transaction"

"gorm.io/gorm"
)
Expand Down
10 changes: 5 additions & 5 deletions code/go/0chain.net/blobbercore/allocation/renamefilechange.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"encoding/json"
"path/filepath"

"0chain.net/blobbercore/reference"
"0chain.net/blobbercore/stats"
"0chain.net/core/common"
."0chain.net/core/logging"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/stats"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
. "github.com/0chain/blobber/code/go/0chain.net/core/logging"

"go.uber.org/zap"
)
Expand Down Expand Up @@ -76,7 +76,7 @@ func (rf *RenameFileChange) ProcessChange(ctx context.Context, change *Allocatio
}
}
if idx < 0 {
Logger.Error("error in file rename", zap.Any("change",rf))
Logger.Error("error in file rename", zap.Any("change", rf))
return nil, common.NewError("file_not_found", "File to rename not found in blobber")
}
//dirRef.Children[idx] = affectedRef
Expand Down
12 changes: 6 additions & 6 deletions code/go/0chain.net/blobbercore/allocation/updatefilechange.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"encoding/json"
"path/filepath"

"0chain.net/blobbercore/filestore"
"0chain.net/blobbercore/stats"
"0chain.net/blobbercore/reference"
"0chain.net/blobbercore/util"
"0chain.net/core/common"
. "0chain.net/core/logging"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/stats"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/util"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
. "github.com/0chain/blobber/code/go/0chain.net/core/logging"

"go.uber.org/zap"
)
Expand Down
14 changes: 7 additions & 7 deletions code/go/0chain.net/blobbercore/allocation/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import (
"math/big"
"time"

"0chain.net/blobbercore/datastore"
"0chain.net/blobbercore/reference"
"0chain.net/core/chain"
"0chain.net/core/common"
"0chain.net/core/lock"
"0chain.net/core/transaction"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/core/chain"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/core/lock"
"github.com/0chain/blobber/code/go/0chain.net/core/transaction"

"gorm.io/gorm"

. "0chain.net/core/logging"
. "github.com/0chain/blobber/code/go/0chain.net/core/logging"
"go.uber.org/zap"
)

Expand Down
Loading