stack

package module
v3.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

The Things Stack, an open source LoRaWAN Network Server

The Things Stack is an open source LoRaWAN network stack suitable for large, global and geo-distributed public and private networks as well as smaller networks. The architecture follows the LoRaWAN Network Reference Model for standards compliancy and interoperability. This project is actively maintained by The Things Industries.

LoRaWAN is a protocol for low-power wide area networks. It allows for large scale Internet of Things deployments where low-powered devices efficiently communicate with Internet-connected applications over long range wireless connections.

Features

  • LoRaWAN Network Server
    • Supports LoRaWAN 1.0
    • Supports LoRaWAN 1.0.1
    • Supports LoRaWAN 1.0.2
    • Supports LoRaWAN 1.0.3
    • Supports LoRaWAN 1.0.4
    • Supports LoRaWAN 1.1
    • Supports LoRaWAN Regional Parameters 1.0
    • Supports LoRaWAN Regional Parameters 1.0.2 rev B
    • Supports LoRaWAN Regional Parameters 1.0.3 rev A
    • Supports LoRaWAN Regional Parameters 1.1 rev A
    • Supports LoRaWAN Regional Parameters 1.1 rev B
    • Supports Class A devices
    • Supports Class B devices
    • Supports Class C devices
    • Supports OTAA devices
    • Supports ABP devices
    • Supports MAC Commands
    • Supports Adaptive Data Rate
    • Implements LoRaWAN Back-end Interfaces 1.0
  • LoRaWAN Application Server
    • Payload conversion of well-known payload formats
    • Payload conversion using custom JavaScript functions
    • MQTT pub/sub API
    • HTTP Webhooks API
    • Implements LoRaWAN Back-end Interfaces 1.0
  • LoRaWAN Join Server
    • Supports OTAA session key derivation
    • Supports external crypto services
    • Implements LoRaWAN Back-end Interfaces 1.0
    • Implements LoRaWAN Back-end Interfaces 1.1 draft 3
  • OAuth 2.0 Identity Server
    • User management
    • Entity management
    • ACLs
  • GRPC APIs
  • HTTP APIs
  • Command-Line Interface
    • Create account and login
    • Application management and traffic
    • End device management, status and traffic
    • Gateway management and status
  • Web Interface (Console)
    • Create account and login
    • Application management and traffic
    • End device management, status and traffic
    • Gateway management, status and traffic

Getting Started

You want to install The Things Stack? Fantastic! Here's the Getting Started guide.

Do you want to set up a local development environment? See the DEVELOPMENT.md for instructions.

Do you want to contribute to The Things Stack? Your contributions are welcome! See the guidelines in CONTRIBUTING.md.

Are you new to LoRaWAN and The Things Network? See the general documentation at thethingsnetwork.org/docs.

Commitments and Releases

Open source projects are great, but a stable and reliable open source ecosystem is even better. Therefore, we make the following commitments:

  1. We will not break the API towards gateways and applications within the major version. This includes how gateways communicate (with Gateway Server) and how applications work with data (with Application Server)
  2. We will upgrade storage from older versions within the major version via migrations. This means that you can migrate an older setup without losing data.
  3. We will not require storage migrations within the minor version. This means that you can update patches without database migrations.
  4. We will not break the public command-line interface and configuration within the major version. This means that you can safely build scripts and migrate configuration.
  5. We will not break the API between components and events within minor versions. So at least the same minor versions of components are compatible with each other.
  6. We reserve the right to fix bugs in API, configuration and storage in patches and minor updates. This may break components, gateways and applications that rely on buggy behavior.

As we are continuously adding functionality and fixes in new releases, we are also introducing new configurations and new defaults. We therefore recommend reading the release notes before upgrading to a new version.

You can find the releases and their notes on the Releases page.

Support

Documentation

Overview

Package stack contains The Things Stack for LoRaWAN.

Directories

