Skip to content

Commit baa754c

Browse files
author
Norman Meier
committed
feat: implement basic datastore benchmark
Signed-off-by: Norman Meier <[email protected]>
1 parent 9ad4a83 commit baa754c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3594
-1506
lines changed

.github/workflows/protobuf.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
- name: Lint
2929
run: buf lint api
3030

31+
- name: Setup protoc
32+
uses: arduino/[email protected]
33+
with:
34+
version: "3.x"
35+
3136
- name: Regenerate
3237
run: make regen
3338

Makefile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
1+
all:
2+
@echo You probably want to cd rn
3+
.PHONY: all
4+
15
clean.gen:
2-
rm -fr \
3-
go/pkg/ipfsman/ipfsman_grpc.pb.go go/pkg/ipfsman/ipfsman.pb.go rn/src/api/ipfsman \
4-
go/pkg/blmod/blmod_grpc.pb.go go/pkg/blmod/blmod.pb.go rn/src/api/blmod
6+
for api in $$(ls api); do rm -fr \
7+
go/pkg/$${api}/$${api}_grpc.pb.go \
8+
go/pkg/$${api}/ipfsman.pb.go \
9+
rn/src/api/$${api} \
10+
; done
11+
rm -f rn/src/api/index.ts
512
.PHONY: clean-gen
613

714
generate:
815
$(MAKE) -C rn node_modules/.mkt
916
buf generate api
17+
set -e; for api in $$(ls api); do \
18+
echo '/* eslint-disable no-dupe-class-members */' > rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts; \
19+
cat rn/src/api/$${api}/v1/$${api}_pb_service.d.ts >> rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts; \
20+
mv rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts rn/src/api/$${api}/v1/$${api}_pb_service.d.ts; \
21+
\
22+
echo '/* eslint-disable eslint-comments/no-unlimited-disable */' > rn/src/api/$${api}/v1/$${api}_pb.new.js; \
23+
cat rn/src/api/$${api}/v1/$${api}_pb.js >> rn/src/api/$${api}/v1/$${api}_pb.new.js; \
24+
mv rn/src/api/$${api}/v1/$${api}_pb.new.js rn/src/api/$${api}/v1/$${api}_pb.js; \
25+
\
26+
echo "export * from './$${api}_pb'" > rn/src/api/$${api}/v1/index.ts; \
27+
echo "export * from './$${api}_pb_service'" >> rn/src/api/$${api}/v1/index.ts; \
28+
\
29+
echo "export * as $${api} from './$${api}/v1'" >> rn/src/api/index.ts; \
30+
done
31+
$(MAKE) -C rn lint.fix
1032
.PHONY: generate
1133

1234
regen: clean.gen

