Documentation ¶
Index ¶
- Variables
- func ParseID(id string) (uint64, error)
- func ParsePeerAddress(addr string) (launchtypes.Peer, error)
- func PeerAddress(peer launchtypes.Peer) (string, error)
- type Chain
- type CosmosClient
- type IBCInfo
- type JoinOption
- type Network
- func (n Network) Campaign(ctx context.Context, campaignID uint64) (networktypes.Campaign, error)
- func (n Network) Campaigns(ctx context.Context) ([]networktypes.Campaign, error)
- func (n Network) ChainLaunch(ctx context.Context, id uint64) (networktypes.ChainLaunch, error)
- func (n Network) ChainLaunchesWithReward(ctx context.Context) ([]networktypes.ChainLaunch, error)
- func (n Network) ChainReward(ctx context.Context, launchID uint64) (rewardtypes.RewardPool, error)
- func (n Network) CreateCampaign(name, metadata string, totalSupply sdk.Coins) (uint64, error)
- func (n Network) CreateClient(launchID uint64, ibcInfo IBCInfo) (string, error)
- func (n Network) GenesisAccounts(ctx context.Context, launchID uint64) (genAccs []networktypes.GenesisAccount, err error)
- func (n Network) GenesisInformation(ctx context.Context, launchID uint64) (gi networktypes.GenesisInformation, err error)
- func (n Network) GenesisValidators(ctx context.Context, launchID uint64) (genVals []networktypes.GenesisValidator, err error)
- func (n Network) InitializeMainnet(campaignID uint64, sourceURL, sourceHash string, mainnetChainID string) (uint64, error)
- func (n Network) Join(ctx context.Context, c Chain, launchID uint64, options ...JoinOption) error
- func (n Network) LaunchParams(ctx context.Context) (launchtypes.Params, error)
- func (n Network) MainnetAccounts(ctx context.Context, campaignID uint64) (genAccs []networktypes.MainnetAccount, err error)
- func (n Network) MainnetVestingAccounts(ctx context.Context, campaignID uint64) (genAccs []networktypes.MainnetVestingAccount, err error)
- func (n Network) Publish(ctx context.Context, c Chain, options ...PublishOption) (launchID, campaignID, mainnetID uint64, err error)
- func (n Network) Request(ctx context.Context, launchID, requestID uint64) (networktypes.Request, error)
- func (n Network) RequestFromIDs(ctx context.Context, launchID uint64, requestIDs ...uint64) (reqs []networktypes.Request, err error)
- func (n Network) Requests(ctx context.Context, launchID uint64) ([]networktypes.Request, error)
- func (n Network) RevertLaunch(launchID uint64, chain Chain) error
- func (n Network) SetReward(launchID uint64, lastRewardHeight int64, coins sdk.Coins) error
- func (n Network) SubmitRequest(launchID uint64, reviewal ...Reviewal) error
- func (n Network) TriggerLaunch(ctx context.Context, launchID uint64, remainingTime time.Duration) error
- func (n Network) UpdateCampaign(id uint64, props ...Prop) error
- func (n Network) VestingAccounts(ctx context.Context, launchID uint64) (vestingAccs []networktypes.VestingAccount, err error)
- type Node
- type Option
- func CollectEvents(ev events.Bus) Option
- func WithCampaignQueryClient(client campaigntypes.QueryClient) Option
- func WithLaunchQueryClient(client launchtypes.QueryClient) Option
- func WithProfileQueryClient(client profiletypes.QueryClient) Option
- func WithRewardQueryClient(client rewardtypes.QueryClient) Option
- type Prop
- type PublishOption
- func Mainnet() PublishOption
- func WithCampaign(id uint64) PublishOption
- func WithChainID(chainID string) PublishOption
- func WithCustomGenesis(url string) PublishOption
- func WithMetadata(metadata string) PublishOption
- func WithNoCheck() PublishOption
- func WithShares(shares campaigntypes.Shares) PublishOption
- func WithTotalSupply(totalSupply sdk.Coins) PublishOption
- type Reviewal
Constants ¶
This section is empty.
Variables ¶
var ( // ErrObjectNotFound is returned when the query returns a not found error. ErrObjectNotFound = errors.New("query object not found") )
Functions ¶
func ParsePeerAddress ¶
func ParsePeerAddress(addr string) (launchtypes.Peer, error)
func PeerAddress ¶
func PeerAddress(peer launchtypes.Peer) (string, error)
Types ¶
type Chain ¶
type Chain interface { ID() (string, error) ChainID() (string, error) Name() string SourceURL() string SourceHash() string GenesisPath() (string, error) GentxsPath() (string, error) DefaultGentxPath() (string, error) AppTOMLPath() (string, error) ConfigTOMLPath() (string, error) NodeID(ctx context.Context) (string, error) CacheBinary(launchID uint64) error ResetGenesisTime() error }
type CosmosClient ¶
type CosmosClient interface { Account(accountName string) (cosmosaccount.Account, error) Address(accountName string) (sdktypes.AccAddress, error) Context() client.Context BroadcastTx(accountName string, msgs ...sdktypes.Msg) (cosmosclient.Response, error) BroadcastTxWithProvision(accountName string, msgs ...sdktypes.Msg) (gas uint64, broadcast func() (cosmosclient.Response, error), err error) Status(ctx context.Context) (*ctypes.ResultStatus, error) ConsensusInfo(ctx context.Context, height int64) (cosmosclient.ConsensusInfo, error) }
type IBCInfo ¶
type IBCInfo struct { ConsensusState spntypes.ConsensusState ValidatorSet spntypes.ValidatorSet UnbondingTime int64 Height uint64 }
IBCInfo is node client info.
type JoinOption ¶
type JoinOption func(*joinOptions)
func WithAccountRequest ¶
func WithAccountRequest(amount sdk.Coins) JoinOption
func WithCustomGentxPath ¶
func WithCustomGentxPath(path string) JoinOption
TODO accept struct not file path
func WithPublicAddress ¶
func WithPublicAddress(addr string) JoinOption
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network is network builder.
func New ¶
func New(cosmos CosmosClient, account cosmosaccount.Account, options ...Option) Network
New creates a Builder.
func (Network) ChainLaunch ¶
func (n Network) ChainLaunch(ctx context.Context, id uint64) (networktypes.ChainLaunch, error)
ChainLaunch fetches the chain launch from Network by launch id.
func (Network) ChainLaunchesWithReward ¶
func (n Network) ChainLaunchesWithReward(ctx context.Context) ([]networktypes.ChainLaunch, error)
ChainLaunchesWithReward fetches the chain launches with rewards from Network
func (Network) ChainReward ¶
func (n Network) ChainReward(ctx context.Context, launchID uint64) (rewardtypes.RewardPool, error)
ChainReward fetches the chain reward from SPN by launch id
func (Network) CreateCampaign ¶
CreateCampaign creates a campaign in Network
func (Network) CreateClient ¶
func (Network) GenesisAccounts ¶
func (n Network) GenesisAccounts(ctx context.Context, launchID uint64) (genAccs []networktypes.GenesisAccount, err error)
GenesisAccounts returns the list of approved genesis accounts for a launch from SPN
func (Network) GenesisInformation ¶
func (n Network) GenesisInformation(ctx context.Context, launchID uint64) (gi networktypes.GenesisInformation, err error)
GenesisInformation returns all the information to construct the genesis from a chain ID
func (Network) GenesisValidators ¶
func (n Network) GenesisValidators(ctx context.Context, launchID uint64) (genVals []networktypes.GenesisValidator, err error)
GenesisValidators returns the list of approved genesis validators for a launch from SPN
func (Network) InitializeMainnet ¶
func (n Network) InitializeMainnet( campaignID uint64, sourceURL, sourceHash string, mainnetChainID string, ) (uint64, error)
InitializeMainnet Initialize the mainnet of the campaign.
func (Network) Join ¶
func (n Network) Join( ctx context.Context, c Chain, launchID uint64, options ...JoinOption, ) error
Join to the network.
func (Network) LaunchParams ¶
LaunchParams fetches the chain launch module params from SPN
func (Network) MainnetAccounts ¶
func (n Network) MainnetAccounts(ctx context.Context, campaignID uint64) (genAccs []networktypes.MainnetAccount, err error)
MainnetAccounts returns the list of campaign mainnet accounts for a launch from SPN
func (Network) MainnetVestingAccounts ¶
func (n Network) MainnetVestingAccounts(ctx context.Context, campaignID uint64) (genAccs []networktypes.MainnetVestingAccount, err error)
MainnetVestingAccounts returns the list of campaign mainnet vesting accounts for a launch from SPN
func (Network) Publish ¶
func (n Network) Publish(ctx context.Context, c Chain, options ...PublishOption) (launchID, campaignID, mainnetID uint64, err error)
Publish submits Genesis to SPN to announce a new network.
func (Network) Request ¶
func (n Network) Request(ctx context.Context, launchID, requestID uint64) (networktypes.Request, error)
Request fetches the chain request from SPN by launch and request id
func (Network) RequestFromIDs ¶
func (n Network) RequestFromIDs(ctx context.Context, launchID uint64, requestIDs ...uint64) (reqs []networktypes.Request, err error)
RequestFromIDs fetches the chain requested from SPN by launch and provided request IDs TODO: once implemented, use the SPN query from https://github.com/tendermint/spn/issues/420
func (Network) RevertLaunch ¶
RevertLaunch reverts a launched chain as a coordinator
func (Network) SubmitRequest ¶
SubmitRequest submits reviewals for proposals in batch for chain.
func (Network) TriggerLaunch ¶
func (n Network) TriggerLaunch(ctx context.Context, launchID uint64, remainingTime time.Duration) error
TriggerLaunch launches a chain as a coordinator
func (Network) UpdateCampaign ¶
UpdateCampaign updates the campaign name or metadata
func (Network) VestingAccounts ¶
func (n Network) VestingAccounts(ctx context.Context, launchID uint64) (vestingAccs []networktypes.VestingAccount, err error)
VestingAccounts returns the list of approved genesis vesting accounts for a launch from SPN
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is node builder.
func NewNodeClient ¶
func NewNodeClient(cosmos CosmosClient) (Node, error)
func (Node) StakingParams ¶
StakingParams fetches the staking module params
type Option ¶
type Option func(*Network)
func CollectEvents ¶
CollectEvents collects events from the network builder.
func WithCampaignQueryClient ¶
func WithCampaignQueryClient(client campaigntypes.QueryClient) Option
func WithLaunchQueryClient ¶
func WithLaunchQueryClient(client launchtypes.QueryClient) Option
func WithProfileQueryClient ¶
func WithProfileQueryClient(client profiletypes.QueryClient) Option
func WithRewardQueryClient ¶
func WithRewardQueryClient(client rewardtypes.QueryClient) Option
type Prop ¶
type Prop func(*updateProp)
Prop update campaign proposal
func WithCampaignMetadata ¶
WithCampaignMetadata provides a meta data proposal to update the campaign.
func WithCampaignName ¶
WithCampaignName provides a name proposal to update the campaign.
func WithCampaignTotalSupply ¶
WithCampaignTotalSupply provides a total supply proposal to update the campaign.
type PublishOption ¶
type PublishOption func(*publishOptions)
PublishOption configures chain creation.
func WithChainID ¶
func WithChainID(chainID string) PublishOption
WithChainID use a custom chain id.
func WithCustomGenesis ¶
func WithCustomGenesis(url string) PublishOption
WithCustomGenesis enables using a custom genesis during publish.
func WithMetadata ¶
func WithMetadata(metadata string) PublishOption
WithMetadata provides a meta data proposal to update the campaign.
func WithNoCheck ¶
func WithNoCheck() PublishOption
WithNoCheck disables checking integrity of the chain.
func WithShares ¶
func WithShares(shares campaigntypes.Shares) PublishOption
WithShares enables minting vouchers for shares.
func WithTotalSupply ¶
func WithTotalSupply(totalSupply sdk.Coins) PublishOption
WithTotalSupply provides a total supply proposal to update the campaign.
type Reviewal ¶
Reviewal keeps a request's reviewal.
func ApproveRequest ¶
ApproveRequest returns approval for a request with id.
func RejectRequest ¶
RejectRequest returns rejection for a request with id.