genesis

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileSolidityContract

func CompileSolidityContract(soliditySource string) (map[string]*compiler.Contract, error)

CompileSolidityContract compiles a solitity smart-contract using the compiler that comes with Geth.

func GenerateGenesisJSON

func GenerateGenesisJSON(outDir, keystore string, peers []*peers.Peer, alloc *Alloc, contractAddress string) error

GenerateGenesisJSON compiles the POA solitity smart-contract with the peers baked into the whitelist. It then creates a genesis file with the corresponding POA section, and if no alloc section is provided, creates one with all the keys in keystore. The file is written to outDir.

func GetSolidityCompilerVersion

func GetSolidityCompilerVersion() (string, error)

GetSolidityCompilerVersion gets the version of the solidity compiler that comes with Geth.

Types

type Alloc

type Alloc map[string]*AllocRecord

Alloc is the section of a genesis file that contains the list of pre-funded accounts.

func BuildAlloc

func BuildAlloc(accountsDir string) (Alloc, error)

BuildAlloc builds the alloc structure of the genesis file

type AllocRecord

type AllocRecord struct {
	Balance string `json:"balance"`
	Moniker string `json:"moniker"`
}

AllocRecord is an object that contains information about a pre-funded acount.

type POA

type POA struct {
	Address string `json:"address"`
	Abi     string `json:"abi"`
	Code    string `json:"code"`
}

POA is the section of a genesis file that contains information about the POA smart-contract.

func BuildCompilationReport

func BuildCompilationReport(version string,
	contractInfo map[string]*compiler.Contract,
	contractAddress string,
	solidityCode string,
	outputDir string) (POA, error)

BuildCompilationReport outputs compiler results in a standard format and builds the poa structure that is written to the Genesis File

func BuildPOA

func BuildPOA(solidityCode string, contractAddress string, outDir string) (POA, error)

BuildPOA builds the poa section of the genesis file, and saves a compilation report to outDir.

Jump to

Keyboard shortcuts

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