keep-common

module
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2021 License: MIT

README

= `keep-common`

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/
  Makefile <1>
  docs/
  contracts/ <2>
    docs/
    solidity/
  tools/ <3>
    generators/ <4>
  pkg/ <5>
    net/
      net.go, *.go <5>
      libp2p/
    chain/
      chain.go, *.go <5>
      ethereum/
        gen/
          gen.go <6>
    relay/
      relay.go, *.go
```
<1> The Makefile should be minimal, mirroring the Dockerfile when possible.
<2> While Keep only uses Solidity at the moment, the directory structure allows
    for other contract languages.
<3> Keep tools have categorized directories here, which are typically Go
    commands that can be used from other repositories.
<4> Code generators in particular live in this subtree.
<5> All additional Go packages live in `pkg/`.
<6> The high-level interfaces for a package `mypackage` live in `mypackage.go`.
    `net` and `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..
<7> 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.

Directories

Path Synopsis
pkg
cache
Package cache provides a time cache implementation safe for concurrent use without the need of additional locking.
Package cache provides a time cache implementation safe for concurrent use without the need of additional locking.
chain/ethereum/ethutil
Package ethutil provides utilities used for dealing with Ethereum concerns in the context of implementing cross-chain interfaces defined in pkg/chain.
Package ethutil provides utilities used for dealing with Ethereum concerns in the context of implementing cross-chain interfaces defined in pkg/chain.
cmd
Package cmd contains useful utilities for commands that interact with the Ethereum blockchain.
Package cmd contains useful utilities for commands that interact with the Ethereum blockchain.
cmd/flag
Package flag contains helpers for accepting Ethereum data types as command-line parameters, including transaction hashes as hex and uint256s in either hex or decimal form.
Package flag contains helpers for accepting Ethereum data types as command-line parameters, including transaction hashes as hex and uint256s in either hex or decimal form.
diagnostics
Package diagnostics provides some tools useful for gathering and exposing arbitrary diagnositcs information for external monitoring tools.
Package diagnostics provides some tools useful for gathering and exposing arbitrary diagnositcs information for external monitoring tools.
encryption
Package encryption adds a layer to store data on disk encrypted in case a filesystem is compromised.
Package encryption adds a layer to store data on disk encrypted in case a filesystem is compromised.
generate
Package generate contains helper functions for code generators.
Package generate contains helper functions for code generators.
metrics
Package metrics provides some tools useful for gathering and exposing system metrics for external monitoring tools.
Package metrics provides some tools useful for gathering and exposing system metrics for external monitoring tools.
persistence
Package persistence adds a layer which handles data storage.
Package persistence adds a layer which handles data storage.
tools
generators/promise
Code generation execution command requires the package to be set to `main`.
Code generation execution command requires the package to be set to `main`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL