Documentation ¶
Index ¶
- Constants
- func CalcMd5(outpath string) []byte
- func GenerateKeys(algo crypto.SigningAlgorithm, n int, seeds [][]byte) ([]crypto.PrivateKey, error)
- func GenerateMachineAccountKey(seed []byte) (crypto.PrivateKey, error)
- func GenerateNetworkingKey(seed []byte) (crypto.PrivateKey, error)
- func GenerateNetworkingKeys(n int, seeds [][]byte) ([]crypto.PrivateKey, error)
- func GenerateNodeInfos(consensus, collection, execution, verification, access int) []model.NodeInfo
- func GeneratePublicNetworkingKey(seed []byte) (key crypto.PrivateKey, err error)
- func GenerateSecretsDBEncryptionKey() ([]byte, error)
- func GenerateStakingKey(seed []byte) (crypto.PrivateKey, error)
- func GenerateStakingKeys(n int, seeds [][]byte) ([]crypto.PrivateKey, error)
- func GenerateUnstakedNetworkingKeys(n int, seeds [][]byte) ([]crypto.PrivateKey, error)
- func ReadData[T any](path string) (*T, error)
- func ReadRootProtocolSnapshot(bootDir string) (*inmem.Snapshot, error)
- func RunWithSporkBootstrapDir(t testing.TB, ...)
- func WriteInternalFiles(nodeInfos []model.NodeInfo, bootDir string) (string, string, error)
- func WriteMachineAccountFile(nodeID flow.Identifier, accountAddress sdk.Address, ...) error
- func WriteMachineAccountFiles(chainID flow.ChainID, nodeInfos []bootstrap.NodeInfo, write WriteJSONFileFunc) error
- func WriteNodeInternalPubInfos(nodeInfos []bootstrap.NodeInfo, write WriteJSONFileFunc) error
- func WritePartnerFiles(nodeInfos []model.NodeInfo, bootDir string) (string, string, error)
- func WriteSecretsDBEncryptionKeyFiles(nodeInfos []bootstrap.NodeInfo, write WriteFileFunc) error
- func WriteStakingNetworkingKeyFiles(nodeInfos []bootstrap.NodeInfo, write WriteJSONFileFunc) error
- type WriteFileFunc
- type WriteJSONFileFunc
Constants ¶
const X962_INVERSION = uint8(0x03)
const X962_NO_INVERSION = uint8(0x02)
these constants are defined in X9.62 section 4.2 and 4.3 see https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.202.2977&rep=rep1&type=pdf they indicate if the conversion to/from a public key (point) in compressed form must involve an inversion of the ordinate coordinate
Variables ¶
This section is empty.
Functions ¶
func GenerateKeys ¶
func GenerateKeys(algo crypto.SigningAlgorithm, n int, seeds [][]byte) ([]crypto.PrivateKey, error)
func GenerateMachineAccountKey ¶
func GenerateMachineAccountKey(seed []byte) (crypto.PrivateKey, error)
func GenerateNetworkingKey ¶
func GenerateNetworkingKey(seed []byte) (crypto.PrivateKey, error)
func GenerateNetworkingKeys ¶
func GenerateNetworkingKeys(n int, seeds [][]byte) ([]crypto.PrivateKey, error)
func GenerateNodeInfos ¶
func GeneratePublicNetworkingKey ¶ added in v0.27.0
func GeneratePublicNetworkingKey(seed []byte) (key crypto.PrivateKey, err error)
GeneratePublicNetworkingKey draws ECDSASecp256k1 keys until finding a suitable one. though this will return fast, this is not constant-time and will leak ~1 bit of information through its runtime
func GenerateSecretsDBEncryptionKey ¶ added in v0.22.4
GenerateSecretsDBEncryptionKey generates an encryption key for encrypting a Badger database.
func GenerateStakingKey ¶
func GenerateStakingKey(seed []byte) (crypto.PrivateKey, error)
func GenerateStakingKeys ¶
func GenerateStakingKeys(n int, seeds [][]byte) ([]crypto.PrivateKey, error)
func GenerateUnstakedNetworkingKeys ¶ added in v0.21.0
func GenerateUnstakedNetworkingKeys(n int, seeds [][]byte) ([]crypto.PrivateKey, error)
func WriteInternalFiles ¶
WriteInternalFiles writes the internal private node info into `bootDir/private-root-information/` also writes a map containing each of the nodes weights mapped by the node's networking address
func WriteMachineAccountFile ¶ added in v0.23.9
func WriteMachineAccountFile( nodeID flow.Identifier, accountAddress sdk.Address, accountKey encodable.MachineAccountPrivKey, write WriteJSONFileFunc) error
func WriteMachineAccountFiles ¶
func WriteMachineAccountFiles(chainID flow.ChainID, nodeInfos []bootstrap.NodeInfo, write WriteJSONFileFunc) error
WriteMachineAccountFiles writes machine account key files for a set of nodeInfos. Assumes that machine accounts have been created using the default execution state bootstrapping. Further assumes that the order of nodeInfos is the same order that nodes were registered during execution state bootstrapping.
Only applicable for transient test networks.
func WriteNodeInternalPubInfos ¶ added in v0.37.1
func WriteNodeInternalPubInfos(nodeInfos []bootstrap.NodeInfo, write WriteJSONFileFunc) error
WriteNodeInternalPubInfos writes the `node-internal-infos.pub.json` file. In a nutshell, this file contains the Role, address and weight for all authorized nodes.
func WritePartnerFiles ¶
WritePartnerFiles writes the all partner public node info into `bootDir/partners/public-root-information/` also writes a map containing each of the nodes weights mapped by NodeID
func WriteSecretsDBEncryptionKeyFiles ¶ added in v0.22.4
func WriteSecretsDBEncryptionKeyFiles(nodeInfos []bootstrap.NodeInfo, write WriteFileFunc) error
WriteSecretsDBEncryptionKeyFiles writes secret db encryption keys to private node info directory.
func WriteStakingNetworkingKeyFiles ¶
func WriteStakingNetworkingKeyFiles(nodeInfos []bootstrap.NodeInfo, write WriteJSONFileFunc) error
WriteStakingNetworkingKeyFiles writes staking and networking keys to private node info files.
Types ¶
type WriteFileFunc ¶ added in v0.22.4
WriteFileFunc is the same as WriteJSONFileFunc, but it writes the bytes directly rather than marshalling a structure to json.
type WriteJSONFileFunc ¶
WriteJSONFileFunc is a function which writes a file during bootstrapping. It accepts the path for the file (relative to the bootstrapping root directory) and the value to write. The function must marshal the value as JSON and write the result to the given path.