hmyapi

package
v1.3.12 Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: MIT Imports: 20 Imported by: 0

README

JSON RPC

JSSDK

FireStack-Lab/Harmony-sdk-core

JSON-RPC methods

  • net_listening - check if network is connected
  • hmy_protocolVersion - check protocol version
  • net_version - get network id
  • net_peerCount - peer count
  • hmy_getNodeMetadata - get node's version, bls key
  • hmy_gasPrice - return min-gas-price
  • hmy_estimateGas - calculating estimate gas using signed bytes
  • hmy_blockNumber - get latest block number
  • hmy_getBlockByHash - get block by block hash
  • hmy_getBlockByNumber
  • hmy_getUncleByBlockHashAndIndex - get uncle by block hash and index number
  • hmy_getUncleByBlockNumberAndIndex - get uncle by block number and index number
  • hmy_getUncleCountByBlockHash - get uncle count by block hash
  • hmy_getUncleCountByBlockNumber - get uncle count by block number
  • hmy_syncing - Returns an object with data about the sync status
  • hmy_coinbase - return coinbase address
  • hmy_mining - return if mining client is mining
  • hmy_hashrate - return current hash rate for blockchain
  • hmy_getBalance - get balance for account address
  • hmy_getAccountNonce - get nonce for account address
  • hmy_accounts - return accounts that lives in node
  • hmy_getTransactionReceipt - get transaction receipt by given transaction hash
  • hmy_sendRawTransaction - send transaction bytes(signed) to blockchain
  • hmy_sendTransaction - send transaction object(with signature) to blockchain
  • hmy_getBlockTransactionCountByHash - get transaction count of block by block hash
  • hmy_getBlockTransactionCountByNumber - get transaction count of block by block number
  • hmy_getTransactionByHash - get transaction object of block by block hash
  • hmy_getTransactionByBlockHashAndIndex - get transaction object of block by block hash and index number
  • hmy_getTransactionByBlockNumberAndIndex - get transaction object of block by block number and index number
  • hmy_sign - sign message using node specific sign method.
  • hmy_pendingTransactions - returns the pending transactions list.
  • hmy_getTransactionsCount - returns the number of confirmed (not pending) transactions count for the account
  • hmy_getStakingTransactionsCount - returns the number of confirmed (not pending) staking transactions count for the account
  • hmy_call - call contract method
  • hmy_getCode - get deployed contract's byte code
  • hmy_getStorageAt - get storage position at a given address
  • [ ] hmy_getCompilers - DEPRECATED
  • [ ] hmy_compileLLL - DEPRECATED
  • [ ] hmy_compileSolidity - DEPRECATED
  • [ ] hmy_compileSerpent - DEPRECATED
Subscribes
  • hmy_getLogs - log subscriber
  • hmy_newFilter - creates a filter object, based on filter options
  • hmy_newBlockFilter - creates a filter in the node, to notify when a new block arrives
  • hmy_newPendingTransactionFilter - creates a filter in the node, to notify when new pending transactions arrive
  • hmy_getFilterChanges - polling method for a filter
  • hmy_getFilterLogs - returns an array of all logs matching filter with given id.
  • hmy_uninstallFilter - uninstalls a filter with given id
Others, not very important for current stage of work
  • web3_clientVersion
  • web3_sha3
  • hmy_getWork
  • hmy_submitWork
  • hmy_submitHashrate
  • hmy_getProof
  • db_putString
  • db_getString
  • db_putHex
  • db_getHex
SHH Whisper Protocol

The shh is for the whisper protocol to communicate p2p and broadcast

  • shh_post
  • shh_version
  • shh_newIdentity
  • shh_hasIdentity
  • shh_newGroup
  • shh_addToGroup
  • shh_newFilter
  • shh_uninstallFilter
  • shh_getFilterChanges
  • shh_getMessages
API Versions
  • For API V1 you specify 1.0 version in curl
  • For API V2 you specify 2.0 version in curl, V2 has output numbers were changed to decimals and also fixed few errors

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIs

func GetAPIs(b Backend) []rpc.API

GetAPIs returns all the APIs.

Types

type Backend

type Backend interface {
	NetVersion() uint64
	ProtocolVersion() int
	ChainDb() ethdb.Database
	SingleFlightRequest(key string, fn func() (interface{}, error)) (interface{}, error)
	SingleFlightForgetKey(key string)
	EventMux() *event.TypeMux
	RPCGasCap() *big.Int // global gas cap for hmy_call over rpc: DoS protection
	HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*block.Header, error)
	BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)
	StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.DB, *block.Header, error)
	GetBlock(ctx context.Context, blockHash common.Hash) (*types.Block, error)
	GetReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error)
	GetEVM(ctx context.Context, msg core.Message, state *state.DB, header *block.Header) (*vm.EVM, func() error, error)
	SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
	SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
	SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription
	// TxPool API
	SendTx(ctx context.Context, signedTx *types.Transaction) error
	GetPoolTransactions() (types.PoolTransactions, error)
	GetPoolTransaction(txHash common.Hash) types.PoolTransaction
	GetPoolStats() (pendingCount, queuedCount int)
	GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)
	GetAccountNonce(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (uint64, error)
	SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription
	ChainConfig() *params.ChainConfig
	CurrentBlock() *types.Block
	GetBalance(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (*big.Int, error)
	GetValidators(epoch *big.Int) (*shard.Committee, error)
	GetShardID() uint32
	GetTransactionsHistory(address, txType, order string) ([]common.Hash, error)
	GetStakingTransactionsHistory(address, txType, order string) ([]common.Hash, error)
	GetTransactionsCount(address, txType string) (uint64, error)
	GetStakingTransactionsCount(address, txType string) (uint64, error)
	ResendCx(ctx context.Context, txID common.Hash) (uint64, bool)
	IsLeader() bool
	SendStakingTx(ctx context.Context, newStakingTx *staking.StakingTransaction) error
	GetElectedValidatorAddresses() []common.Address
	GetAllValidatorAddresses() []common.Address
	GetValidatorInformation(addr common.Address, block *types.Block) (*staking.ValidatorRPCEnchanced, error)
	GetDelegationsByValidator(validator common.Address) []*staking.Delegation
	GetDelegationsByDelegator(delegator common.Address) ([]common.Address, []*staking.Delegation)
	GetDelegationsByDelegatorByBlock(delegator common.Address, block *types.Block) ([]common.Address, []*staking.Delegation)
	GetValidatorSelfDelegation(addr common.Address) *big.Int
	GetShardState() (*shard.State, error)
	GetCurrentStakingErrorSink() types.TransactionErrorReports
	GetCurrentTransactionErrorSink() types.TransactionErrorReports
	GetMedianRawStakeSnapshot() (*committee.CompletedEPoSRound, error)
	GetPendingCXReceipts() []*types.CXReceiptsProof
	GetCurrentUtilityMetrics() (*network.UtilityMetric, error)
	GetSuperCommittees() (*quorum.Transition, error)
	GetTotalStakingSnapshot() *big.Int
	GetCurrentBadBlocks() []core.BadBlock
	GetLastCrossLinks() ([]*types.CrossLink, error)
	GetLatestChainHeaders() *block.HeaderPair
	GetNodeMetadata() commonRPC.NodeMetadata
}

Backend ..

Directories

Path Synopsis
Package filters implements an ethereum filtering system for block, transactions and log events.
Package filters implements an ethereum filtering system for block, transactions and log events.

Jump to

Keyboard shortcuts

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