api/blmod/v1/blmod.proto

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ message ModuleInfo {
2020

2121
service LabsModulesService {
2222
rpc AllModules(AllModulesRequest) returns (AllModulesResponse) {}
23-
rpc RunModule(RunModuleRequest) returns (RunModuleResponse) {}
23+
rpc RunModule(RunModuleRequest) returns (stream RunModuleResponse) {}
2424
}
2525

2626

@@ -34,14 +34,9 @@ message AllModulesResponse {
3434

3535
message RunModuleRequest {
3636
string name = 1;
37+
bytes args = 2;
3738
}
3839

3940
message RunModuleResponse {
40-
enum ReportKind {
41-
REPORT_KIND_UNSPECIFIED = 0;
42-
REPORT_KIND_UTF = 1;
43-
REPORT_KIND_MARKDOWN = 2;
44-
}
45-
ReportKind report_kind = 1;
46-
bytes report_data = 2;
41+
bytes payload = 1;
4742
}

api/ipfsman/v1/ipfsman.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ message StartNodeRequest {
1717
message StartNodeResponse {
1818
string id = 1;
1919
repeated string api_maddrs = 2;
20-
repeated string gateway_maddrs = 4;
20+
repeated string gateway_maddrs = 3;
2121
}
2222

2323
message StopNodeRequest {

buf.gen.yaml

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,36 @@ module berty.tech/labs
33
go 1.17
44

55
require (
6+
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
67
github.com/improbable-eng/grpc-web v0.15.0
78
github.com/ipfs-shipyard/gomobile-ipfs/go v0.0.0-20220201124626-a36f2adc5a3a
9+
github.com/ipfs/go-datastore v0.5.1
10+
github.com/ipfs/go-ds-badger v0.3.0
11+
github.com/ipfs/go-ds-badger2 v0.1.3
12+
github.com/ipfs/go-ds-flatfs v0.5.1
13+
github.com/ipfs/go-ds-leveldb v0.5.0
14+
github.com/ipfs/go-ds-sql v0.3.0
15+
github.com/ipfs/go-ipfs-chunker v0.0.5
16+
github.com/ipfs/go-ipfs-config v0.18.0
17+
github.com/multiformats/go-multiaddr v0.5.0
18+
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
19+
github.com/peterbourgon/ff/v3 v3.1.2
820
github.com/pkg/errors v0.9.1
21+
github.com/syndtr/goleveldb v1.0.0
922
go.uber.org/multierr v1.7.0
1023
go.uber.org/zap v1.20.0
1124
golang.org/x/mobile v0.0.0-20220112015953-858099ff7816
1225
google.golang.org/grpc v1.44.0
1326
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
1427
google.golang.org/protobuf v1.27.1
28+
moul.io/u v1.27.0
1529
)
1630

1731
require (
1832
bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc // indirect
1933
contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect
2034
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
35+
github.com/DataDog/zstd v1.4.1 // indirect
2136
github.com/Stebalien/go-bitfield v0.0.1 // indirect
2237
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect
2338
github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 // indirect
@@ -37,7 +52,9 @@ require (
3752
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
3853
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
3954
github.com/dgraph-io/badger v1.6.2 // indirect
40-
github.com/dgraph-io/ristretto v0.0.2 // indirect
55+
github.com/dgraph-io/badger/v2 v2.2007.3 // indirect
56+
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect
57+
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
4158
github.com/dustin/go-humanize v1.0.0 // indirect
4259
github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302 // indirect
4360
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
@@ -52,7 +69,7 @@ require (
5269
github.com/gogo/protobuf v1.3.2 // indirect
5370
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
5471
github.com/golang/protobuf v1.5.2 // indirect
55-
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
72+
github.com/golang/snappy v0.0.1 // indirect
5673
github.com/google/gopacket v1.1.19 // indirect
5774
github.com/google/uuid v1.3.0 // indirect
5875
github.com/gorilla/websocket v1.4.2 // indirect
@@ -68,10 +85,6 @@ require (
6885
github.com/ipfs/go-blockservice v0.2.1 // indirect
6986
github.com/ipfs/go-cid v0.1.0 // indirect
7087
github.com/ipfs/go-cidutil v0.0.2 // indirect
71-
github.com/ipfs/go-datastore v0.5.1 // indirect
72-
github.com/ipfs/go-ds-badger v0.3.0 // indirect
73-
github.com/ipfs/go-ds-flatfs v0.5.1 // indirect
74-
github.com/ipfs/go-ds-leveldb v0.5.0 // indirect
7588
github.com/ipfs/go-ds-measure v0.2.0 // indirect
7689
github.com/ipfs/go-fetcher v1.6.1 // indirect
7790
github.com/ipfs/go-filestore v0.1.0 // indirect
@@ -80,9 +93,7 @@ require (
8093
github.com/ipfs/go-ipfs v0.11.0 // indirect
8194
github.com/ipfs/go-ipfs-api v0.3.0 // indirect
8295
github.com/ipfs/go-ipfs-blockstore v0.2.1 // indirect
83-
github.com/ipfs/go-ipfs-chunker v0.0.5 // indirect
8496
github.com/ipfs/go-ipfs-cmds v0.6.0 // indirect
85-
github.com/ipfs/go-ipfs-config v0.18.0 // indirect
8697
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
8798
github.com/ipfs/go-ipfs-ds-help v0.1.1 // indirect
8899
github.com/ipfs/go-ipfs-exchange-interface v0.1.0 // indirect
@@ -101,7 +112,7 @@ require (
101112
github.com/ipfs/go-ipld-legacy v0.1.0 // indirect
102113
github.com/ipfs/go-ipns v0.1.2 // indirect
103114
github.com/ipfs/go-log v1.0.5 // indirect
104-
github.com/ipfs/go-log/v2 v2.4.0 // indirect
115+
github.com/ipfs/go-log/v2 v2.5.0 // indirect
105116
github.com/ipfs/go-merkledag v0.5.1 // indirect
106117
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
107118
github.com/ipfs/go-mfs v0.2.1 // indirect
@@ -179,6 +190,7 @@ require (
179190
github.com/mattn/go-colorable v0.1.4 // indirect
180191
github.com/mattn/go-isatty v0.0.14 // indirect
181192
github.com/mattn/go-runewidth v0.0.4 // indirect
193+
github.com/mattn/go-sqlite3 v1.14.11 // indirect
182194
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
183195
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
184196
github.com/miekg/dns v1.1.43 // indirect
@@ -190,7 +202,6 @@ require (
190202
github.com/mr-tron/base58 v1.2.0 // indirect
191203
github.com/multiformats/go-base32 v0.0.3 // indirect
192204
github.com/multiformats/go-base36 v0.1.0 // indirect
193-
github.com/multiformats/go-multiaddr v0.5.0 // indirect
194205
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
195206
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
196207
github.com/multiformats/go-multibase v0.0.3 // indirect
@@ -210,7 +221,6 @@ require (
210221
github.com/rs/cors v1.7.0 // indirect
211222
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
212223
github.com/spaolacci/murmur3 v1.1.0 // indirect
213-
github.com/syndtr/goleveldb v1.0.0 // indirect
214224
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
215225
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 // indirect
216226
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect

0 commit comments

Comments
 (0)