mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 17:44:59 +09:00
update readme and makefile
This commit is contained in:
parent
84ad69e94a
commit
f5327b29f7
2 changed files with 41 additions and 34 deletions
60
README.md
60
README.md
|
@ -3,15 +3,19 @@
|
|||
|
||||
#### How to build
|
||||
|
||||
1. Install Golang 1.12.* [from here](http://golang.org/dl/)
|
||||
1. Install Golang 1.13.* [from here](http://golang.org/dl/)
|
||||
2. `make setup` to install deps
|
||||
3. `make build-lib` to build C(`.so`) library into `dist` folder
|
||||
3. `make build-lib` to build C-archived(`lib.a + lib.h`) library into `dist` folder
|
||||
4. `make build-js` to build NodeJS Addon into `jsaddon/build`
|
||||
5. `npm install & npm build:ts` to compile proto files for TS/JS to `build/ts`
|
||||
5. `npm install & npm build:ts` to compile proto files for TS/JS into `build/ts`
|
||||
6. `make install-dev-js` to copy the compiled NodeJS addon and protobuf binding into `../js-anytype`
|
||||
|
||||
#### Rebuild proto files
|
||||
This repo uses custom protoc plugin located at [anytypeio/protobuf/protoc-gen-gogo/gomobile](https://github.com/anytypeio/protobuf/tree/master/protoc-gen-gogo/gomobile).
|
||||
So make sure you have installed it:
|
||||
#### Rebuild protobuf generated files
|
||||
This repo uses custom protoc located at [anytypeio/protobuf](https://github.com/anytypeio/protobuf/tree/master/protoc-gen-gogo). It adds `gomobile` plugin and some env-controlled options to control the generated code style.
|
||||
|
||||
This protobuf generator will replace your `protoc` binary, BTW it doesn't have any breaking changes for other protobuf and grpc code
|
||||
|
||||
You can install it with a simple command:
|
||||
```
|
||||
make setup-protoc
|
||||
```
|
||||
|
@ -21,26 +25,6 @@ Then you can easily regenerate proto files:
|
|||
make protos
|
||||
```
|
||||
|
||||
|
||||
#### Run local gRPC server to debug
|
||||
⚠️ Make sure to update/install protobuf compiler from [this repo](https://github.com/anytypeio/protobuf) using `make setup-protoc`
|
||||
|
||||
Commands:
|
||||
`make run-debug` - builds proto files for grpc server, builds the binary and runs it
|
||||
`make build-debug` - builds proto files for grpc server and builds the binary into `dist/debug`
|
||||
|
||||
If you want to change the default port(9999):
|
||||
`ANYTYPE_GRPC_ADDR=127.0.0.1:8888 make run-debug`
|
||||
|
||||
|
||||
Useful tools for debug:
|
||||
**GUI**
|
||||
https://github.com/uw-labs/bloomrpc
|
||||
`HowTo: Set the import path to the middleware root, then select commands.proto file`
|
||||
|
||||
**CLI**
|
||||
https://github.com/njpatel/grpcc
|
||||
|
||||
#### Run tests
|
||||
GO test:
|
||||
```
|
||||
|
@ -52,3 +36,27 @@ NodeJS addon test:
|
|||
cd jsaddon
|
||||
npm run test
|
||||
```
|
||||
|
||||
#### Run local gRPC server to debug
|
||||
⚠️ Make sure to update/install protobuf compiler from [this repo](https://github.com/anytypeio/protobuf) using `make setup-protoc`
|
||||
|
||||
Commands:
|
||||
- `make run-debug` - builds proto files for grpc server, builds the binary and runs it
|
||||
- `make build-debug` - builds proto files for grpc server and builds the binary into `dist/debug`
|
||||
|
||||
If you want to change the default port(9999):
|
||||
|
||||
`ANYTYPE_GRPC_ADDR=127.0.0.1:8888 make run-debug`
|
||||
|
||||
----
|
||||
Useful tools for debug:
|
||||
|
||||
**GUI**
|
||||
|
||||
https://github.com/uw-labs/bloomrpc
|
||||
|
||||
`HowTo: Set the import path to the middleware root, then select commands.proto file`
|
||||
|
||||
**CLI**
|
||||
|
||||
https://github.com/njpatel/grpcc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue