Documentation ¶
Index ¶
- Constants
- func ChainHome(launchID uint64) (path string)
- func IsChainHomeExist(launchID uint64) (path string, ok bool, err error)
- func SetSPNConfig(config Config, path string) error
- type Binary
- type BinaryCacheList
- type Chain
- func (c Chain) AppTOMLPath() (string, error)
- func (c Chain) BinaryName() (name string, err error)
- func (c *Chain) Build(ctx context.Context) (binaryName string, err error)
- func (c *Chain) CacheBinary(launchID uint64) error
- func (c Chain) ChainID() (string, error)
- func (c Chain) ConfigTOMLPath() (string, error)
- func (c Chain) DefaultGentxPath() (path string, err error)
- func (c Chain) GenesisPath() (path string, err error)
- func (c Chain) GentxsPath() (path string, err error)
- func (c Chain) Home() (path string, err error)
- func (c Chain) ID() (string, error)
- func (c *Chain) ImportAccount(ctx context.Context, name string) (string, error)
- func (c *Chain) Init(ctx context.Context) error
- func (c Chain) InitAccount(ctx context.Context, v chain.Validator, accountName string) (string, error)
- func (c Chain) IsHomeDirExist() (ok bool, err error)
- func (c Chain) Name() string
- func (c Chain) NodeID(ctx context.Context) (string, error)
- func (c Chain) Prepare(ctx context.Context, gi networktypes.GenesisInformation) error
- func (c Chain) ResetGenesisTime() error
- func (c *Chain) SPNConfigPath() (string, error)
- func (c Chain) SetHome(home string)
- func (c Chain) SimulateRequests(ctx context.Context, gi networktypes.GenesisInformation, ...) (err error)
- func (c Chain) SourceHash() string
- func (c Chain) SourceURL() string
- type Config
- type Option
- type SourceOption
- type TunneledPeer
Constants ¶
const ( SPNCacheDirectory = "spn" BinaryCacheDirectory = "binary-cache" BinaryCacheFilename = "checksums.yml" )
const ( ListeningTimeout = time.Minute * 1 ValidatorSetNilErrorMessage = "validator set is nil in genesis and still empty after InitChain" )
const (
HTTPTunnelChisel = "chisel"
)
const SPNConfigFile = "spn.yml"
Variables ¶
This section is empty.
Functions ¶
func IsChainHomeExist ¶
IsChainHomeExist checks if a home with the provided launchID already exist.
func SetSPNConfig ¶
Types ¶
type Binary ¶
Binary associates launch id with build hash where build hash is sha256(binary, source)
type BinaryCacheList ¶
type BinaryCacheList struct {
CachedBinaries []Binary `yaml:"cached_binaries"`
}
func (*BinaryCacheList) Set ¶
func (l *BinaryCacheList) Set(launchID uint64, buildHash string)
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain represents a network blockchain and lets you interact with its source code and binary.
func New ¶
func New(ctx context.Context, ar cosmosaccount.Registry, source SourceOption, options ...Option) (*Chain, error)
New initializes a network blockchain from source and options.
func (Chain) AppTOMLPath ¶
func (Chain) BinaryName ¶
func (*Chain) CacheBinary ¶
CacheBinary caches last built chain binary associated with launch id
func (Chain) ConfigTOMLPath ¶
func (Chain) DefaultGentxPath ¶
func (Chain) GenesisPath ¶
func (Chain) GentxsPath ¶
func (*Chain) ImportAccount ¶
ImportAccount imports an account from Starport into the chain. we first export the account into a temporary key file and import it with the chain CLI.
func (*Chain) Init ¶
Init initializes blockchain by building the binaries and running the init command and create the initial genesis of the chain, and set up a validator key
func (Chain) InitAccount ¶
func (c Chain) InitAccount(ctx context.Context, v chain.Validator, accountName string) (string, error)
InitAccount initializes an account for the blockchain and issue a gentx in config/gentx/gentx.json
func (Chain) IsHomeDirExist ¶
func (Chain) Prepare ¶
func (c Chain) Prepare(ctx context.Context, gi networktypes.GenesisInformation) error
Prepare prepares the chain to be launched from genesis information
func (Chain) ResetGenesisTime ¶
ResetGenesisTime reset the chain genesis time
func (*Chain) SPNConfigPath ¶
func (Chain) SimulateRequests ¶
func (c Chain) SimulateRequests(ctx context.Context, gi networktypes.GenesisInformation, reqs []networktypes.Request) (err error)
SimulateRequests simulates the genesis creation and the start of the network from the provided requests
func (Chain) SourceHash ¶
type Config ¶
type Config struct {
TunneledPeers []TunneledPeer `json:"tunneled_peers" yaml:"tunneled_peers"`
}
func GetSPNConfig ¶
type Option ¶
type Option func(*Chain)
Option sets other initialization options.
func CollectEvents ¶
CollectEvents collects events from the chain.
func WithGenesisFromURL ¶
WithGenesisFromURL provides a genesis url for the initial genesis of the chain blockchain
func WithKeyringBackend ¶
func WithKeyringBackend(keyringBackend chaincmd.KeyringBackend) Option
WithKeyringBackend provides the keyring backend to use to initialize the blockchain
type SourceOption ¶
type SourceOption func(*Chain)
SourceOption sets the source for blockchain.
func SourceLaunch ¶
func SourceLaunch(launch networktypes.ChainLaunch) SourceOption
SourceLaunch returns a source option for initializing a chain from a launch
func SourceRemote ¶
func SourceRemote(url string) SourceOption
SourceRemote sets the default branch on a remote as source for the blockchain.
func SourceRemoteBranch ¶
func SourceRemoteBranch(url, branch string) SourceOption
SourceRemoteBranch sets the branch on a remote as source for the blockchain.
func SourceRemoteHash ¶
func SourceRemoteHash(url, hash string) SourceOption
SourceRemoteHash uses a remote hash as source for the blockchain.
func SourceRemoteTag ¶
func SourceRemoteTag(url, tag string) SourceOption
SourceRemoteTag sets the tag on a remote as source for the blockchain.
type TunneledPeer ¶
type TunneledPeer struct { // Name represents tunnel type e.g. "chisel" Name string `json:"name" yaml:"name"` // Address represents http address of the tunnel e.g. "https://tendermint-starport-i5e75cplx02.ws-eu31.gitpod.io/" Address string `json:"address" yaml:"address"` // NodeID tendermint node id of the node behind the tunnel e.g. "e6a59e37b2761f26a21c9168f78a7f2b07c120c7" NodeID string `json:"node_id" yaml:"node_id"` // LocalPort specifies port which has to be used for local tunnel client LocalPort string `json:"local_port" yaml:"local_port"` }
TunneledPeer represents http tunnel to a peer which can't be reached via regular tcp connection