Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stellar/go
Stellar's public monorepo of go code
https://github.com/stellar/go
blockchain cryptocurrency horizon stellar
Last synced: 2 days ago
JSON representation
Stellar's public monorepo of go code
- Host: GitHub
- URL: https://github.com/stellar/go
- Owner: stellar
- License: apache-2.0
- Created: 2016-08-04T17:27:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-17T19:58:16.000Z (about 2 months ago)
- Last Synced: 2024-10-17T21:10:42.023Z (about 2 months ago)
- Topics: blockchain, cryptocurrency, horizon, stellar
- Language: Go
- Homepage: https://stellar.org/developers
- Size: 72.5 MB
- Stars: 1,298
- Watchers: 85
- Forks: 502
- Open Issues: 397
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: COPYING
- Support: support/app/main.go
Awesome Lists containing this project
- awesome-monorepo - Stellar 的 Go monorepo
- best-of-crypto - GitHub - 19% open · ⏱️ 04.06.2024): (Cryptocurrencies)
README
![master GitHub workflow](https://github.com/stellar/go/actions/workflows/go.yml/badge.svg)
This repo is the home for all of the public Go code produced by the [Stellar Development Foundation].
This repo contains various tools and services that you can use and deploy, as well as the SDK you can use to develop applications that integrate with the Stellar network.
## Package Index
* [Horizon Server](services/horizon): Full-featured API server for Stellar network
* [Go Horizon SDK - horizonclient](clients/horizonclient): Client for Horizon server (queries and transaction submission)
* [Go Horizon SDK - txnbuild](txnbuild): Construct Stellar transactions and operations
* [Ticker](services/ticker): An API server that provides statistics about assets and markets on the Stellar network
* [Keystore](services/keystore): An API server that is used to store and manage encrypted keys for Stellar client applications
* Servers for Anchors & Financial Institutions
* [Compliance Server](services/compliance): Allows financial institutions to exchange KYC information
* [Federation Server](services/federation): Allows organizations to provide addresses for users (`jane*examplebank.com`)## Dependencies
This repository is officially supported on the last two releases of Go.
It depends on a [number of external dependencies](./go.mod), and uses Go [Modules](https://github.com/golang/go/wiki/Modules) to manage them. Running any `go` command will automatically download dependencies required for that operation.
You can choose to checkout this repository into a [GOPATH](https://github.com/golang/go/wiki/GOPATH) or into any directory.
## Directory Layout
In addition to the other top-level packages, there are a few special directories that contain specific types of packages:
* **clients** contains packages that provide client packages to the various Stellar services.
* **exp** contains experimental packages. Use at your own risk.
* **handlers** contains packages that provide pluggable implementors of `http.Handler` that make it easier to incorporate portions of the Stellar protocol into your own http server.
* **support** contains packages that are not intended for consumption outside of Stellar's other packages. Packages that provide common infrastructure for use in our services and tools should go here, such as `db` or `log`.
* **support/scripts** contains single-file go programs and bash scripts used to support the development of this repo.
* **services** contains packages that compile to applications that are long-running processes (such as API servers).
* **tools** contains packages that compile to command line applications.Each of these directories have their own README file that explain further the nature of their contents.
### Other packages
In addition to the packages described above, this repository contains various packages related to working with the Stellar network from a go program. It's recommended that you use [godoc](https://godoc.org/github.com/stellar/go#pkg-subdirectories) to browse the documentation for each.
## Package source layout
While much of the code in individual packages is organized based upon different developers' personal preferences, many of the packages follow a simple convention for organizing the declarations inside of a package that aim to aid in your ability to find code.
In each package, there may be one or more of a set of common files:
- *errors.go*: This file should contains declarations (both types and vars) for errors that are used by the package.
- *example_test.go*: This file should contains example tests, as described at https://blog.golang.org/examples.
- *main.go/internal.go* (**deprecated**): Older packages may have a `main.go` (public symbols) or `internal.go` (private symbols). These files contain, respectively, the exported and unexported vars, consts, types and funcs for the package. New packages do not follow this pattern, and instead follow the standard Go convention to co-locate structs and their methods in the same files.
- *main.go* (**new convention**): If present, this file contains a `main` function as part of an executable `main` package.In addition to the above files, a package often has files that contains code that is specific to one declared type. This file uses the snake case form of the type name (for example `loggly_hook.go` would correspond to the type `LogglyHook`). This file should contain method declarations, interface implementation assertions and any other declarations that are tied solely to that type.
Each non-test file can have a test counterpart like normal, whose name ends with `_test.go`. The common files described above also have their own test counterparts... for example `internal_test.go` should contains tests that test unexported behavior and more commonly test helpers that are unexported.
Generally, file contents are sorted by exported/unexported, then declaration type (ordered as consts, vars, types, then funcs), then finally alphabetically.
### Test helpers
Often, we provide test packages that aid in the creation of tests that interact with our other packages. For example, the `support/db` package has the `support/db/dbtest` package underneath it that contains elements that make it easier to test code that accesses a SQL database. We've found that this pattern of having a separate test package maximizes flexibility and simplifies package dependencies.
### Contributing
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
### Developing
See [GUIDE_FOR_DEVELOPERS.md](/services/horizon/internal/docs/GUIDE_FOR_DEVELOPERS.md) for helpful instructions for getting started developing code in this repository.
[Stellar Development Foundation]: https://stellar.org