vocone

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTxsPerBlock     = 500
	DefaultBlockTimeTarget = time.Second * 5
	DefaultTxCosts         = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Vocone

type Vocone struct {
	// contains filtered or unexported fields
}

Vocone is an implementation of the Vocdoni protocol run by a single (atomic) node.

func NewVocone

func NewVocone(dataDir string, keymanager *ethereum.SignKeys) (*Vocone, error)

NewVocone returns a ready Vocone instance.

func (*Vocone) CreateAccount

func (vc *Vocone) CreateAccount(key common.Address, acc *state.Account) error

CreateAccount creates a new account in the state.

func (*Vocone) EnableAPI

func (vc *Vocone) EnableAPI(host string, port int, URLpath string) (*api.API, error)

EnableAPI starts the HTTP API server. It is not enabled by default.

func (*Vocone) MintTokens

func (vc *Vocone) MintTokens(to common.Address, amount uint64) error

MintTokens mints tokens to the given account address

func (*Vocone) SetBlockSize

func (vc *Vocone) SetBlockSize(txsCount int)

SetBlockSize configures the maximum number of transactions per block.

func (*Vocone) SetBlockTimeTarget

func (vc *Vocone) SetBlockTimeTarget(targetTime time.Duration)

SetBlockTimeTarget configures the time window in which blocks will be created.

func (*Vocone) SetBulkTxCosts

func (vc *Vocone) SetBulkTxCosts(txCost uint64, force bool) error

SetBulkTxCosts sets the transaction cost for all existing transaction types. It is useful to bootstrap the blockchain by set the transaction cost for all transaction types at once. If force is enabld the cost is set for all tx types. If force is disabled, the cost is set only for tx types that have not been set.

func (*Vocone) SetChainID

func (vc *Vocone) SetChainID(chainID string)

SetChainID sets the chainID for the vocone instance

func (*Vocone) SetElectionPrice added in v1.8.0

func (vc *Vocone) SetElectionPrice() error

SetElectionPrice sets the election price.

func (*Vocone) SetKeyKeeper added in v1.4.0

func (vc *Vocone) SetKeyKeeper(key *ethereum.SignKeys) error

SetKeyKeeper adds a keykeper to the application.

func (*Vocone) SetTreasurer

func (vc *Vocone) SetTreasurer(treasurer common.Address) error

SetTreasurer configures the vocone treasurer account address

func (*Vocone) SetTxCost

func (vc *Vocone) SetTxCost(txType models.TxType, cost uint64) error

SetTxCost configures the transaction cost for the given tx type.

func (*Vocone) Start

func (vc *Vocone) Start()

Start initializes the block production. This method should be run async.

Jump to

Keyboard shortcuts

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