Skip to content

Commit

Permalink
Merge pull request #45 from RTradeLtd/replication
Browse files Browse the repository at this point in the history
Replication defination and helpers
  • Loading branch information
RT-nilPointer authored Feb 28, 2020
2 parents ce873cd + 40bbf22 commit 81efcb7
Show file tree
Hide file tree
Showing 18 changed files with 3,773 additions and 5 deletions.
39 changes: 38 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ proto: proto-gen tidy

# -I are the import paths, because we're using some plugins, we need to import the gogo protobuf helpers
.PHONY: proto-gen
proto-gen: gen-file gen-util gen-status gen-pubsub gen-admin gen-namesys 1gen-node gen-docs
proto-gen: gen-file gen-util gen-status gen-pubsub gen-admin gen-namesys 1gen-node gen-replication gen-docs


# builds the static website
Expand Down Expand Up @@ -320,6 +320,43 @@ gen-namesys:
--grpc-java_out=java \
pb/namesys.proto

gen-replication:
# generate golang bindings (replication)
protoc \
-I=pb \
-I=${GOPATH}/src \
pb/replication.proto \
--gogofast_out=plugins=grpc:go
# generate python bindings (replication)
python3 -m grpc_tools.protoc \
-I=pb \
-I=${GOPATH}/src \
pb/replication.proto \
--python_out=py \
--grpc_python_out=py
# generate typescript bindings (replication)
protoc \
--plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" \
-I=pb \
-I=${GOPATH}/src \
--ts_out=service=grpc-web:ts \
pb/replication.proto
# generate javascript bindings (replication)
protoc \
-I=pb \
-I=${GOPATH}/src \
--js_out=import_style=commonjs,binary:js \
--grpc_out=js \
--plugin=protoc-gen-grpc=`which grpc_tools_node_protoc_plugin` \
pb/replication.proto
# generate java bindings (replication)
protoc \
-I=pb \
-I=${GOPATH}/src \
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/replication.proto

gen-docs:
# generate documentation
protoc \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ If you want bindings in other languages, feel free to open a github issue. Alter

All code in this repository is licensed under `AGPL-3.0`, and all documentation is licensed under `MIT`. Documentation is anything that is a readme, or html file. Code is pretty much anything other than documentation such as javascript, java, golang, python, and `.proto` files.

This is different than the license key that is used to authorize your purchase and ownership of TemporalX.
This is different than the license key that is used to authorize your purchase and ownership of TemporalX.
4 changes: 2 additions & 2 deletions doc/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ node:
datastore:
type: leveldb
path: /temporalx/peerstore
# configure underyling keystore
# configure underlying keystore
keystore:
# the type of keystore to use
# accepted values: krab, memory, filesystem
Expand Down Expand Up @@ -259,7 +259,7 @@ Configuration Options:

The `gateway` section is used to configure the IPFS HTTP Gateway that TemporalX exposes. It has feature parity with `go-ipfs` to a certain extent, ignoring some of the `X-Ipfs-*` headers, while also supporting `/ipld` lookups. When encountering UnixFS directories, a slightly different "directory index" is displayed than what is shown when using `go-ipfs`.

The gateway http server by default enables gzip "level 3" compression, and has a max processing limit of 1000 requests/second, and a 2 minute timeout for inactive connections. Eventually these will be configurable, but for now they are some sensible defualts. Additionally the gateway will error out when processing a request body 1GB or larger in size.
The gateway http server by default enables gzip "level 3" compression, and has a max processing limit of 1000 requests/second, and a 2 minute timeout for inactive connections. Eventually these will be configurable, but for now they are some sensible defaults. Additionally the gateway will error out when processing a request body 1GB or larger in size.

The gateway offers no write capabilities, and is strictly focused on read-only purposes. Planned features include an in-memory cache.

Expand Down
2 changes: 1 addition & 1 deletion doc/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ To populate a default configuration file in your curent directory named `config2
$ tex-cli --config config2.yml config generate
```

The default configuartion is set to usable on machines with low memory like raspberry pi's, or other similar devices. If you want to see a configuration suitable for machines with more available resources such as services, see the example config file located in the [config documentation](CONFIGURATION.md).
The default configuration is set to usable on machines with low memory like raspberry pi's, or other similar devices. If you want to see a configuration suitable for machines with more available resources such as services, see the example config file located in the [config documentation](CONFIGURATION.md).

Make sure you always use a hex encoded private key that is either generated by the tex-cli binary during config initialization, or by yourself securely offline. Do not use any of the ones in the documentation because they are publicly available. These private keys are ed25519 keys as generated by the `go-libp2p-core` crypto library, except they are also hex encoded.

Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ go 1.13

require (
github.com/gogo/protobuf v1.3.1
github.com/ipfs/go-cid v0.0.4
github.com/libp2p/go-libp2p-core v0.3.1
github.com/multiformats/go-multiaddr v0.2.0
google.golang.org/grpc v1.26.0
)
Loading

0 comments on commit 81efcb7

Please sign in to comment.