Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keep-network/keep-common
Common libraries and tools used across Keep repositories
https://github.com/keep-network/keep-common
Last synced: 18 days ago
JSON representation
Common libraries and tools used across Keep repositories
- Host: GitHub
- URL: https://github.com/keep-network/keep-common
- Owner: keep-network
- License: mit
- Created: 2019-09-04T18:41:07.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T09:43:34.000Z (8 months ago)
- Last Synced: 2024-06-19T00:26:33.609Z (7 months ago)
- Language: Go
- Size: 1.21 MB
- Stars: 5
- Watchers: 11
- Forks: 14
- Open Issues: 11
-
Metadata Files:
- Readme: README.adoc
- Contributing: CONTRIBUTING.adoc
- License: LICENSE
Awesome Lists containing this project
README
= `keep-common`
https://github.com/keep-network/keep-common/actions/workflows/client.yml[image:https://img.shields.io/github/actions/workflow/status/keep-network/keep-common/client.yml?branch=main&event=push&label=Go build[Go build status]]
https://docs.threshold.network[image:https://img.shields.io/badge/docs-website-green.svg[Docs]]
https://discord.gg/threshold[image:https://img.shields.io/badge/chat-Discord-5865f2.svg[Chat with us on Discord]]Common libraries and tools used across Keep repositories.
== Directory structure
The directory structure used in the `keep-common` repository is the same as
used on other Keep repositories, and very similar to that used in other Go
projects:```
keep-common/
tools/ <1>
generators/ <2>
pkg/ <3>
chain/
chain.go, *.go <4>
ethereum/
gen/
gen.go <5>
relay/
relay.go, *.go
```
<1> Keep tools have categorized directories here, which are typically Go
commands that can be used from other repositories.
<2> Code generators in particular live in this subtree.
<3> All additional Go packages live in `pkg/`.
<4> The high-level interfaces for a package `mypackage` live in `mypackage.go`.
Packages like `chain` are interface packages that expose a common interface
to network and blockchain layers, for example. Their subpackages provide
particular implementations of these common interfaces, if these are
considered shared implementations..
<5> When a package requires generated code, it should have a subpackage named
`gen/`. This subpackage should contain a single file, `gen.go`, with a
`// go:generate` annotation to trigger appropriate code generation. All code
generation is done with a single invocation of `go generate` at build time.== Installation
* Clone this repo
* Install go v1.18: `$ brew install [email protected]`
* Generate go files: `$ go generate ./.../gen`
* Build the project: `$ go build ./...`
* Run tests: `$ go test ./...`