Documentation ¶
Overview ¶
Package rpc implements an RPC client that connect to a centralized mock store. Centralazied mock store can be any other mock store implementation that is registered to AICHAIN RPC server under mockStore name. Methods that defines mock.GlobalStore are the same that are used by RPC. Example:
server := rpc.NewServer() server.RegisterName("mockStore", mem.NewGlobalStore())
Index ¶
- type GlobalStore
- func (s *GlobalStore) Close() error
- func (s *GlobalStore) Get(addr common.Address, key []byte) (data []byte, err error)
- func (s *GlobalStore) HasKey(addr common.Address, key []byte) bool
- func (s *GlobalStore) NewNodeStore(addr common.Address) *mock.NodeStore
- func (s *GlobalStore) Put(addr common.Address, key []byte, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalStore ¶
type GlobalStore struct {
// contains filtered or unexported fields
}
GlobalStore is rpc.Client that connects to a centralized mock store. Closing GlobalStore instance is required to release RPC client resources.
func NewGlobalStore ¶
func NewGlobalStore(client *rpc.Client) *GlobalStore
NewGlobalStore creates a new instance of GlobalStore.
func (*GlobalStore) HasKey ¶
func (s *GlobalStore) HasKey(addr common.Address, key []byte) bool
HasKey calls a HasKey method to RPC server.
func (*GlobalStore) NewNodeStore ¶
func (s *GlobalStore) NewNodeStore(addr common.Address) *mock.NodeStore
NewNodeStore returns a new instance of NodeStore that retrieves and stores chunk data only for a node with address addr.