route

package
v1.102.5 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package route addresses a node's HTTP API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alias

func Alias(address string) (string, bool)

Alias reads back what Chain writes: the alias in a chain address, and whether the address named a chain at all. Inverse of Chain, and the one place this module recognises the segment.

func Chain

func Chain(uri, alias string) string

Chain is where a chain answers, and the one place this module builds that address.

uri is a node's base URL, or empty for the path alone: Chain("", "P") is the P-Chain path, and Chain("http://localhost:9630", "C")+"/rpc" is that node's C-Chain RPC. The segment is constants.ChainAliasPrefix, named once, so every caller moves when it moves.

That is the point of routing them all through here. This module used to spell the address out at 112 sites; when the node renamed the segment, all 112 went on addressing a name the router had already left behind. Nothing failed to compile. They simply answered 404.

Types

This section is empty.

Jump to

Keyboard shortcuts

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