Skip to content

Package Library


Gossamer is a modular blockchain framework; it was designed with a package structure that makes it possible to reuse Gossamer packages to build and run custom nodes and node services.

This document provides an overview of the packages that make up the Gossamer framework - more detailed information about each package can be found at

Gossamer packages can be categorized into four package types:

  • cmd packages

    • cmd/... - command-line packages for running nodes and other services
  • dot packages

    • dot/... - the dot node package and host node service packages
  • lib packages

    • lib/... - modular packages for building nodes and other services
  • test packages

    • tests/... - test packages for integration tests

cmd packages


  • The gossamer package is used to run nodes built with Gossamer.

dot packages


  • The dot package contains packages that implement the Polkadot Host spec. The dot package implements the Host Node; it is the base node implementation for all Official Nodes and Custom Services built with Gossamer.


  • The core package implements the Core Service - responsible for block production and block finalisation (consensus) and processing messages received from the Network Service.


  • The network package implements the Network Service - responsible for coordinating network host and peer interactions. It manages peer connections, receives and parses messages from connected peers and handles each message based on its type.


  • The state package implements the State Service - the source of truth for all chain and node state that is made accessible to all node services.


  • The sync package implements handling of blocks received from the network layer.


  • The rpc package implements the RPC Service - an HTTP server that handles state interactions.


  • The types package implements types defined within the Polkadot Host specification.

lib packages


  • the babe package implements the BABE block production algorithm.


  • the blocktree package implements the blocktree, a data structure which tracks the chain and all its non-finalised forks.


  • the common package defines common types and functions.


  • the crypto package contains the key types used by the node (sr25519, ed25519, secp256k1).


  • the grandpa package implements the GRANDPA finality gadget.


  • the keystore package manages the keystore and includes test keyrings.


  • the runtime package contains various wasm interpreters used to interpret the runtime. It currently contains life and wasmer; however, wasmer is the only interpreter that is fully supported at the moment. In the future, all interpreters will be fully supported.


  • the services package implements a common interface for node services.


  • the transaction package contains transaction types and the transaction queue data structure.


  • the trie package implements a modified merkle-patricia trie.


  • the utils package is used to manage node and test directories.

test packages


  • the polkadotjs_test section is a node.js implementation to test interaction with Gossamer's RPC.


  • the rpc test collection comprises tests to cover the RPC's various endpoints and return data.


  • the stress test collection comprises tests to simulate the node running under various high stress scenarios


  • the sync test collection comprises tests to verify the integrity of syncing operations and features


  • the utils test collection comprises tests to validate the function of various utilities throughout the Gossamer stack