volunteer

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 14 Imported by: 0

README

Volunteer module

Usage

(Tx) Register volunteer validator
// Register volunteer validator using json file
registerVolunteerValidatorMsg := types.RegisterVolunteerValidatorMsg{	
    ValPubKey: `{"@type": "/cosmos.crypto.ed25519.PubKey","key": "2z2yttKfEsLQyQnHYdgKEuky9zB3gscxapn9IyexxWk="}`,
    Amount: "100000axpla",
    Moniker: "moniker",
    Identity: "identity",
    Website: "website",
    Security: "contact point",
    Details: "details",
    JsonFilePath: "/JSON/FILE/PATH/FOR/PROPOSAL/TO/REGISTER"
}

// Register volunteer validator using string values
registerVolunteerValidatorMsg := types.RegisterVolunteerValidatorMsg{
    Title: "Register volunteer validator",
    Description: "description",
    Deposit: "1000000axpla",
    ValPubKey: `{"@type": "/cosmos.crypto.ed25519.PubKey","key": "2z2yttKfEsLQyQnHYdgKEuky9zB3gscxapn9IyexxWk="}`,
    Amount: "100000axpla",
    Moniker: "moniker",
    Identity: "identity",
    Website: "website",
    Security: "contact point",
    Details: "details",
}

txbytes, err := xplac.RegisterVolunteerValidator(registerVolunteerValidatorMsg).CreateAndSignTx()
(Tx) Unregister volunteer validator
// Unregister volunteer validator using json file
unregisterVolunteerValidatorMsg := types.UnregisterVolunteerValidatorMsg{	
    JsonFilePath: "/JSON/FILE/PATH/FOR/PROPOSAL/TO/UNREGISTER"
}

// Unegister volunteer validator using string values
unregisterVolunteerValidatorMsg := types.UnregisterVolunteerValidatorMsg{
    Title: "Unregister volunteer validator",
    Description: "description",
    Deposit: "1000000",
    ValAddress: "xplavaloper1hggt7sgsegcg3daz0rpa9m8mkmx3qyarse9utx",
}

txbytes, err := xplac.UnregisterVolunteerValidator(unregisterVolunteerValidatorMsg).CreateAndSignTx()
(Query) Volunter validators
// Query volunteer validators
res, err := xplac.QueryVolunteerValidators().Query()

Documentation

Index

Constants

View Source
const (
	VolunteerModule                              = "volunteer"
	VolunteerRegisterVolunteerValidatorMsgType   = "register-volunteer-validator"
	VolunteerUnregisterVolunteerValidatorMsgType = "unregister-volunteer-validator"
	VolunteerQueryValidatorsMsgType              = "query-validators"
)

Variables

This section is empty.

Functions

func MakeQueryVolunteerValidatorsMsg

func MakeQueryVolunteerValidatorsMsg() (volunteertypes.QueryVolunteerValidatorsRequest, error)

(Query) make msg - query volunteer validators

func MakeRegisterVolunteerValidatorMsg

func MakeRegisterVolunteerValidatorMsg(registerVolunteerValidatorMsg types.RegisterVolunteerValidatorMsg, encodingConfig paramsapp.EncodingConfig, from sdk.AccAddress) (govtypes.MsgSubmitProposal, error)

(Tx) make msg - register volunteer validator

func MakeUnregisterVolunteerValidatorMsg

func MakeUnregisterVolunteerValidatorMsg(unregisterVolunteerValidatorMsg types.UnregisterVolunteerValidatorMsg, encodingConfig paramsapp.EncodingConfig, from sdk.AccAddress) (govtypes.MsgSubmitProposal, error)

(Tx) make msg - unregister volunteer validator

func NewCoreModule

func NewCoreModule() core.CoreModule

func QueryVolunteer

func QueryVolunteer(i core.QueryClient) (string, error)

Query client for volunteer module.

Types

type VolunteerExternal

type VolunteerExternal struct {
	Xplac provider.XplaClient
}

func NewVolunteerExternal

func NewVolunteerExternal(xplac provider.XplaClient) (e VolunteerExternal)

func (VolunteerExternal) QueryVolunteerValidators

func (e VolunteerExternal) QueryVolunteerValidators() provider.XplaClient

Query volunteer validators.

func (VolunteerExternal) RegisterVolunteerValidator

func (e VolunteerExternal) RegisterVolunteerValidator(registerVolunteerValidatorMsg types.RegisterVolunteerValidatorMsg) provider.XplaClient

Register new volunteer validator.

func (VolunteerExternal) UnregisterVolunteerValidator

func (e VolunteerExternal) UnregisterVolunteerValidator(unregisterVolunteerValidatorMsg types.UnregisterVolunteerValidatorMsg) provider.XplaClient

Unregister a volunteer validator.

Jump to

Keyboard shortcuts

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