Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aloknerurkar authored Dec 29, 2021
1 parent 2e4e9d4 commit ea76938
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Modular microservices framework in golang

`go-msuite` aims to help bootstrap development of distributed applications in go. It does not add too many new components, but it a collection of a bunch of useful software already built and battle-tested. There are a bunch of defaults already present, however the library is built in such a way that we can plug-n-play different subsystems.

Features are mostly similar to other popular frameworks. The only difference is `go-msuite` uses [libp2p](https://github.com/libp2p) underneath. Libp2p is a modular networking stack built for p2p applications. Having worked on it for more than a year now, I think it would add immense value not just to web3 but to traditional applications as well. This allows us to add more transports like websockets, quic etc.
Features are mostly similar to other popular frameworks. The only difference is `go-msuite` uses [libp2p](https://github.com/libp2p) underneath. Libp2p is a modular networking stack built for p2p applications. With Libp2p, we have the ability to add more transports underneath like QUIC, websockets etc. Apart from this, we get access to the DHT, which provides routing, discovery and even pubsub functionality.

For the public API please go through the `core` package

Expand All @@ -24,7 +24,7 @@ For the public API please go through the `core` package
- [Pubsub](https://github.com/libp2p/go-libp2p-pubsub) and [Discovery](https://github.com/libp2p/go-libp2p-discovery) are also supported using libp2p.

- RPC Transport
- There are multiple transports available. Users can start `go-msuite` using just TCP transport as well. libp2p is completely optional. That said, gRPC services registered on `go-msuite` are available on all the transports that are configured. (TCP and libp2p for now)
- There are multiple transports available. Users can start `go-msuite` using just TCP transport as well, libp2p is completely optional. That said, gRPC services registered on `go-msuite` are available on all the transports that are configured.
- Users can configure ports for different transports

- Authentication
Expand All @@ -33,7 +33,7 @@ For the public API please go through the `core` package

- Storage and SharedStorage
- Currently a simple key-value store is available to all the services. This store uses a very generic K-V store interface [gkvstore](https://github.com/plexsysio/gkvstore) which allows users to define how they want to store the objects into the store. Different implementations can be added here in future.
- Using IPFS and the above storage, we can use [ants-db](https://github.com/plexsysio/ants-db) to have a distributed CRDT store across all the go-msuite instances which are configured to use it. This is particularly useful to share state across all the instances running. Also it piggy-backs on the existing libp2p and IPFS instances that we already configure.
- Using IPFS and the above storage, we can use [ants-db](https://github.com/plexsysio/ants-db) to have a distributed CRDT store across all the go-msuite instances. This is particularly useful to share state across all the instances running. Also it piggy-backs on the existing libp2p and IPFS instances that we already configure.

- Taskmanager
- This is a simple worker pool which can be used to run tasks asynchronously. [taskmanager](http://github.com/plexsysio/taskmanager) can be configured to have dedicated go-routines which handle tasks created by users. Tasks can be short/long. All the tasks are stopped on app close. Also there is way to show task progress on the diagnostic endpoint
Expand All @@ -42,14 +42,19 @@ For the public API please go through the `core` package
- Distributed locking is useful when you have multiple instances of your services running. This way we can synchronize services across different machines. This component currently uses zookeeper/redis implementations which need to be managed separately.

- Events
- Simple event-based framework over libp2p Pubsub. This can be used inside apps to create and react to events configured by users. Currently, there is no synchronization, so if multiple services are present, synchronization should be done by the user. Hopefully this will change.
- Simple event framework over libp2p Pubsub. This can be used inside apps to create and react to events and is configurable by users. It provides an easier message-based interface to send/react to things. The events should be idempotent as they can be fired on multiple receivers.

- Protocols
- Protocols service can be used to write request-response schemes over libp2p. This allows users to write libp2p protocols with a simple message-passing model. There is a protocol internally implemented to provide a naive service mesh functionality.

- Diagnostics
- HTTP endpoint for showing diagnostic information of `go-msuite`. This shows status of different servers and routines started by the user. Users can add information to this and observe it from the HTTP interface.
- HTTP endpoint for showing diagnostic information of `go-msuite`. This shows status of different servers and routines started by the user. Users can add information to this and observe it from the HTTP interface. If the routines are created using `taskmanager`, the `Status` interface of `taskmanager` can be used to print status of the workers on the HTTP endpoints.
- `pprof` HTTP handlers can be enabled for debugging
- `prometheus` HTTP handler can also be enabled if metrics is enabled. It should be possible to use the same registry to add metrics in user apps as well in future.

- Service discovery
- Each `go-msuite` instance can be started with a particular name. This name can be then used to connect to it from other `go-msuite` nodes. Currently, it uses libp2p discovery underneath as mentioned above.
- A static configuration is also possible of the nodes and IP addresses are known in advance.
- Each `go-msuite` instance or individual service can be started with a particular name. This name can be then used to connect to it from other `go-msuite` nodes. Currently, it uses libp2p discovery underneath as mentioned above.
- A static configuration is also possible of the nodes and IP addresses are known in advance and libp2p is not configured.

## Quickstart

Expand All @@ -60,7 +65,11 @@ For the public API please go through the `core` package
svc, err := msuite.New(
msuite.WithServiceName("HelloWorld"),
msuite.WithHTTP(8080),
msuite.WithP2PPort(10000),
msuite.WithP2P(10000),
msuite.WithGRPC("tcp", 10001),
msuite.WithService("anotherservice", func(cs core.Service) error {
// Use cs here to initialize your components
}),
)
// write your app which uses the different subsystems from svc
Expand All @@ -79,7 +88,7 @@ For the public API please go through the `core` package
```

## Examples
There is a separate [repository](https://github.com/plexsysio/msuite-services) which contains different services built using `go-msuite`. Different services use different features.
There is a separate [repository](https://github.com/plexsysio/msuite-services) which contains different services built using `go-msuite`.

## License
MIT licensed
Expand Down

0 comments on commit ea76938

Please sign in to comment.