Documentation ¶
Index ¶
- type ContractStorageSeeker
- type Ledger
- type OracleHandler
- type Server
- func (s *Server) Addresses() []string
- func (s *Server) Name() string
- func (s *Server) RegisterLocal(ctx context.Context, events chan<- neorpc.Notification) func(*neorpc.Request) (*neorpc.Response, error)
- func (s *Server) SetOracleHandler(orc OracleHandler)
- func (s *Server) Shutdown()
- func (s *Server) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractStorageSeeker ¶ added in v0.102.0
type ContractStorageSeeker interface {
SeekStorage(id int32, prefix []byte, cont func(k, v []byte) bool)
}
ContractStorageSeeker is the interface `findstorage*` handlers need to be able to seek over contract storage.
type Ledger ¶
type Ledger interface { AddBlock(block *block.Block) error BlockHeight() uint32 CalculateClaimable(h util.Uint160, endHeight uint32) (*big.Int, error) CurrentBlockHash() util.Uint256 FeePerByte() int64 ForEachNEP11Transfer(acc util.Uint160, newestTimestamp uint64, f func(*state.NEP11Transfer) (bool, error)) error ForEachNEP17Transfer(acc util.Uint160, newestTimestamp uint64, f func(*state.NEP17Transfer) (bool, error)) error GetAppExecResults(util.Uint256, trigger.Type) ([]state.AppExecResult, error) GetBaseExecFee() int64 GetBlock(hash util.Uint256) (*block.Block, error) GetCommittee() (keys.PublicKeys, error) GetConfig() config.Blockchain GetContractScriptHash(id int32) (util.Uint160, error) GetContractState(hash util.Uint160) *state.Contract GetEnrollments() ([]state.Validator, error) GetGoverningTokenBalance(acc util.Uint160) (*big.Int, uint32) GetHeader(hash util.Uint256) (*block.Header, error) GetHeaderHash(uint32) util.Uint256 GetMaxVerificationGAS() int64 GetMemPool() *mempool.Pool GetNEP11Contracts() []util.Uint160 GetNEP17Contracts() []util.Uint160 GetNativeContractScriptHash(string) (util.Uint160, error) GetNatives() []state.NativeContract GetNextBlockValidators() ([]*keys.PublicKey, error) GetNotaryContractScriptHash() util.Uint160 GetNotaryServiceFeePerKey() int64 GetStateModule() core.StateRoot GetStorageItem(id int32, key []byte) state.StorageItem GetTestHistoricVM(t trigger.Type, tx *transaction.Transaction, nextBlockHeight uint32) (*interop.Context, error) GetTestVM(t trigger.Type, tx *transaction.Transaction, b *block.Block) (*interop.Context, error) GetTokenLastUpdated(acc util.Uint160) (map[int32]uint32, error) GetTransaction(util.Uint256) (*transaction.Transaction, uint32, error) HeaderHeight() uint32 InitVerificationContext(ic *interop.Context, hash util.Uint160, witness *transaction.Witness) error P2PSigExtensionsEnabled() bool SubscribeForBlocks(ch chan *block.Block) SubscribeForExecutions(ch chan *state.AppExecResult) SubscribeForNotifications(ch chan *state.ContainedNotificationEvent) SubscribeForTransactions(ch chan *transaction.Transaction) UnsubscribeFromBlocks(ch chan *block.Block) UnsubscribeFromExecutions(ch chan *state.AppExecResult) UnsubscribeFromNotifications(ch chan *state.ContainedNotificationEvent) UnsubscribeFromTransactions(ch chan *transaction.Transaction) VerifyTx(*transaction.Transaction) error VerifyWitness(util.Uint160, hash.Hashable, *transaction.Witness, int64) (int64, error) mempool.Feer // fee interface ContractStorageSeeker }
Ledger abstracts away the Blockchain as used by the RPC server.
type OracleHandler ¶ added in v0.99.2
OracleHandler is the interface oracle service needs to provide for the Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the JSON-RPC 2.0 server.
func New ¶
func New(chain Ledger, conf config.RPC, coreServer *network.Server, orc OracleHandler, log *zap.Logger, errChan chan<- error) Server
New creates a new Server struct. Pay attention that orc is expected to be either untyped nil or non-nil structure implementing OracleHandler interface.
func (*Server) Addresses ¶ added in v0.100.0
Addresses returns the list of addresses RPC server is listening to in the form of address:port.
func (*Server) RegisterLocal ¶ added in v0.101.1
func (s *Server) RegisterLocal(ctx context.Context, events chan<- neorpc.Notification) func(*neorpc.Request) (*neorpc.Response, error)
RegisterLocal performs local client registration.
func (*Server) SetOracleHandler ¶ added in v0.99.2
func (s *Server) SetOracleHandler(orc OracleHandler)
SetOracleHandler allows to update oracle handler used by the Server.