Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMessageEncoder ¶
NewMessageEncoder returns a new Transit encoder that can encode StatusMessage values. More about Transit: https://github.com/cognitect/transit-format
Types ¶
type Contract ¶
type Contract interface { Vote(opts *bind.TransactOpts, joinNodes []gethcommon.Address, removeNodes []gethcommon.Address) (*types.Transaction, error) GetCurrentSession(opts *bind.CallOpts) (*big.Int, error) Registered(opts *bind.CallOpts, publicKey []byte) (bool, error) RegisterNode(opts *bind.TransactOpts, publicKey []byte, ip uint32, port uint16) (*types.Transaction, error) ActiveNodeCount(opts *bind.CallOpts) (*big.Int, error) InactiveNodeCount(opts *bind.CallOpts) (*big.Int, error) GetNode(opts *bind.CallOpts, index *big.Int) ([]byte, uint32, uint16, uint32, uint32, error) GetInactiveNode(opts *bind.CallOpts, index *big.Int) ([]byte, uint32, uint16, uint32, uint32, error) VoteSync(opts *bind.TransactOpts, joinNodes []gethcommon.Address, removeNodes []gethcommon.Address) (*types.Transaction, error) }
func NewContract ¶
func NewContract(address gethcommon.Address, backend bind.ContractBackend, client *ethclient.Client) (Contract, error)
NewContract creates a new instance of Contract, bound to a specific deployed contract.
type ContractImpl ¶
func (*ContractImpl) VoteSync ¶
func (c *ContractImpl) VoteSync(opts *bind.TransactOpts, joinNodes []gethcommon.Address, removeNodes []gethcommon.Address) (*types.Transaction, error)
VoteSync votes on the contract and wait until the transaction has been accepted, returns an error otherwise
type Enode ¶
type Enode struct { PublicKey []byte IP net.IP Port uint16 JoiningSession uint32 ActiveSession uint32 Active bool }
func (*Enode) PublicKeyString ¶
type PublicAPI ¶
type PublicAPI struct {
// contains filtered or unexported fields
}
PublicAPI represents a set of APIs from the `web3.peer` namespace.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(prv *ecdsa.PrivateKey, w Whisper, config *ServiceConfig, contract Contract) *Service
New returns a new incentivization Service
func (*Service) FetchEnodes ¶
func (*Service) GetCurrentSession ¶
type ServiceConfig ¶
type StatusMessage ¶
type StatusMessage struct { Text string ContentT string MessageT string Clock int64 Timestamp int64 Content StatusMessageContent }
func CreateTextStatusMessage ¶
func CreateTextStatusMessage(text string, chatID string) StatusMessage
CreateTextStatusMessage creates a StatusMessage.
type StatusMessageContent ¶
type Whisper ¶
type Whisper interface { Post(ctx context.Context, req whisper.NewMessage) (hexutil.Bytes, error) NewMessageFilter(req whisper.Criteria) (string, error) AddPrivateKey(ctx context.Context, privateKey hexutil.Bytes) (string, error) DeleteKeyPair(ctx context.Context, key string) (bool, error) GenerateSymKeyFromPassword(ctx context.Context, passwd string) (string, error) GetFilterMessages(id string) ([]*whisper.Message, error) }
Click to show internal directories.
Click to hide internal directories.