Documentation
¶
Index ¶
- Constants
- Variables
- func ScanLinesUntilBlank() (out string, err error)
- type BIOS
- func (b *BIOS) AmIAppointedBlockProducer() bool
- func (b *BIOS) AmIBootNode() bool
- func (b *BIOS) DispatchBootNetwork(genesisJSON, publicKey, privateKey string) error
- func (b *BIOS) DispatchDone() error
- func (b *BIOS) DispatchInit() error
- func (b *BIOS) DispatchJoinNetwork(kickstart *KickstartData, peerDefs []*discovery.Peer) error
- func (b *BIOS) DispatchPublishKickstartData(kickstartData string) error
- func (b *BIOS) GenerateEphemeralPrivKey() (*ecc.PrivateKey, error)
- func (b *BIOS) GenerateGenesisJSON(pubKey string) string
- func (b *BIOS) Init() error
- func (b *BIOS) IsAppointedBlockProducer(account string) bool
- func (b *BIOS) IsBootNode(account string) bool
- func (b *BIOS) MyPeer() (*discovery.Peer, error)
- func (b *BIOS) MyRole() Role
- func (b *BIOS) PrintOrderedPeers()
- func (b *BIOS) RunBootSequence() error
- func (b *BIOS) RunJoinNetwork(verify, sabotage bool) error
- func (b *BIOS) SetKickstartData(ks *KickstartData)
- func (b *BIOS) StartBoot() error
- func (b *BIOS) StartJoin(verify bool) error
- func (b *BIOS) StartOrchestrate() error
- type Config
- type GenesisJSON
- type HookDef
- type KickstartData
- type OpCreateProducers
- type OpCreateToken
- type OpDestroyAccounts
- type OpInjectSnapshot
- type OpIssueToken
- type OpNewAccount
- type OpSetCode
- type OpSetPriv
- type OpSetProds
- type Operation
- type OperationType
- type Role
- type Snapshot
- type SnapshotLine
Constants ¶
View Source
const ( RoleBootNode = Role(iota) RoleABP RoleParticipant )
Variables ¶
View Source
var AN = eos.AN
AN is a shortcut to create an AccountName
View Source
var ConfiguredHooks = []HookDef{ HookDef{"init", "Dispatch when we start the program."}, HookDef{"boot_network", "Dispatched when we are BIOS Node, and our keys and node config is ready. Should trigger a config update and a restart."}, HookDef{"publish_kickstart_data", "Dispatched with the contents of the (usually encrypted) Kickstart data, to be published to your social / web properties."}, HookDef{"join_network", "Dispatched anyone joining the network. Could be as an Appointed Block Producer, or simply someone wanting to join the network after boot. It provides at least one p2p_address to connect to."}, HookDef{"done", "When your process it done"}, }
View Source
var PN = eos.PN
PN is a shortcut to create a PermissionName
Functions ¶
func ScanLinesUntilBlank ¶
Types ¶
type BIOS ¶
type BIOS struct {
Network *discovery.Network
LaunchData *discovery.LaunchData
Config *Config
API *eos.API
Snapshot Snapshot
BootSequence []*OperationType
KickstartData *KickstartData
// ShuffledProducers is an ordered list of producers according to
// the shuffled peers.
ShuffledProducers []*discovery.Peer
// MyPeers represent the peers my local node will handle. It is
// plural because when launching a 3-node network, your peer will
// be cloned a few time to have a full schedule of 21 producers.
MyPeers []*discovery.Peer
EphemeralPrivateKey *ecc.PrivateKey
}
func (*BIOS) AmIAppointedBlockProducer ¶
func (*BIOS) AmIBootNode ¶
func (*BIOS) DispatchBootNetwork ¶
func (*BIOS) DispatchDone ¶
func (*BIOS) DispatchInit ¶
func (*BIOS) DispatchJoinNetwork ¶
func (b *BIOS) DispatchJoinNetwork(kickstart *KickstartData, peerDefs []*discovery.Peer) error
func (*BIOS) DispatchPublishKickstartData ¶
func (*BIOS) GenerateEphemeralPrivKey ¶
func (b *BIOS) GenerateEphemeralPrivKey() (*ecc.PrivateKey, error)
func (*BIOS) GenerateGenesisJSON ¶
func (*BIOS) IsAppointedBlockProducer ¶
func (*BIOS) IsBootNode ¶
func (*BIOS) PrintOrderedPeers ¶
func (b *BIOS) PrintOrderedPeers()
func (*BIOS) RunBootSequence ¶
func (*BIOS) RunJoinNetwork ¶ added in v0.3.3
func (*BIOS) SetKickstartData ¶
func (b *BIOS) SetKickstartData(ks *KickstartData)
func (*BIOS) StartOrchestrate ¶ added in v0.3.3
type Config ¶
type Config struct {
// Producer describes your producing node.
Peer struct {
// MyAccount is the name of the `account_name` this producer will be using on chain
MyAccount string `json:"my_account"`
// APIAddress is the target API endpoint for the locally booting node, a clean-slate node. It can be routable only from the local machine.
APIAddress string `json:"api_address"`
APIAddressURL *url.URL `json:"-"`
// SecretP2PAddress is the endpoint which will be published at the end of the process. Needs to be externally routable. It must be kept secret for DDoS protection.
SecretP2PAddress string `json:"secret_p2p_address"`
// Key you want to register to sign blocks.
BlockSigningPublicKey ecc.PublicKey `json:"block_signing_public_key"`
// Private key used to setup your config.ini as an ABP (or as someone joining the network)
BlockSigningPrivateKeyPath string `json:"block_signing_private_key_path"`
// Available once loaded successfuly from the previous field's path.
BlockSigningPrivateKey *ecc.PrivateKey `json:"-"`
} `json:"producer"`
// PGP manages the PGP keys, used for the communications channel.
PGP struct {
// Program represents the type of program to use (gpg, keybase ?)
Program string `json:"program"`
// Path to binary executable.. unless we use in-process cryptography..
Path string `json:"path"`
} `json:"pgp"`
}
type GenesisJSON ¶
type KickstartData ¶
type OpCreateProducers ¶
type OpCreateProducers struct {
// TestnetEnrichProducers will provide each producer account with some EOS, only on testnets.
TestnetEnrichProducers bool `json:"TESTNET_ENRICH_PRODUCERS"`
}
func (*OpCreateProducers) Actions ¶
func (op *OpCreateProducers) Actions(b *BIOS) (out []*eos.Action, err error)
func (*OpCreateProducers) ResetTestnetOptions ¶
func (op *OpCreateProducers) ResetTestnetOptions()
type OpCreateToken ¶
type OpCreateToken struct {
Account eos.AccountName
Amount eos.Asset
CanWhitelist bool `json:"can_whitelist"`
CanFreeze bool `json:"can_freeze"`
CanRecall bool `json:"can_recall"`
}
func (*OpCreateToken) Actions ¶
func (op *OpCreateToken) Actions(b *BIOS) (out []*eos.Action, err error)
func (*OpCreateToken) ResetTestnetOptions ¶
func (op *OpCreateToken) ResetTestnetOptions()
type OpDestroyAccounts ¶
type OpDestroyAccounts struct {
Accounts []eos.AccountName
TestnetKeepAccounts bool `json:"TESTNET_KEEP_ACCOUNTS"`
}
func (*OpDestroyAccounts) Actions ¶
func (op *OpDestroyAccounts) Actions(b *BIOS) (out []*eos.Action, err error)
func (*OpDestroyAccounts) ResetTestnetOptions ¶
func (op *OpDestroyAccounts) ResetTestnetOptions()
type OpInjectSnapshot ¶
type OpInjectSnapshot struct {
TestnetTruncateSnapshot int `json:"TESTNET_TRUNCATE_SNAPSHOT"`
}
func (*OpInjectSnapshot) Actions ¶
func (op *OpInjectSnapshot) Actions(b *BIOS) (out []*eos.Action, err error)
func (*OpInjectSnapshot) ResetTestnetOptions ¶
func (op *OpInjectSnapshot) ResetTestnetOptions()
type OpIssueToken ¶
type OpIssueToken struct {
Account eos.AccountName
Amount eos.Asset
Memo string
}
func (*OpIssueToken) Actions ¶
func (op *OpIssueToken) Actions(b *BIOS) (out []*eos.Action, err error)
func (*OpIssueToken) ResetTestnetOptions ¶
func (op *OpIssueToken) ResetTestnetOptions()
type OpNewAccount ¶
type OpNewAccount struct {
Creator eos.AccountName
NewAccount eos.AccountName `json:"new_account"`
Pubkey string
}
func (*OpNewAccount) Actions ¶
func (op *OpNewAccount) Actions(b *BIOS) (out []*eos.Action, err error)
func (*OpNewAccount) ResetTestnetOptions ¶
func (op *OpNewAccount) ResetTestnetOptions()
type OpSetCode ¶
type OpSetCode struct {
Account eos.AccountName
ContractNameRef string `json:"contract_name_ref"`
}
func (*OpSetCode) ResetTestnetOptions ¶
func (op *OpSetCode) ResetTestnetOptions()
type OpSetPriv ¶
type OpSetPriv struct {
Account eos.AccountName
IsPriv bool `json:"is_priv"` // unused
}
func (*OpSetPriv) ResetTestnetOptions ¶
func (op *OpSetPriv) ResetTestnetOptions()
type OpSetProds ¶
type OpSetProds struct{}
func (*OpSetProds) ResetTestnetOptions ¶
func (op *OpSetProds) ResetTestnetOptions()
type OperationType ¶
func (*OperationType) UnmarshalJSON ¶
func (o *OperationType) UnmarshalJSON(data []byte) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.