Documentation ¶
Index ¶
- Variables
- func Topic(topic string) common.Hash
- type DynamicGroupManager
- func (gm *DynamicGroupManager) IdentityCredentials() (rln.IdentityCredential, error)
- func (gm *DynamicGroupManager) InsertMembers(toInsert *om.OrderedMap) error
- func (gm *DynamicGroupManager) IsReady(ctx context.Context) (bool, error)
- func (gm *DynamicGroupManager) MembershipIndex() rln.MembershipIndex
- func (gm *DynamicGroupManager) RemoveMembers(toRemove *om.OrderedMap) error
- func (gm *DynamicGroupManager) SetMetadata(meta RLNMetadata) error
- func (gm *DynamicGroupManager) Start(ctx context.Context) error
- func (gm *DynamicGroupManager) Stop() error
- type ErrCount
- type MembershipFetcher
- type Metrics
- type MockBlock
- type MockBlockChain
- type MockClient
- func (c *MockClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (c *MockClient) Close()
- func (c *MockClient) FilterLogs(ctx context.Context, query ethereum.FilterQuery) (allTxLogs []types.Log, err error)
- func (c *MockClient) SetErrorOnBlock(blockNum int64, err error, count int)
- func (c *MockClient) SetLatestBlockNumber(num int64)
- func (c *MockClient) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
- type MockEvent
- type RLNMetadata
- type RegistrationEventHandler
- type RegistrationHandler
Constants ¶
This section is empty.
Variables ¶
var RLNAppInfo = keystore.AppInfo{
Application: "waku-rln-relay",
AppIdentifier: "01234567890abcdef",
Version: "0.2",
}
Functions ¶
Types ¶
type DynamicGroupManager ¶
type DynamicGroupManager struct { MembershipFetcher // contains filtered or unexported fields }
func NewDynamicGroupManager ¶
func NewDynamicGroupManager( ethClientAddr string, memContractAddr common.Address, membershipIndexToLoad *uint, appKeystore *keystore.AppKeystore, keystorePassword string, reg prometheus.Registerer, rlnInstance *rln.RLN, rootTracker *group_manager.MerkleRootTracker, log *zap.Logger, ) (*DynamicGroupManager, error)
func (*DynamicGroupManager) IdentityCredentials ¶
func (gm *DynamicGroupManager) IdentityCredentials() (rln.IdentityCredential, error)
func (*DynamicGroupManager) InsertMembers ¶
func (gm *DynamicGroupManager) InsertMembers(toInsert *om.OrderedMap) error
func (*DynamicGroupManager) IsReady ¶ added in v0.8.0
func (gm *DynamicGroupManager) IsReady(ctx context.Context) (bool, error)
func (*DynamicGroupManager) MembershipIndex ¶
func (gm *DynamicGroupManager) MembershipIndex() rln.MembershipIndex
func (*DynamicGroupManager) RemoveMembers ¶
func (gm *DynamicGroupManager) RemoveMembers(toRemove *om.OrderedMap) error
func (*DynamicGroupManager) SetMetadata ¶ added in v0.8.0
func (gm *DynamicGroupManager) SetMetadata(meta RLNMetadata) error
SetMetadata stores some metadata into the zerokit's RLN database
func (*DynamicGroupManager) Stop ¶
func (gm *DynamicGroupManager) Stop() error
Stop stops all go-routines, eth client and closes the rln database
type MembershipFetcher ¶ added in v0.8.0
type MembershipFetcher struct {
// contains filtered or unexported fields
}
MembershipFetcher is used for getting membershipRegsitered Events from the eth rpc
func NewMembershipFetcher ¶ added in v0.8.0
func NewMembershipFetcher(web3Config *web3.Config, rln *rln.RLN, rootTracker *group_manager.MerkleRootTracker, log *zap.Logger) MembershipFetcher
func (*MembershipFetcher) GetMetadata ¶ added in v0.8.0
func (mf *MembershipFetcher) GetMetadata() (RLNMetadata, error)
GetMetadata retrieves metadata from the zerokit's RLN database
func (*MembershipFetcher) HandleGroupUpdates ¶ added in v0.8.0
func (mf *MembershipFetcher) HandleGroupUpdates(ctx context.Context, handler RegistrationEventHandler) error
HandleGroupUpdates mounts the supplied handler for the registration events emitting from the membership contract It connects to the eth client, subscribes to the `MemberRegistered` event emitted from the `MembershipContract` and collects all the events, for every received event, it calls the `handler`
func (*MembershipFetcher) Stop ¶ added in v0.8.0
func (mf *MembershipFetcher) Stop()
type Metrics ¶ added in v0.8.0
type Metrics interface { RecordRegisteredMembership(num uint) RecordMembershipInsertionDuration(duration time.Duration) RecordMembershipCredentialsImportDuration(duration time.Duration) }
Metrics exposes the functions required to update prometheus metrics for lightpush protocol
type MockBlockChain ¶ added in v0.8.0
MockBlockChain is currently a chain of events for different block numbers it is used internal by mock client for returning events for a given block number or range in FilterLog rpc call.
type MockClient ¶ added in v0.8.0
func NewMockClient ¶ added in v0.8.0
func NewMockClient(t *testing.T, blockFile string) *MockClient
func (*MockClient) BlockByNumber ¶ added in v0.8.0
func (*MockClient) Close ¶ added in v0.8.0
func (c *MockClient) Close()
func (*MockClient) FilterLogs ¶ added in v0.8.0
func (*MockClient) SetErrorOnBlock ¶ added in v0.8.0
func (c *MockClient) SetErrorOnBlock(blockNum int64, err error, count int)
func (*MockClient) SetLatestBlockNumber ¶ added in v0.8.0
func (c *MockClient) SetLatestBlockNumber(num int64)
func (*MockClient) SubscribeNewHead ¶ added in v0.8.0
type MockEvent ¶ added in v0.8.0
type RLNMetadata ¶ added in v0.8.0
type RLNMetadata struct { LastProcessedBlock uint64 ChainID *big.Int ContractAddress common.Address ValidRootsPerBlock []group_manager.RootsPerBlock }
RLNMetadata persists attributes in the RLN database
func DeserializeMetadata ¶ added in v0.8.0
func DeserializeMetadata(b []byte) (RLNMetadata, error)
DeserializeMetadata converts a byte slice into a RLNMetadata instance
func (RLNMetadata) Serialize ¶ added in v0.8.0
func (r RLNMetadata) Serialize() []byte
Serialize converts a RLNMetadata into a binary format expected by zerokit's RLN
type RegistrationEventHandler ¶
type RegistrationEventHandler = func([]*contracts.RLNMemberRegistered) error
RegistrationEventHandler represents the types of inputs to this handler matches the MemberRegistered event/proc defined in the MembershipContract interface
type RegistrationHandler ¶
type RegistrationHandler = func(tx *types.Transaction)