sdk

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootStr          = "/root"
	SubnetSeparator  = "/"
	UndefStr         = ""
	IPCAddrSeparator = ":"
)

Variables

View Source
var RootSubnet = SubnetID{
	Parent: RootStr,
	Actor:  id0,
}

RootSubnet is the ID of the root network

View Source
var UndefIPCAddress = IPCAddress{}

UndefIPCAddress creates a convenient type to define undefined IPC address

View Source
var UndefSubnetID = SubnetID{
	Parent: SubnetSeparator,
	Actor:  id0,
}

UndefSubnetID is the undef ID

Functions

func IsBottomup

func IsBottomup(from SubnetID, to SubnetID) bool

Types

type IPCAddress

type IPCAddress struct {
	SubnetID   SubnetID
	RawAddress address.Address
}

Address adds subnet information to raw Filecoin addresses

func AddressFromString

func AddressFromString(addr string) (IPCAddress, error)

func (*IPCAddress) MarshalCBOR

func (t *IPCAddress) MarshalCBOR(w io.Writer) error

func (*IPCAddress) UnmarshalCBOR

func (t *IPCAddress) UnmarshalCBOR(r io.Reader) (err error)

type Status

type Status int64

Status defines the different states in which a subnet can be.

const (
	Instantiated Status = iota
	Active
	Inactive
	Terminating
	Killed
)

type SubnetID

type SubnetID struct {
	Parent string
	Actor  address.Address
}

func NewSubnetID

func NewSubnetID(parent SubnetID, subnetAct address.Address) SubnetID

func NewSubnetIDFromString

func NewSubnetIDFromString(addr string) (SubnetID, error)

func (SubnetID) Bytes

func (s SubnetID) Bytes() []byte

func (SubnetID) CommonParent

func (id SubnetID) CommonParent(other SubnetID) (SubnetID, int)

func (SubnetID) Down

func (id SubnetID) Down(curr SubnetID) SubnetID

func (*SubnetID) MarshalCBOR

func (t *SubnetID) MarshalCBOR(w io.Writer) error

func (SubnetID) String

func (id SubnetID) String() string

String returns the id in string form.

func (*SubnetID) UnmarshalCBOR

func (t *SubnetID) UnmarshalCBOR(r io.Reader) (err error)

func (SubnetID) Up

func (id SubnetID) Up(curr SubnetID) SubnetID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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