Documentation ¶
Index ¶
- func NewClientCtx(kr keyring.Keyring, c *rpchttp.HTTP, out io.Writer) client.Context
- func NewFactory(clientCtx client.Context) tx.Factory
- type Account
- type Chain
- type ChainListOption
- type Client
- func (c *Client) AccountCreate(accountName, mnemonic string) (Account, error)
- func (c *Client) AccountExport(accountName, password string) (privateKey string, err error)
- func (c *Client) AccountGet(accountName string) (Account, error)
- func (c *Client) AccountImport(accountName, privateKey, password string) error
- func (c *Client) AccountList() ([]Account, error)
- func (c *Client) ChainCreate(ctx context.Context, accountName, chainID string, sourceURL, sourceHash string) error
- func (c *Client) ChainList(ctx context.Context, accountName string, options ...ChainListOption) (chains []Chain, nextPageKey []byte, err error)
- func (c *Client) LaunchInformation(ctx context.Context, accountName, chainID string) (LaunchInformation, error)
- func (c *Client) ProposalGet(ctx context.Context, accountName, chainID string, id int) (Proposal, error)
- func (c *Client) ProposalList(ctx context.Context, acccountName, chainID string, ...) ([]Proposal, error)
- func (c *Client) Propose(ctx context.Context, accountName, chainID string, proposals ...ProposalOption) error
- func (c *Client) ShowChain(ctx context.Context, accountName, chainID string) (Chain, error)
- func (c *Client) SimulatedLaunchInformation(ctx context.Context, accountName, chainID string, proposalIDs []int) (LaunchInformation, error)
- func (c *Client) SubmitReviewals(ctx context.Context, accountName, chainID string, reviewals ...Reviewal) (gas uint64, broadcast func() error, err error)
- type GenesisAccount
- type LaunchInformation
- type Option
- type Proposal
- type ProposalAddAccount
- type ProposalAddValidator
- type ProposalListOption
- type ProposalOption
- type ProposalStatus
- type ProposalType
- type Reviewal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientCtx ¶
Types ¶
type ChainListOption ¶
type ChainListOption func(*chainListOptions)
ChainListOption configures chain listing options.
func PaginateChainListing ¶
func PaginateChainListing(key []byte, limit uint64) ChainListOption
PaginateChainListing sets pagination for chain listing.
func PrefixChainListing ¶
func PrefixChainListing(prefix string) ChainListOption
PrefixChainListing sets the prefix for the chain to search for.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is client to interact with SPN.
func New ¶
New creates a new SPN Client with nodeAddress of a full SPN node. by default, OS is used as keyring backend.
func (*Client) AccountCreate ¶
AccountCreate creates an account by name and mnemonic (optional) in the keyring.
func (*Client) AccountExport ¶
AccountExport exports an account in the keyring by name and an encryption password into privateKey. password later can be used to decrypt the privateKey.
func (*Client) AccountGet ¶
AccountGet retrieves an account by name from the keyring.
func (*Client) AccountImport ¶
AccountImport imports an account to the keyring by account name, privateKey and decryption password.
func (*Client) AccountList ¶
AccountList returns a list of accounts.
func (*Client) ChainCreate ¶
func (c *Client) ChainCreate(ctx context.Context, accountName, chainID string, sourceURL, sourceHash string) error
ChainCreate creates a new chain.
func (*Client) ChainList ¶
func (c *Client) ChainList(ctx context.Context, accountName string, options ...ChainListOption) (chains []Chain, nextPageKey []byte, err error)
ChainList lists chain summaries
func (*Client) LaunchInformation ¶
func (c *Client) LaunchInformation(ctx context.Context, accountName, chainID string) (LaunchInformation, error)
LaunchInformation retrieves chain's launch information.
func (*Client) ProposalGet ¶
func (*Client) ProposalList ¶
func (c *Client) ProposalList(ctx context.Context, acccountName, chainID string, options ...ProposalListOption) ([]Proposal, error)
ProposalList lists proposals on a chain by status.
func (*Client) Propose ¶
func (c *Client) Propose(ctx context.Context, accountName, chainID string, proposals ...ProposalOption) error
Propose proposes given proposals in batch for chainID by using SPN accountName.
func (*Client) SimulatedLaunchInformation ¶
func (c *Client) SimulatedLaunchInformation(ctx context.Context, accountName, chainID string, proposalIDs []int) (LaunchInformation, error)
SimulatedLaunchInformation retrieves chain's simulated launch information.
type GenesisAccount ¶
type GenesisAccount struct { Address types.AccAddress Coins types.Coins }
GenesisAccount represents a genesis account inside a chain with its allocated coins.
type LaunchInformation ¶
type LaunchInformation struct { GenesisAccounts []GenesisAccount GenTxs []jsondoc.Doc Peers []string }
LaunchInformation keeps the chain's launch information.
type Proposal ¶
type Proposal struct { ID int `yaml:",omitempty"` Status ProposalStatus `yaml:",omitempty"` Account *ProposalAddAccount `yaml:",omitempty"` Validator *ProposalAddValidator `yaml:",omitempty"` }
Proposal represents a proposal.
type ProposalAddAccount ¶
ProposalAddAccount used to propose adding an account.
type ProposalAddValidator ¶
type ProposalAddValidator struct { Gentx jsondoc.Doc ValidatorAddress string SelfDelegation types.Coin P2PAddress string }
ProposalAddValidator used to propose adding a validator.
type ProposalListOption ¶
type ProposalListOption func(*proposalListOptions)
ProposalListOption configures proposal listing options.
func ProposalListStatus ¶
func ProposalListStatus(status ProposalStatus) ProposalListOption
ProposalListStatus sets proposal status filter for proposal listing.
func ProposalListType ¶
func ProposalListType(typ ProposalType) ProposalListOption
ProposalListType sets proposal type filter for proposal listing.
type ProposalOption ¶
type ProposalOption func(*Proposal)
ProposalOption configures Proposal to set a spesific type of proposal.
func AddAccountProposal ¶
func AddAccountProposal(address string, coins types.Coins) ProposalOption
AddAccountProposal creates an add account proposal option.
func AddValidatorProposal ¶
func AddValidatorProposal(gentx jsondoc.Doc, validatorAddress string, selfDelegation types.Coin, p2pAddress string) ProposalOption
AddValidatorProposal creates an add validator proposal option.
type ProposalStatus ¶
type ProposalStatus string
ProposalStatus represents the status of the proposal
const ( ProposalStatusAll ProposalStatus = "" ProposalStatusPending ProposalStatus = "pending" ProposalStatusApproved ProposalStatus = "approved" ProposalStatusRejected ProposalStatus = "rejected" )
type ProposalType ¶
type ProposalType string
ProposalType represents the type of the proposal
const ( ProposalTypeAll ProposalType = "" ProposalTypeAddAccount ProposalType = "add-account" ProposalTypeAddValidator ProposalType = "add-validator" )
type Reviewal ¶
type Reviewal func(*reviewal)
Reviewal configures reviewal to create a review for a proposal.
func ApproveProposal ¶
ApproveProposal returns approval for a proposal with id.
func RejectProposal ¶
RejectProposal returns rejection for a proposals with id.