1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 09:35:00 +09:00
Shared library for Anytype clients https://anytype.io
Find a file
2021-03-29 12:17:10 +04:00
.circleci ci: go 1.16 2021-03-29 12:17:10 +04:00
.github/ISSUE_TEMPLATE fix github issue templates location 2020-03-03 11:43:06 +02:00
anymark relations validation and normalization 2021-02-23 16:10:12 +04:00
app fix tests 2021-03-16 10:24:35 +03:00
change lastModified&lastOpened fixes 2021-03-19 17:09:54 +04:00
clientlibrary fix jsaddon build on go >= 1.15 2021-03-08 21:38:50 +04:00
cmd fix tests 2021-03-16 10:24:35 +03:00
core fix CloseBlocks 2021-03-25 12:59:24 +04:00
dist add cli tool to manually reindex objects 2021-03-04 17:42:17 +03:00
docs events refactoring and atomic changes for details 2021-03-22 22:20:35 +04:00
metrics fix grafana dashboards 2021-03-04 16:19:56 +03:00
pb fix atomic events for details 2021-03-23 18:42:42 +04:00
pkg/lib fix tests 2021-03-24 19:05:19 +04:00
util fix tests 2021-03-24 19:05:19 +04:00
.gitattributes lib.so moved to dist/ and updated 2019-09-26 22:56:33 +03:00
.gitignore add cli tool to manually reindex objects 2021-03-04 17:42:17 +03:00
.pre-commit-config.yaml Add precommit 2020-03-24 16:01:52 +03:00
docker-compose.yml ci: add fixed gateway port 2021-03-12 14:35:52 +04:00
docker-machine debugSync refactoring and fixes 2021-02-20 18:19:12 +04:00
Dockerfile ci: go 1.16 2021-03-29 12:17:10 +04:00
go.mod fix local details&relations injetion 2021-03-16 21:36:05 +04:00
go.sum Merge branch 'master' of ssh://github.com/anytypeio/go-anytype-middleware into dataview 2021-03-18 21:39:29 +04:00
Makefile fix makefile for addon 2021-03-09 11:45:30 +04:00
package.json fix missing smartblock types defenitions 2021-03-18 20:37:22 +04:00
README.md ci: go 1.16 2021-03-29 12:17:10 +04:00
webpack.config.js add webpack umd library options 2020-06-22 16:22:28 +03:00

Anytype Middleware Library

CircleCI

Build from Source

  1. Install Golang 1.16.* from here
  2. Follow instructions below for the target systems

Build and install for the desktop client

  1. make install-dev-js to build the local server and copy it and protobuf binding into ../js-anytype

Build for iOS

  1. make build-ios to build the framework into dist/ios folder
  2. make protos-swift to generate swift protobuf bindings into dist/ios/pb

Build for Android

  1. make build-android to build the library into dist/android folder
  2. make protos-java to generate java protobuf bindings into dist/android/pb

Rebuild protobuf generated files

This repo uses custom protoc located at anytypeio/protobuf. 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

Then you can easily regenerate proto files:

make protos

Run tests

Generate mocks:

make test-deps

GO test:

make test

NodeJS addon test:

cd jsaddon
npm run test

Run local gRPC server to debug

⚠️ Make sure to update/install protobuf compiler from this repo using make setup-protoc

Commands:

  • make run-server - builds proto files for grpc server, builds the binary and runs it
  • make build-server - builds proto files for grpc server and builds the binary into dist/server

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

Running with prometheus and grafana

  • cd metrics/docker cd into folder with docker-compose file
  • docker-compose up - run the prometheus/grafana
  • use ANYTYPE_PROM=0.0.0.0:9094 when running middleware to enable metrics collection. Client commands metrics available only in gRPC mode
  • open http://127.0.0.1:3000 to view collected metrics in Grafana. You can find several dashboards there:
    • Threads gRPC client for go-threads client metrics(when you make requests to other nodes)
    • Threads gRPC server for go-threads server metrics(when other nodes make requests to you)
    • MW internal middleware metrics such as changes, added and created threads histograms
    • MW commands server metrics for clients commands. Works only in grpc-server mode