account

package
v0.0.0-...-11d313d Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var G_AccountHub = NewAccountHub()

Functions

func CloseChannel

func CloseChannel(channelID sln.ChannelID, address string) (txid string,
	er error)

func GetRandomlySortedActiveNodes

func GetRandomlySortedActiveNodes() (nds []peer.ID, er error)

func OpenChannel

func OpenChannel(channelID sln.ChannelID) (txid string, er error)

func ProcessSoln

func ProcessSoln(channelID sln.ChannelID,
	soln sln.Soln, tos TickOrStop) (er error)

func RectifyRegNUnregNodes

func RectifyRegNUnregNodes(reg NodeID2BlockNum,
	unreg NodeID2BlockNum) (nds []peer.ID, er error)

func RedeemSoln

func RedeemSoln(channelID sln.ChannelID, soln sln.Soln,
	tos TickOrStop) (txid string, er error)

func RegisterNodeID

func RegisterNodeID(nodeID string) (txid, address string, er error)

func UnregNodeIfRegistered

func UnregNodeIfRegistered(nodeID, address string) (txid string, er error)

func UpdateNodeID

func UpdateNodeID(nodeID, address string) (txid string, er error)

Types

type Account

type Account interface {
	Init()
	New(baseDir,
		basePassword string, numberOfKeys int) (acct Account, er error)
	NewDefault(basePassword string) (acc Account, er error)
	ResumeDefault(basePassword string) (acc Account, er error)
	Resume(filepath, basePassword string) (acc Account, er error)
	NowUint64() uint64
	NowHex() string
	GetParamUint64(param string) uint64
	Flag() Flag
	RedeemSoln(channelID, soln []byte,
		tos TickOrStop) (txid string, er error)
	OpenChannel(channelID sln.ChannelID) (txid string, er error)
	CloseChannel(channelID sln.ChannelID, address string) (txid string,
		er error)
	DumpRegNodes() (ns NodeID2BlockNum, er error)
	DumpUnregNodes() (ns NodeID2BlockNum, er error)
	RegisterNodeID(nodeID string) (txid, address string, er error)
	UpdateNodeID(nodeID, address string) (txid string, er error)
	UnregNodeIfRegistered(nodeID, address string) (txid string, er error)
}

type AccountHub

type AccountHub struct {
	sync.RWMutex
	M map[BCLayer]Account
}

func NewAccountHub

func NewAccountHub() (ah *AccountHub)

func (*AccountHub) CloseChannel

func (ah *AccountHub) CloseChannel(channelID sln.ChannelID,
	address string) (txid string, er error)

func (*AccountHub) DumpRegNodes

func (ah *AccountHub) DumpRegNodes() (ns NodeID2BlockNum, er error)

func (*AccountHub) DumpUnregNodes

func (ah *AccountHub) DumpUnregNodes() (ns NodeID2BlockNum, er error)

func (*AccountHub) GetParamUint64

func (ah *AccountHub) GetParamUint64(param string) uint64

func (*AccountHub) New

func (ah *AccountHub) New(baseDir,
	basePassword string, numberOfKeys int) (acct Account, er error)

currently defaults to Eth layer. But in future, will deduce which layer to resume by filepath contents. // TODO integrate other layers

func (*AccountHub) NewDefault

func (ah *AccountHub) NewDefault(basePassword string) (acct Account,
	er error)

currently defaults to Eth layer. But in future, will deduce which layer to resume by filepath contents. // TODO integrate other layers

func (*AccountHub) NewDev

func (ah *AccountHub) NewDev(basePassword string) (acct Account,
	er error)

currently defaults to Eth layer. But in future, will deduce which layer to resume by filepath contents. // TODO integrate other layers

func (*AccountHub) NowHex

func (ah *AccountHub) NowHex() string

func (*AccountHub) NowUint64

func (ah *AccountHub) NowUint64() uint64

func (*AccountHub) Ok

func (ah *AccountHub) Ok() (tf bool)

func (*AccountHub) OpenChannel

func (ah *AccountHub) OpenChannel(channelID sln.ChannelID) (txid string,
	er error)

currently defaults to Eth layer. But in near future will scan other layers as they are integrated. // TODO integrate other layers

func (*AccountHub) RedeemSoln

func (ah *AccountHub) RedeemSoln(channelID sln.ChannelID, soln sln.Soln,
	tos TickOrStop) (txid string, er error)

