Documentation ¶
Index ¶
- Constants
- Variables
- func DockerImageName(version string) string
- func GetLatestVersion() (string, error)
- func MakeAppConfig(_ *Node) (*serverconfig.Config, error)
- func MakeConfig(ctx context.Context, node *Node, opts ...Option) (*config.Config, error)
- func NoError(message string, err error)
- func WriteAddressBook(peers []string, file string) error
- type GrafanaInfo
- type Node
- func (n Node) AddressP2P(ctx context.Context, withID bool) string
- func (n Node) AddressRPC() string
- func (n Node) AddressTracing() string
- func (n Node) Client() (*http.HTTP, error)
- func (n *Node) EnableNetShaper()
- func (n *Node) GenesisValidator() genesis.Validator
- func (n *Node) Init(ctx context.Context, genesis *types.GenesisDoc, peers []string, ...) error
- func (n Node) IsValidator() bool
- func (n *Node) PullBlockSummaryTraces(path string) ([]trace.Event[schema.BlockSummary], error)
- func (n *Node) PullRoundStateTraces(path string) ([]trace.Event[schema.RoundState], error)
- func (n Node) RemoteAddressGRPC(ctx context.Context) (string, error)
- func (n Node) RemoteAddressRPC(ctx context.Context) (string, error)
- func (n Node) RemoteAddressTracing(ctx context.Context) (string, error)
- func (n *Node) SetLatencyAndJitter(latency, jitter int64) error
- func (n *Node) Start(ctx context.Context) error
- func (n *Node) StartAsync(ctx context.Context) error
- func (n *Node) Upgrade(ctx context.Context, version string) error
- func (n *Node) WaitUntilStartedAndCreateProxy(ctx context.Context) error
- type Option
- func WithBroadcastTxs(broadcast bool) Option
- func WithLocalTracing(localTracingType string) Option
- func WithMempool(mempool string) Option
- func WithMempoolMaxTxBytes(maxTxBytes int) Option
- func WithMempoolMaxTxsBytes(maxTxsBytes int64) Option
- func WithPerPeerBandwidth(bandwidth int64) Option
- func WithPrometheus(prometheus bool) Option
- func WithTimeoutCommit(timeout time.Duration) Option
- func WithTimeoutPropose(timeout time.Duration) Option
- func WithTxIndexer(indexer string) Option
- type Options
- type Resources
- type Testnet
- func (t *Testnet) Cleanup(ctx context.Context)
- func (t *Testnet) CreateAccount(name string, tokens int64, txsimKeyringDir string) (keyring.Keyring, error)
- func (t *Testnet) CreateGenesisNode(ctx context.Context, version string, selfDelegation, upgradeHeightV2 int64, ...) error
- func (t *Testnet) CreateGenesisNodes(ctx context.Context, num int, version string, ...) error
- func (t *Testnet) CreateNode(ctx context.Context, version string, startHeight, upgradeHeight int64, ...) error
- func (t *Testnet) CreateTxClient(ctx context.Context, name string, version string, blobSequences int, ...) error
- func (t *Testnet) CreateTxClients(ctx context.Context, version string, sequences int, blobRange string, ...) error
- func (t *Testnet) Genesis() *genesis.Genesis
- func (t *Testnet) GetGenesisValidators() []genesis.Validator
- func (t *Testnet) NewPreloader() (*preloader.Preloader, error)
- func (t *Testnet) Node(i int) *Node
- func (t *Testnet) Nodes() []*Node
- func (t *Testnet) RPCEndpoints() []string
- func (t *Testnet) RemoteGRPCEndpoints(ctx context.Context) ([]string, error)
- func (t *Testnet) RemoteRPCEndpoints(ctx context.Context) ([]string, error)
- func (t *Testnet) SetConsensusMaxBlockSize(size int64)
- func (t *Testnet) SetConsensusParams(params *tmproto.ConsensusParams)
- func (t *Testnet) Setup(ctx context.Context, configOpts ...Option) error
- func (t *Testnet) Start(ctx context.Context) error
- func (t *Testnet) StartNodes(ctx context.Context) error
- func (t *Testnet) StartTxClients(ctx context.Context) error
- func (t *Testnet) WaitToSync(ctx context.Context) error
- type TxSim
- type Version
- type VersionSet
Constants ¶
const ( TxsimVersion = "8e573bb" MB = 1000 * 1000 GB = 1000 * MB MiB = 1024 * 1024 GiB = 1024 * MiB )
const ( DefaultSeed int64 = 42 DefaultChainID = "test-chain-id" )
Variables ¶
Functions ¶
func DockerImageName ¶
func GetLatestVersion ¶
GetLatestVersion retrieves the latest git commit hash or semantic version of the main branch.
func MakeAppConfig ¶
func MakeAppConfig(_ *Node) (*serverconfig.Config, error)
func MakeConfig ¶
func WriteAddressBook ¶
Types ¶
type GrafanaInfo ¶
func GetGrafanaInfoFromEnvVar ¶
func GetGrafanaInfoFromEnvVar() *GrafanaInfo
type Node ¶
type Node struct { Name string Version string StartHeight int64 InitialPeers []string SignerKey crypto.PrivKey NetworkKey crypto.PrivKey SelfDelegation int64 Instance *instance.Instance // contains filtered or unexported fields }
func (Node) AddressP2P ¶
AddressP2P returns a P2P endpoint address for the node. This is used for populating the address book. This will look something like: 3314051954fc072a0678ec0cbac690ad8676ab98@61.108.66.220:26656
func (Node) AddressRPC ¶
AddressRPC returns an RPC endpoint address for the node. This returns the proxy host that can be used to communicate with the node
func (Node) AddressTracing ¶
func (*Node) EnableNetShaper ¶
func (n *Node) EnableNetShaper()
func (*Node) GenesisValidator ¶
func (Node) IsValidator ¶
func (*Node) PullBlockSummaryTraces ¶
PullBlockSummaryTraces retrieves the block summary traces from a node. It will save them to the provided path.
func (*Node) PullRoundStateTraces ¶
PullRoundStateTraces retrieves the round state traces from a node. It will save them to the provided path.
func (Node) RemoteAddressGRPC ¶
RemoteAddressGRPC retrieves the gRPC endpoint address of a node within the cluster.
func (Node) RemoteAddressRPC ¶
RemoteAddressRPC retrieves the RPC endpoint address of a node within the cluster.
func (Node) RemoteAddressTracing ¶
func (*Node) SetLatencyAndJitter ¶
type Option ¶
func WithBroadcastTxs ¶
func WithLocalTracing ¶
func WithMempool ¶
func WithMempoolMaxTxBytes ¶
func WithMempoolMaxTxsBytes ¶
func WithPerPeerBandwidth ¶
func WithPrometheus ¶
func WithTimeoutCommit ¶
func WithTimeoutPropose ¶
func WithTxIndexer ¶
type Options ¶
type Options struct { Seed int64 Grafana *GrafanaInfo ChainID string GenesisModifiers []genesis.Modifier }
type Resources ¶
type Resources struct { // MemoryRequest specifies the initial memory allocation for the Node. MemoryRequest resource.Quantity // MemoryLimit specifies the maximum memory allocation for the Node. MemoryLimit resource.Quantity // CPU specifies the CPU allocation for the Node. CPU resource.Quantity // Volume specifies the storage volume allocation for the Node. Volume resource.Quantity }
Resources defines the resource requirements for a Node.
type Testnet ¶
type Testnet struct {
// contains filtered or unexported fields
}
func (*Testnet) CreateAccount ¶
func (t *Testnet) CreateAccount(name string, tokens int64, txsimKeyringDir string) (keyring.Keyring, error)
CreateAccount creates an account and adds it to the testnet genesis. The account is created with the given name and tokens and is persisted in the given txsimKeyringDir. If txsimKeyringDir is an empty string, an in-memory keyring is created.
func (*Testnet) CreateGenesisNode ¶
func (*Testnet) CreateGenesisNodes ¶
func (*Testnet) CreateNode ¶
func (*Testnet) CreateTxClient ¶
func (t *Testnet) CreateTxClient( ctx context.Context, name string, version string, blobSequences int, blobRange string, blobPerSequence int, resources Resources, grpcEndpoint string, upgradeSchedule map[int64]uint64, ) error
CreateTxClient creates a txsim node and sets it up.
Parameters: ctx: Context for managing the lifecycle. name: Name of the txsim knuu instance. version: Version of the txsim Docker image to pull. blobSequences: Number of blob sequences to run by the txsim. blobRange: Range of blob sizes in bytes used by the txsim. blobPerSequence: Number of blobs per sequence. resources: Resources allocated to the txsim. grpcEndpoint: gRPC endpoint of the node for transaction submission. upgradeSchedule: Map from height to version for scheduled upgrades (v3 and onwards).
func (*Testnet) CreateTxClients ¶
func (*Testnet) GetGenesisValidators ¶
func (*Testnet) RPCEndpoints ¶
func (*Testnet) RemoteGRPCEndpoints ¶
RemoteGRPCEndpoints retrieves the gRPC endpoint addresses of the testnet's validator nodes.
func (*Testnet) RemoteRPCEndpoints ¶
RemoteRPCEndpoints retrieves the RPC endpoint addresses of the testnet's validator nodes.
func (*Testnet) SetConsensusMaxBlockSize ¶
func (*Testnet) SetConsensusParams ¶
func (t *Testnet) SetConsensusParams(params *tmproto.ConsensusParams)
func (*Testnet) StartNodes ¶
StartNodes starts the testnet nodes and setup proxies. It does not wait for the nodes to produce blocks. For that, use WaitToSync.
type TxSim ¶
func CreateTxClient ¶
func CreateTxClient( ctx context.Context, name string, version string, endpoint string, seed int64, blobSequences int, blobRange string, blobsPerSeq int, pollTime int, resources Resources, volumePath string, knuu *knuu.Knuu, upgradeSchedule map[int64]uint64, ) (*TxSim, error)
CreateTxClient returns a new TxSim instance.
type Version ¶
func ParseVersion ¶
ParseVersion takes a string and returns a Version. If the string is not a valid version, the second return value is false. Must be of the format v1.0.0 or v1.0.0-rc1 (i.e. following SemVer)
type VersionSet ¶
type VersionSet []Version
func ParseVersions ¶
func ParseVersions(versionStr string) VersionSet
ParseVersions takes a string of space-separated versions and returns a VersionSet. Invalid versions are ignored.
func (VersionSet) FilterMajor ¶
func (v VersionSet) FilterMajor(majorVersion uint64) VersionSet
func (VersionSet) FilterOutReleaseCandidates ¶
func (v VersionSet) FilterOutReleaseCandidates() VersionSet
func (VersionSet) GetLatest ¶
func (v VersionSet) GetLatest() Version
func (VersionSet) Order ¶
func (v VersionSet) Order()
func (VersionSet) String ¶
func (v VersionSet) String() string