vocone

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 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 {
	service.VocdoniService
	// 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, disableIPFS bool, connectKey string, connectPeers []string) (*Vocone, error)

NewVocone returns a ready Vocone instance.

func (*Vocone) Commit added in v1.10.0

func (vc *Vocone) Commit() ([]byte, error)

Commit saves the current state and returns the hash.

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) 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) 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 keykeeper to the application.

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 starts the Vocone node. This function is blocking.

Jump to

Keyboard shortcuts

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