Path Synopsis
cmd
ttn-lw-cli
ttn-lw-cli is the binary for the Command-line interface of The Things Stack for LoRaWAN.
ttn-lw-cli is the binary for the Command-line interface of The Things Stack for LoRaWAN.
ttn-lw-cli/commands
Package commands implements the commands for the ttn-lw-cli binary.
Package commands implements the commands for the ttn-lw-cli binary.
ttn-lw-cli/internal/simulate
Package simulate implements the simulation off device communication.
Package simulate implements the simulation off device communication.
ttn-lw-stack
ttn-lw-stack is the binary that runs the entire The Things Stack for LoRaWAN.
ttn-lw-stack is the binary that runs the entire The Things Stack for LoRaWAN.
ttn-lw-stack/commands
Package commands implements the commands for the ttn-lw-stack binary.
Package commands implements the commands for the ttn-lw-stack binary.
pkg
applicationserver
Package applicationserver provides a LoRaWAN-compliant Application Server implementation.
Package applicationserver provides a LoRaWAN-compliant Application Server implementation.
applicationserver/io/mqtt
Package mqtt implements the MQTT frontend.
Package mqtt implements the MQTT frontend.
applicationserver/io/mqtt/topics
Package topics implements MQTT topic layouts.
Package topics implements MQTT topic layouts.
applicationserver/io/packages/alcsync/v1
Package alcsyncv1 provides the LoRa Application Layer Clock Synchronization Package.
Package alcsyncv1 provides the LoRa Application Layer Clock Synchronization Package.
applicationserver/io/packages/loragls/v3
Package loracloudgeolocationv3 enables LoRa Cloud Geolocation Services integration.
Package loracloudgeolocationv3 enables LoRa Cloud Geolocation Services integration.
applicationserver/io/packages/redis
Package redis provides implementation of the application packages registry using Redis.
Package redis provides implementation of the application packages registry using Redis.
applicationserver/io/pubsub
Package pubsub implements the go-cloud pub/sub frontend.
Package pubsub implements the go-cloud pub/sub frontend.
applicationserver/io/pubsub/provider
Package provider implements pub/sub provider interfaces and registration.
Package provider implements pub/sub provider interfaces and registration.
applicationserver/io/pubsub/provider/mock
Package mock implements a mock pub/sub provider using the mempubsub driver.
Package mock implements a mock pub/sub provider using the mempubsub driver.
applicationserver/io/pubsub/provider/mqtt
Package mqtt implements the MQTT provider using the mqtt driver.
Package mqtt implements the MQTT provider using the mqtt driver.
applicationserver/io/pubsub/provider/nats
Package nats implements the NATS provider using the natspubsub driver.
Package nats implements the NATS provider using the natspubsub driver.
applicationserver/io/web
Package web implements the webhooks integration.
Package web implements the webhooks integration.
applicationserver/redis
Package redis provides interfaces to Redis.
Package redis provides interfaces to Redis.
auth
Package auth provides methods to generate valid authorization values and to also decode them.
Package auth provides methods to generate valid authorization values and to also decode them.
auth/cluster
Package cluster contains cluster authentication-related utilities.
Package cluster contains cluster authentication-related utilities.
auth/pbkdf2
Package pbkdf2 implements the PBKDF2 algorithm method used to hash passwords.
Package pbkdf2 implements the PBKDF2 algorithm method used to hash passwords.
auth/rights
Package rights implements rights fetching and checking.
Package rights implements rights fetching and checking.
basicstation/cups
Package cups implements the CUPS protocol.
Package cups implements the CUPS protocol.
cluster
Package cluster defines an interface for clustering network components and provides a simple implementation.
Package cluster defines an interface for clustering network components and provides a simple implementation.
component
Package component contains the methods and structures common to all components.
Package component contains the methods and structures common to all components.
config
Package config wraps Viper.
Package config wraps Viper.
config/example
example cobra command with config.
example cobra command with config.
config/tlsconfig
Package tlsconfig provides configuration for TLS clients and servers.
Package tlsconfig provides configuration for TLS clients and servers.
console/internal/events
Package events contains the internal events APi for the Console.
Package events contains the internal events APi for the Console.
console/internal/events/eventsmux
Package eventsmux implements the events mux.
Package eventsmux implements the events mux.
console/internal/events/middleware
Package middleware implements the events middleware.
Package middleware implements the events middleware.
console/internal/events/protocol
Package protocol implements the protocol for the events package.
Package protocol implements the protocol for the events package.
console/internal/events/subscriptions
Package subscriptions implements the events mux subscriptions.
Package subscriptions implements the events mux subscriptions.
crypto
Package crypto implements LoRaWAN crypto.
Package crypto implements LoRaWAN crypto.
crypto/cryptoservices
Package cryptoservices implements services for LoRaWAN cryptograhpy.
Package cryptoservices implements services for LoRaWAN cryptograhpy.
crypto/cryptoutil
Package cryptoutil implements cryptography utilities.
Package cryptoutil implements cryptography utilities.
deviceclaimingserver
Package deviceclaimingserver implements the Device Claiming Server component.
Package deviceclaimingserver implements the Device Claiming Server component.
deviceclaimingserver/enddevices
Package enddevices provides functions to configure End Device claiming clients.
Package enddevices provides functions to configure End Device claiming clients.
deviceclaimingserver/enddevices/errors
Package errors defines common error types for all upstreams.
Package errors defines common error types for all upstreams.
deviceclaimingserver/enddevices/ttjsv2
Package ttjsv2 provides the claiming client implementation for The Things Join Server 2.0 API.
Package ttjsv2 provides the claiming client implementation for The Things Join Server 2.0 API.
devicerepository
Package devicerepository integrates with the Device Repository.
Package devicerepository integrates with the Device Repository.
devicerepository/mock
Package mockdr contains the mock of a Device Repository Server.
Package mockdr contains the mock of a Device Repository Server.
devicetemplateconverter
Package devicetemplateconverter provides device template services.
Package devicetemplateconverter provides device template services.
devicetemplateconverter/profilefetcher
Package profilefetcher contains definitions of end-device's profile fetchers based on the VersionIDs or VendorIDs.
Package profilefetcher contains definitions of end-device's profile fetchers based on the VersionIDs or VendorIDs.
devicetemplates
Package devicetemplates implements creating templates for devices.
Package devicetemplates implements creating templates for devices.
email
Package email provides an interface to send messages over email.
Package email provides an interface to send messages over email.
email/mock
Package mock provides a test email provider that is used in tests.
Package mock provides a test email provider that is used in tests.
email/sendgrid
Package sendgrid provides the implementation of an email sender using SendGrid.
Package sendgrid provides the implementation of an email sender using SendGrid.
email/smtp
Package smtp implements SMTP as email provider.
Package smtp implements SMTP as email provider.
email/templates
Package templates is responsible for handling the email templates sent by The Things Stack.
Package templates is responsible for handling the email templates sent by The Things Stack.
encoding/lorawan
Package lorawan provides LoRaWAN decoding/encoding interfaces.
Package lorawan provides LoRaWAN decoding/encoding interfaces.
errorcontext
Package errorcontext implements a Context that can be canceled with a specific error instead of the usual context.Canceled.
Package errorcontext implements a Context that can be canceled with a specific error instead of the usual context.Canceled.
errors
Package errors implements rich errors that carry contextual information such as stack traces, causality and attributes.
Package errors implements rich errors that carry contextual information such as stack traces, causality and attributes.
errors/sentry
Package sentry converts errors to Sentry events.
Package sentry converts errors to Sentry events.
events
Package events implements event handling through a PubSub interface.
Package events implements event handling through a PubSub interface.
events/basic
Package basic provides a basic events PubSub implementation.
Package basic provides a basic events PubSub implementation.
events/batch
Package batch contains a batch publisher implementation of events.Publisher.
Package batch contains a batch publisher implementation of events.Publisher.
events/cloud
Package cloud implements an events.PubSub implementation that uses Go Cloud PubSub.
Package cloud implements an events.PubSub implementation that uses Go Cloud PubSub.
events/grpc
Package grpc contains an implementation of the EventsServer, which is used to stream all events published for a set of identifiers.
Package grpc contains an implementation of the EventsServer, which is used to stream all events published for a set of identifiers.
events/internal/eventstest
Package eventstest provides a blackbox test for events PubSub implementations.
Package eventstest provides a blackbox test for events PubSub implementations.
events/redis
Package redis implements an events.PubSub implementation that uses Redis PubSub.
Package redis implements an events.PubSub implementation that uses Redis PubSub.
fetch
Package fetch offers abstractions to fetch a file with the same method, regardless of a location (filesystem, HTTP...).
Package fetch offers abstractions to fetch a file with the same method, regardless of a location (filesystem, HTTP...).
fillcontext
Package fillcontext implements a mechanism to fill contexts.
Package fillcontext implements a mechanism to fill contexts.
frequencyplans
Package frequencyplans contains abstractions to fetch and manipulate frequency plans.
Package frequencyplans contains abstractions to fetch and manipulate frequency plans.
gatewayserver
Package gatewayserver contains the structs and methods necessary to start a gRPC Gateway Server
Package gatewayserver contains the structs and methods necessary to start a gRPC Gateway Server
gatewayserver/io
Package io contains the interface between server implementations and the gateway frontends.
Package io contains the interface between server implementations and the gateway frontends.
gatewayserver/io/ws
Package ws provides common interface for Web Socket front end.
Package ws provides common interface for Web Socket front end.
gatewayserver/io/ws/id6
Package id6 provides translation functions to the ID6 format.
Package id6 provides translation functions to the ID6 format.
gatewayserver/scheduling
Package scheduling implements a packet scheduling that detects and avoids conflicts and enforces regional restrictions like duty-cycle and dwell time.
Package scheduling implements a packet scheduling that detects and avoids conflicts and enforces regional restrictions like duty-cycle and dwell time.
gatewayserver/upstream/mock
Package mock provides mock implementation of necessary NS interfaces for testing.
Package mock provides mock implementation of necessary NS interfaces for testing.
gatewayserver/upstream/ns
Package ns abstracts the V3 Network Server to the upstream.Handler interface.
Package ns abstracts the V3 Network Server to the upstream.Handler interface.
gatewayserver/upstream/packetbroker
Package packetbroker abstracts the Packet Broker Agent to the upstream.Handler interface.
Package packetbroker abstracts the Packet Broker Agent to the upstream.Handler interface.
goproto
Package goproto implements conversions from well-known golang/profobuf types.
Package goproto implements conversions from well-known golang/profobuf types.
gpstime
Package gpstime provides utilities to work with GPS time.
Package gpstime provides utilities to work with GPS time.
healthcheck
Package healthcheck provides configuration of startup probes.
Package healthcheck provides configuration of startup probes.
i18n
Package i18n helps with internationalization of registered messages.
Package i18n helps with internationalization of registered messages.
identityserver
Package identityserver handles the database operations for The Things Stack.
Package identityserver handles the database operations for The Things Stack.
identityserver/blocklist
Package blocklist implements a list of forbidden IDs.
Package blocklist implements a list of forbidden IDs.
identityserver/bunstore
Package store implements the Identity Server store interfaces using the bun library.
Package store implements the Identity Server store interfaces using the bun library.
identityserver/mock
Package mockis provides a mock structure to the Identity Server.
Package mockis provides a mock structure to the Identity Server.
identityserver/store
Package store defines the interfaces implemented by Identity Server store implementations.
Package store defines the interfaces implemented by Identity Server store implementations.
identityserver/store/migrations
Package migrations contains Identity Server store migrations.
Package migrations contains Identity Server store migrations.
internal/registry
Package registry contains commonly used device registry functionality.
Package registry contains commonly used device registry functionality.
interop
Package interop implements a LoRaWAN Backend Interfaces server and client.
Package interop implements a LoRaWAN Backend Interfaces server and client.
joinserver
Package joinserver provides a LoRaWAN-compliant Join Server implementation.
Package joinserver provides a LoRaWAN-compliant Join Server implementation.
joinserver/redis
Package redis provides Redis implementations of interfaces used by joinserver.
Package redis provides Redis implementations of interfaces used by joinserver.
log
Package log contains all the structs to log TTN.
Package log contains all the structs to log TTN.
log/handler/memory
Package memory implements a pkg/log.Handler that saves all entries in process memory
Package memory implements a pkg/log.Handler that saves all entries in process memory
log/middleware/observability
Package observability implements a pkg/log.Handler that exports metrics for the logged messages.
Package observability implements a pkg/log.Handler that exports metrics for the logged messages.
log/middleware/sentry
Package sentry implements a pkg/log.Handler that sends errors to Sentry
Package sentry implements a pkg/log.Handler that sends errors to Sentry
messageprocessors
Package messageprocessors provides interfaces and implementations for processing uplink and downlink messages.
Package messageprocessors provides interfaces and implementations for processing uplink and downlink messages.
messageprocessors/cayennelpp
Package cayennelpp contains the CayenneLPP payload formatter message processors.
Package cayennelpp contains the CayenneLPP payload formatter message processors.
messageprocessors/javascript
Package javascript contains the Javascript payload formatter message processors.
Package javascript contains the Javascript payload formatter message processors.
messageprocessors/normalizedpayload
Package normalizedpayload implements functionality for parsing and validating normalized payload.
Package normalizedpayload implements functionality for parsing and validating normalized payload.
metrics
Package metrics creates the metrics registry and exposes some common metrics.
Package metrics creates the metrics registry and exposes some common metrics.
mqtt
Package mqtt contains MQTT-related utilities.
Package mqtt contains MQTT-related utilities.
networkserver
Package networkserver provides a LoRaWAN-compliant Network Server implementation.
Package networkserver provides a LoRaWAN-compliant Network Server implementation.
networkserver/internal
Internal package contains various Network Server utilities
Internal package contains various Network Server utilities
networkserver/internal/test
Package test contains testing utilities usable by all subpackages of networkserver including itself.
Package test contains testing utilities usable by all subpackages of networkserver including itself.
networkserver/internal/test/shared
Package test contains testing utilities usable by all subpackages of networkserver excluding itself.
Package test contains testing utilities usable by all subpackages of networkserver excluding itself.
networkserver/internal/time
Package time wraps "time" and allows for custom implementations of key functions.
Package time wraps "time" and allows for custom implementations of key functions.
networkserver/redis
Package redis provides Redis implementations of interfaces used by networkserver.
Package redis provides Redis implementations of interfaces used by networkserver.
packetbrokeragent
Package packetbrokeragent contains the implementation of the Packet Broker Agent component.
Package packetbrokeragent contains the implementation of the Packet Broker Agent component.
pfconfig/cpf
Package cpf implements the JSON configuration for the Common Packet Forwarder.
Package cpf implements the JSON configuration for the Common Packet Forwarder.
pfconfig/lbslns
Package lbslns implements the JSON configuration for the LoRa Basics Station `router_config` message.
Package lbslns implements the JSON configuration for the LoRa Basics Station `router_config` message.
pfconfig/semtechudp
Package semtechudp implements the JSON configuration for the Semtech UDP Packet Forwarder.
Package semtechudp implements the JSON configuration for the Semtech UDP Packet Forwarder.
pfconfig/shared
Package shared contains the configuration that is common to various gateway types.
Package shared contains the configuration that is common to various gateway types.
provisioning
Package provisioning provides a registry and implementations of vendor-specific device provisioners.
Package provisioning provides a registry and implementations of vendor-specific device provisioners.
qrcodegenerator
Package qrcodegenerator provides QR code generation services.
Package qrcodegenerator provides QR code generation services.
qrcodegenerator/qrcode
Package qrcode provides generic interfaces to work with QR codes.
Package qrcode provides generic interfaces to work with QR codes.
random
Package random implements goroutine-safe utilities on top of a secure random source.
Package random implements goroutine-safe utilities on top of a secure random source.
redis
Package redis provides a general Redis client and utilities.
Package redis provides a general Redis client and utilities.
redis/codec
Package codec provides a codec, which encodes and decodes protocol buffers stored in Redis to/from JSON.
Package codec provides a codec, which encodes and decodes protocol buffers stored in Redis to/from JSON.
rpcclient
Package rpcclient contains the default options for TTN gRPC clients.
Package rpcclient contains the default options for TTN gRPC clients.
rpcmetadata
Package rpcmetadata contains utilities for transporting common request metadata over gRPC.
Package rpcmetadata contains utilities for transporting common request metadata over gRPC.
rpcmiddleware/discover
Package discover implements a gRPC discovery middleware.
Package discover implements a gRPC discovery middleware.
rpcmiddleware/fillcontext
Package fillcontext implements a gRPC middleware that fills global context into a call context.
Package fillcontext implements a gRPC middleware that fills global context into a call context.
rpcmiddleware/hooks
Package hooks implements a gRPC middleware that executes service and method hooks.
Package hooks implements a gRPC middleware that executes service and method hooks.
rpcmiddleware/rpclog
Package rpclog implements a gRPC logging middleware.
Package rpclog implements a gRPC logging middleware.
rpcmiddleware/rpctracer
Package rpctracer implements a gRPC tracing middleware.
Package rpctracer implements a gRPC tracing middleware.
rpcmiddleware/sentry
Package sentry implements gRPC middleware that forwards errors in RPCs to Sentry
Package sentry implements gRPC middleware that forwards errors in RPCs to Sentry
rpcmiddleware/validator
Package validator implements a gRPC middleware that defines custom validators that are invoked when the service is called.
Package validator implements a gRPC middleware that defines custom validators that are invoked when the service is called.
rpcmiddleware/warning
Package warning communicates warnings over gRPC headers.
Package warning communicates warnings over gRPC headers.
rpcserver
Package rpcserver initializes The Things Network's base gRPC server
Package rpcserver initializes The Things Network's base gRPC server
scripting
Package scripting provides a generic abstraction layer for running scripts at runtime.
Package scripting provides a generic abstraction layer for running scripts at runtime.
scripting/javascript
Package javascript implements a Javascript scripting engine.
Package javascript implements a Javascript scripting engine.
specification/macspec
Package macspec provides access to LoRaWAN MAC specification-specific settings.
Package macspec provides access to LoRaWAN MAC specification-specific settings.
specification/relayspec
Package relayspec contains LoRaWAN relay related functionality.
Package relayspec contains LoRaWAN relay related functionality.
telemetry/exporter
Package telemetry contains the telemetry configuration and the hash generator that is used in other telemetry related packages.
Package telemetry contains the telemetry configuration and the hash generator that is used in other telemetry related packages.
telemetry/exporter/cli
Package cli contains telemetry functions regarding the collection of data in the CLI.
Package cli contains telemetry functions regarding the collection of data in the CLI.
telemetry/exporter/istelemetry
Package istelemetry contains telemetry functions regarding the collection of data in the IdentityServer.
Package istelemetry contains telemetry functions regarding the collection of data in the IdentityServer.
telemetry/exporter/models
Package models contains telemetry models.
Package models contains telemetry models.
telemetry/tracing
Package tracing provides tools for working with tracing.
Package tracing provides tools for working with tracing.
telemetry/tracing/tracer
Package tracer provides mechanisms to propagate tracer in context.
Package tracer provides mechanisms to propagate tracer in context.
toa
Package toa provides methods for computing a LoRaWAN packet's time-on-air.
Package toa provides methods for computing a LoRaWAN packet's time-on-air.
ttnpb
Package ttnpb is a reverse proxy.
Package ttnpb is a reverse proxy.
types
Package types contains basic types that are used in The Things Network's protobuf messages.
Package types contains basic types that are used in The Things Network's protobuf messages.
unique
Package unique provides functionality for working with unique identifiers of entities within a context.
Package unique provides functionality for working with unique identifiers of entities within a context.
util
Package util contains various utilities.
Package util contains various utilities.
util/byteutil
Package byteutil provides utilities for working with bytes using little endian binary encoding.
Package byteutil provides utilities for working with bytes using little endian binary encoding.
util/lora
Package lora contains LoRa modulation utilities.
Package lora contains LoRa modulation utilities.
util/store
Package store provides utilities when working with a database.
Package store provides utilities when working with a database.
util/test
Package test provides various testing utilities.
Package test provides various testing utilities.
util/test/apitest
Package apitest contains common API definition test utilities.
Package apitest contains common API definition test utilities.
util/test/assertions
Package assertions contains custom assertions compatible with github.com/smarty/assertions.
Package assertions contains custom assertions compatible with github.com/smarty/assertions.
util/test/assertions/should
Package should wraps assertions in github.com/smarty/assertions and util/test/assertions.
Package should wraps assertions in github.com/smarty/assertions and util/test/assertions.
version
Package version contains version and build variables set by the CI process.
Package version contains version and build variables set by the CI process.
web
webmiddleware
Package webmiddleware provides middleware for http Handlers.
Package webmiddleware provides middleware for http Handlers.

Jump to

Keyboard shortcuts

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