blockchain

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: GPL-3.0 Imports: 32 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHTTPStatusCodeIsNotOK = errors.New("HTTP status code is not OK")

ErrHTTPStatusCodeIsNotOK signals that the returned HTTP status code is not OK

View Source
var ErrInvalidAddress = errors.New("invalid address")

ErrInvalidAddress signals that the provided address is invalid

View Source
var ErrInvalidAllowedDeltaToFinal = errors.New("invalid allowed delta to final value")

ErrInvalidAllowedDeltaToFinal signals that an invalid allowed delta to final value has been provided

View Source
var ErrInvalidCacherDuration = errors.New("invalid caching duration")

ErrInvalidCacherDuration signals that the provided caching duration is invalid

View Source
var ErrInvalidEndpointProvider = errors.New("invalid endpoint provider")

ErrInvalidEndpointProvider signals that an invalid endpoint provider was provided

View Source
var ErrNilAddress = errors.New("nil address")

ErrNilAddress signals that the provided address is nil

View Source
var ErrNilEndpointProvider = errors.New("nil endpoint provider")

ErrNilEndpointProvider signals that a nil endpoint provider was provided

View Source
var ErrNilHTTPClientWrapper = errors.New("nil HTTP client wrapper")

ErrNilHTTPClientWrapper signals that a nil HTTP client wrapper was provided

View Source
var ErrNilNetworkConfigs = errors.New("nil network configs")

ErrNilNetworkConfigs signals that the provided network configs is nil

View Source
var ErrNilNetworkStatus = errors.New("nil network status")

ErrNilNetworkStatus signals that nil network status was received

View Source
var ErrNilProxy = errors.New("nil proxy")

ErrNilProxy signals that a nil proxy has been provided

View Source
var ErrNilRequest = errors.New("nil request")

ErrNilRequest signals that a nil request was provided

View Source
var ErrNilShardCoordinator = errors.New("nil shard coordinator")

ErrNilShardCoordinator signals that the provided shard coordinator is nil

View Source
var ErrNotUint64Bytes = errors.New("provided bytes do not represent a valid uint64 number")

/ ErrNotUint64Bytes signals that the provided bytes do not represent a valid uint64 number

View Source
var ErrShardIDMismatch = errors.New("shard ID mismatch")

ErrShardIDMismatch signals that a shard ID mismatch has occurred

Functions

func NewAddressGenerator

func NewAddressGenerator(coordinator *shardCoordinator) (*addressGenerator, error)

NewAddressGenerator will create an address generator instance

func NewProxy

func NewProxy(args ArgsProxy) (*proxy, error)

NewProxy initializes and returns a proxy object

func NewQueryResponseError added in v1.3.4

func NewQueryResponseError(code string, message string, function string, address string, arguments ...string) *queryResponseError

NewQueryResponseError creates a new instance of queryResponseError

func NewShardCoordinator

func NewShardCoordinator(numOfShardsWithoutMeta uint32, currentShard uint32) (*shardCoordinator, error)

NewShardCoordinator returns a shard coordinator instance that is able to execute sharding-related operations

func NewVmQueryGetter added in v1.3.4

func NewVmQueryGetter(args ArgsVmQueryGetter) (*vmQueryGetter, error)

NewVmQueryGetter creates a new instance of the vmQueryGetter type

Types

type ArgsProxy

type ArgsProxy struct {
	ProxyURL            string
	Client              sdkHttp.Client
	SameScState         bool
	ShouldBeSynced      bool
	FinalityCheck       bool
	AllowedDeltaToFinal int
	CacheExpirationTime time.Duration
	EntityType          sdkCore.RestAPIEntityType
}

ArgsProxy is the DTO used in the multiversx proxy constructor

type ArgsVmQueryGetter added in v1.3.4

type ArgsVmQueryGetter struct {
	Proxy Proxy
	Log   logger.Logger
}

ArgsVmQueryGetter is the arguments DTO used in the NewvmQueryGetter constructor

type EndpointProvider

type EndpointProvider interface {
	GetNetworkConfig() string
	GetNetworkEconomics() string
	GetRatingsConfig() string
	GetEnableEpochsConfig() string
	GetAccount(addressAsBech32 string) string
	GetCostTransaction() string
	GetSendTransaction() string
	GetSendMultipleTransactions() string
	GetTransactionStatus(hexHash string) string
	GetTransactionInfo(hexHash string) string
	GetHyperBlockByNonce(nonce uint64) string
	GetHyperBlockByHash(hexHash string) string
	GetVmValues() string
	GetGenesisNodesConfig() string
	GetRawStartOfEpochMetaBlock(epoch uint32) string
	GetNodeStatus(shardID uint32) string
	ShouldCheckShardIDForNodeStatus() bool
	GetRawBlockByHash(shardID uint32, hexHash string) string
	GetRawBlockByNonce(shardID uint32, nonce uint64) string
	GetRawMiniBlockByHash(shardID uint32, hexHash string, epoch uint32) string
	GetGuardianData(address string) string
	GetRestAPIEntityType() core.RestAPIEntityType
	GetValidatorsInfo(epoch uint32) string
	GetProcessedTransactionStatus(hexHash string) string
	GetESDTTokenData(addressAsBech32 string, tokenIdentifier string) string
	GetNFTTokenData(addressAsBech32 string, tokenIdentifier string, nonce uint64) string
	IsDataTrieMigrated(addressAsBech32 string) string
	IsInterfaceNil() bool
}

EndpointProvider is able to return endpoint routes strings

type FinalityProvider

type FinalityProvider interface {
	CheckShardFinalization(ctx context.Context, targetShardID uint32, maxNoncesDelta uint64) error
	IsInterfaceNil() bool
}

FinalityProvider is able to check the shard finalization status

type Proxy

type Proxy interface {
	GetNetworkConfig(ctx context.Context) (*data.NetworkConfig, error)
	GetAccount(ctx context.Context, address core.AddressHandler) (*data.Account, error)
	SendTransaction(ctx context.Context, tx *transaction.FrontendTransaction) (string, error)
	SendTransactions(ctx context.Context, txs []*transaction.FrontendTransaction) ([]string, error)
	GetGuardianData(ctx context.Context, address core.AddressHandler) (*api.GuardianData, error)
	ExecuteVMQuery(ctx context.Context, vmRequest *data.VmValueRequest) (*data.VmValuesResponseData, error)
	IsInterfaceNil() bool
}

Proxy holds the primitive functions that the multiversx proxy engine supports & implements

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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