Documentation ¶
Index ¶
- Constants
- Variables
- func CreateParser(genesisBytes []byte) (chain.Parser, error)
- func New(options ...vm.Option) (*vm.VM, error)
- func NewParser(genesis *genesis.Genesis) chain.Parser
- func NewWithOptions(options ...vm.Option) (*vm.VM, error)
- func With() vm.Option
- func WithEmissionBalancer() vm.Option
- func WithRuntime() vm.Option
- type AssetArgs
- type AssetReply
- type BalanceArgs
- type BalanceReply
- type Config
- type DatasetArgs
- type DatasetContributionArgs
- type DatasetContributionReply
- type DatasetReply
- type EmissionAccount
- type EmissionReply
- type GenesisReply
- type JSONRPCClient
- func (cli *JSONRPCClient) AllValidators(ctx context.Context) ([]*emission.Validator, error)
- func (cli *JSONRPCClient) Asset(ctx context.Context, asset string, useCache bool) (string, string, string, uint8, string, string, uint64, uint64, string, string, ...)
- func (cli *JSONRPCClient) Balance(ctx context.Context, addr string, asset string) (uint64, error)
- func (cli *JSONRPCClient) Dataset(ctx context.Context, dataset string, useCache bool) (string, string, string, string, string, string, string, bool, string, string, ...)
- func (cli *JSONRPCClient) DatasetContribution(ctx context.Context, contributionID string) (string, string, string, string, bool, error)
- func (cli *JSONRPCClient) EmissionInfo(ctx context.Context) (uint64, uint64, uint64, uint64, uint64, EmissionAccount, emission.EpochTracker, ...)
- func (cli *JSONRPCClient) Genesis(ctx context.Context) (*genesis.Genesis, error)
- func (cli *JSONRPCClient) Parser(ctx context.Context) (chain.Parser, error)
- func (cli *JSONRPCClient) Simulate(ctx context.Context, callTx actions.ContractCall, actor codec.Address) (state.Keys, uint64, error)
- func (cli *JSONRPCClient) StakedValidators(ctx context.Context) ([]*emission.Validator, error)
- func (cli *JSONRPCClient) UserStake(ctx context.Context, owner string, nodeID string) (uint64, uint64, uint64, string, string, error)
- func (cli *JSONRPCClient) ValidatorStake(ctx context.Context, nodeID ids.NodeID) (uint64, uint64, uint64, uint64, string, string, error)
- func (cli *JSONRPCClient) WaitForBalance(ctx context.Context, addr string, asset string, min uint64) error
- type JSONRPCServer
- func (j *JSONRPCServer) AllValidators(req *http.Request, _ *struct{}, reply *ValidatorsReply) (err error)
- func (j *JSONRPCServer) Asset(req *http.Request, args *AssetArgs, reply *AssetReply) error
- func (j *JSONRPCServer) Balance(req *http.Request, args *BalanceArgs, reply *BalanceReply) error
- func (j *JSONRPCServer) Dataset(req *http.Request, args *DatasetArgs, reply *DatasetReply) error
- func (j *JSONRPCServer) DatasetContribution(req *http.Request, args *DatasetContributionArgs, ...) (err error)
- func (j *JSONRPCServer) EmissionInfo(req *http.Request, _ *struct{}, reply *EmissionReply) (err error)
- func (j *JSONRPCServer) Genesis(_ *http.Request, _ *struct{}, reply *GenesisReply) (err error)
- func (j *JSONRPCServer) SimulateCallContractTx(req *http.Request, args *SimulateCallTxArgs, reply *SimulateCallTxReply) (err error)
- func (j *JSONRPCServer) StakedValidators(req *http.Request, _ *struct{}, reply *ValidatorsReply) (err error)
- func (j *JSONRPCServer) UserStake(req *http.Request, args *UserStakeArgs, reply *UserStakeReply) (err error)
- func (j *JSONRPCServer) ValidatorStake(req *http.Request, args *ValidatorStakeArgs, reply *ValidatorStakeReply) (err error)
- type Parser
- type SimulateCallTxArgs
- type SimulateCallTxReply
- type SimulateStateKey
- type UserStakeArgs
- type UserStakeReply
- type ValidatorStakeArgs
- type ValidatorStakeReply
- type ValidatorsReply
Constants ¶
View Source
const JSONRPCEndpoint = "/nuklaiapi"
View Source
const Namespace = "controller"
Variables ¶
View Source
var ( ErrValidatorStakeNotFound = errors.New("validator stake not found") ErrDelegatorStakeNotFound = errors.New("delegator stake not found") )
View Source
var ( ActionParser *codec.TypeParser[chain.Action] AuthParser *codec.TypeParser[chain.Auth] OutputParser *codec.TypeParser[codec.Typed] )
Functions ¶
func CreateParser ¶
Used as a lambda function for creating ExternalSubscriberServer parser
func NewWithOptions ¶
NewWithOptions returns a VM with the specified options
func WithEmissionBalancer ¶
func WithRuntime ¶
Types ¶
type AssetReply ¶
type AssetReply struct { AssetType string `json:"assetType"` Name string `json:"name"` Symbol string `json:"symbol"` Decimals uint8 `json:"decimals"` Metadata string `json:"metadata"` URI string `json:"uri"` TotalSupply uint64 `json:"totalSupply"` MaxSupply uint64 `json:"maxSupply"` Owner string `json:"owner"` MintAdmin string `json:"mintAdmin"` PauseUnpauseAdmin string `json:"pauseUnpauseAdmin"` FreezeUnfreezeAdmin string `json:"freezeUnfreezeAdmin"` EnableDisableKYCAccountAdmin string `json:"enableDisableKYCAccountAdmin"` }
type BalanceArgs ¶
type BalanceReply ¶
type BalanceReply struct {
Amount uint64 `json:"amount"`
}
type Config ¶
type Config struct {
Enabled bool `json:"enabled"`
}
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type DatasetArgs ¶
type DatasetArgs struct {
Dataset string `json:"dataset"`
}
type DatasetContributionArgs ¶
type DatasetContributionArgs struct {
ContributionID string `json:"contributionID"`
}
type DatasetReply ¶
type DatasetReply struct { Name string `json:"name"` Description string `json:"description"` Categories string `json:"categories"` LicenseName string `json:"licenseName"` LicenseSymbol string `json:"licenseSymbol"` LicenseURL string `json:"licenseURL"` Metadata string `json:"metadata"` IsCommunityDataset bool `json:"isCommunityDataset"` MarketplaceAssetAddress string `json:"marketplaceAssetAddress"` BaseAssetAddress string `json:"baseAssetAddress"` BasePrice uint64 `json:"basePrice"` RevenueModelDataOwnerCut uint8 `json:"revenueModelDataOwnerCut"` RevenueModelMetadataOwnerCut uint8 `json:"revenueModelMetadataOwnerCut"` Owner string `json:"owner"` }
type EmissionAccount ¶
type EmissionReply ¶
type EmissionReply struct { CurrentBlockHeight uint64 `json:"currentBlockHeight"` TotalSupply uint64 `json:"totalSupply"` MaxSupply uint64 `json:"maxSupply"` TotalStaked uint64 `json:"totalStaked"` RewardsPerEpoch uint64 `json:"rewardsPerEpoch"` EmissionAccount EmissionAccount `json:"emissionAccount"` EpochTracker emission.EpochTracker `json:"epochTracker"` }
type GenesisReply ¶
type JSONRPCClient ¶
type JSONRPCClient struct {
// contains filtered or unexported fields
}
func NewJSONRPCClient ¶
func NewJSONRPCClient(uri string) *JSONRPCClient
NewJSONRPCClient creates a new client object.
func (*JSONRPCClient) AllValidators ¶
func (*JSONRPCClient) DatasetContribution ¶
func (*JSONRPCClient) EmissionInfo ¶
func (cli *JSONRPCClient) EmissionInfo(ctx context.Context) (uint64, uint64, uint64, uint64, uint64, EmissionAccount, emission.EpochTracker, error)
func (*JSONRPCClient) StakedValidators ¶
func (*JSONRPCClient) ValidatorStake ¶
func (*JSONRPCClient) WaitForBalance ¶
type JSONRPCServer ¶
type JSONRPCServer struct {
// contains filtered or unexported fields
}
func NewJSONRPCServer ¶
func NewJSONRPCServer(vm api.VM) *JSONRPCServer
func (*JSONRPCServer) AllValidators ¶
func (j *JSONRPCServer) AllValidators(req *http.Request, _ *struct{}, reply *ValidatorsReply) (err error)
func (*JSONRPCServer) Asset ¶
func (j *JSONRPCServer) Asset(req *http.Request, args *AssetArgs, reply *AssetReply) error
func (*JSONRPCServer) Balance ¶
func (j *JSONRPCServer) Balance(req *http.Request, args *BalanceArgs, reply *BalanceReply) error
func (*JSONRPCServer) Dataset ¶
func (j *JSONRPCServer) Dataset(req *http.Request, args *DatasetArgs, reply *DatasetReply) error
func (*JSONRPCServer) DatasetContribution ¶
func (j *JSONRPCServer) DatasetContribution(req *http.Request, args *DatasetContributionArgs, reply *DatasetContributionReply) (err error)
func (*JSONRPCServer) EmissionInfo ¶
func (j *JSONRPCServer) EmissionInfo(req *http.Request, _ *struct{}, reply *EmissionReply) (err error)
func (*JSONRPCServer) Genesis ¶
func (j *JSONRPCServer) Genesis(_ *http.Request, _ *struct{}, reply *GenesisReply) (err error)
func (*JSONRPCServer) SimulateCallContractTx ¶
func (j *JSONRPCServer) SimulateCallContractTx(req *http.Request, args *SimulateCallTxArgs, reply *SimulateCallTxReply) (err error)
func (*JSONRPCServer) StakedValidators ¶
func (j *JSONRPCServer) StakedValidators(req *http.Request, _ *struct{}, reply *ValidatorsReply) (err error)
func (*JSONRPCServer) UserStake ¶
func (j *JSONRPCServer) UserStake(req *http.Request, args *UserStakeArgs, reply *UserStakeReply) (err error)
func (*JSONRPCServer) ValidatorStake ¶
func (j *JSONRPCServer) ValidatorStake(req *http.Request, args *ValidatorStakeArgs, reply *ValidatorStakeReply) (err error)
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ActionRegistry ¶
func (*Parser) ActionRegistry() chain.ActionRegistry
func (*Parser) AuthRegistry ¶
func (*Parser) AuthRegistry() chain.AuthRegistry
func (*Parser) OutputRegistry ¶
func (*Parser) OutputRegistry() chain.OutputRegistry
func (*Parser) StateManager ¶
func (*Parser) StateManager() chain.StateManager
type SimulateCallTxArgs ¶
type SimulateCallTxArgs struct { CallTx actions.ContractCall `json:"callTx"` Actor codec.Address `json:"actor"` }
type SimulateCallTxReply ¶
type SimulateCallTxReply struct { StateKeys []SimulateStateKey `json:"stateKeys"` FuelConsumed uint64 `json:"fuel"` }
type SimulateStateKey ¶
type UserStakeArgs ¶
type UserStakeReply ¶
type UserStakeReply struct { StakeStartBlock uint64 `json:"stakeStartBlock"` // Start block of the stake StakeEndBlock uint64 `json:"stakeEndBlock"` // End block of the stake StakedAmount uint64 `json:"stakedAmount"` // Amount of NAI staked RewardAddress string `json:"rewardAddress"` // Address to receive rewards OwnerAddress string `json:"ownerAddress"` // Address of the owner who delegated }
type ValidatorStakeArgs ¶
type ValidatorStakeReply ¶
type ValidatorStakeReply struct { StakeStartBlock uint64 `json:"stakeStartBlock"` // Start block of the stake StakeEndBlock uint64 `json:"stakeEndBlock"` // End block of the stake StakedAmount uint64 `json:"stakedAmount"` // Amount of NAI staked DelegationFeeRate uint64 `json:"delegationFeeRate"` // Delegation fee rate RewardAddress string `json:"rewardAddress"` // Address to receive rewards OwnerAddress string `json:"ownerAddress"` // Address of the owner who registered the validator }
type ValidatorsReply ¶
Click to show internal directories.
Click to hide internal directories.