currently defaults to Eth layer. But in near future will scan other layers as they are integrated. // TODO integrate other layers

func (*AccountHub) RegisterNodeID

func (ah *AccountHub) RegisterNodeID(nodeID string) (txid, address string,
	er error)

currently defaults to Eth layer. But in near future will scan other layers as they are integrated. // TODO integrate other layers

func (*AccountHub) Resume

func (ah *AccountHub) Resume(filepath,
	basePassword string) (acct Account, er error)

currently defaults to Eth layer. But in future, will deduce which layer to resume by filepath contents. // TODO integrate other layers

func (*AccountHub) ResumeDefault

func (ah *AccountHub) ResumeDefault(basePassword string) (acct Account,
	er error)

currently defaults to Eth layer. But in future, will deduce which layer to resume by filepath contents. // TODO integrate other layers

func (*AccountHub) UnregNodeIfRegistered

func (ah *AccountHub) UnregNodeIfRegistered(nodeID,
	address string) (txid string, er error)

currently defaults to Eth layer. But in near future will scan other layers as they are integrated. // TODO integrate other layers

func (*AccountHub) UpdateNodeID

func (ah *AccountHub) UpdateNodeID(nodeID,
	address string) (txid string, er error)

currently defaults to Eth layer. But in near future will scan other layers as they are integrated. // TODO integrate other layers

type BCLayer

type BCLayer byte
const (
	Eth BCLayer = iota
)

type EthAccount

type EthAccount struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*EthAccount) CloseChannel

func (e *EthAccount) CloseChannel(channelID sln.ChannelID,
	address string) (txid string, er error)

func (*EthAccount) DumpRegNodes

func (e *EthAccount) DumpRegNodes() (ns NodeID2BlockNum, er error)

func (*EthAccount) DumpUnregNodes

func (e *EthAccount) DumpUnregNodes() (ns NodeID2BlockNum, er error)

func (*EthAccount) Flag

func (e *EthAccount) Flag() Flag

func (*EthAccount) GetKeyByAddress

func (e *EthAccount) GetKeyByAddress(address string,
	noc NodeOrChannel) (key *keystore.Key, er error)

func (*EthAccount) GetParamUint64

func (e *EthAccount) GetParamUint64(param string) uint64

func (*EthAccount) Init

func (e *EthAccount) Init()

func (*EthAccount) IsNodeRegistered

func (e *EthAccount) IsNodeRegistered(nodeID string) (tf bool)

func (*EthAccount) New

func (e *EthAccount) New(baseDir,
	basePassword string, numberOfKeys int) (acct Account, er error)

func (*EthAccount) NewDefault

func (e *EthAccount) NewDefault(basePassword string) (acct Account, er error)

func (*EthAccount) NewDev

func (e *EthAccount) NewDev(basePassword string) (acct Account, er error)

func (*EthAccount) NowHex

func (e *EthAccount) NowHex() string

func (*EthAccount) NowUint64

func (e *EthAccount) NowUint64() uint64

func (*EthAccount) OpenChannel

func (e *EthAccount) OpenChannel(channelID sln.ChannelID) (txid string,
	er error)

func (*EthAccount) RedeemSoln

func (e *EthAccount) RedeemSoln(channelID, soln []byte,
	tos TickOrStop) (txid string, er error)

func (*EthAccount) RegisterNodeID

func (e *EthAccount) RegisterNodeID(nodeID string) (txid, address string,
	er error)

func (*EthAccount) Resume

func (e *EthAccount) Resume(baseDir,
	basePassword string) (acct Account, er error)

func (*EthAccount) ResumeDefault

func (e *EthAccount) ResumeDefault(basePassword string) (acct Account,
	er error)

func (*EthAccount) UnregNodeIfRegistered

func (e *EthAccount) UnregNodeIfRegistered(nodeID, address string) (txid string, er error)

func (*EthAccount) UnregisterNodeID

func (e *EthAccount) UnregisterNodeID(nodeID string, key *keystore.Key) (txid string, er error)

func (*EthAccount) UpdateNodeID

func (e *EthAccount) UpdateNodeID(nodeID, address string) (txid string,
	er error)

type Keystores

type Keystores struct {
	ClientKS    *keystore.Keystore
	RelayNodeKS *keystore.Keystore
}

type NodeID2BlockNum

type NodeID2BlockNum map[peer.ID]uint64

Jump to

Keyboard shortcuts

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