mobile: better api for java users (#21580)

* (mobile): Adds string representations for types

* mobile: better interfaces add stringer to types

Co-authored-by: sarath <sarath@melvault.com>
This commit is contained in:
Marius van der Wijden
2020-09-21 16:33:35 +02:00
committed by GitHub
parent 9a39c6bcb1
commit 2c097bb7a2
5 changed files with 93 additions and 0 deletions

View File

@ -90,6 +90,22 @@ func NewNodeConfig() *NodeConfig {
return &config
}
// AddBootstrapNode adds an additional bootstrap node to the node config.
func (conf *NodeConfig) AddBootstrapNode(node *Enode) {
conf.BootstrapNodes.Append(node)
}
// EncodeJSON encodes a NodeConfig into a JSON data dump.
func (conf *NodeConfig) EncodeJSON() (string, error) {
data, err := json.Marshal(conf)
return string(data), err
}
// String returns a printable representation of the node config.
func (conf *NodeConfig) String() string {
return encodeOrError(conf)
}
// Node represents a Geth Ethereum node instance.
type Node struct {
node *node.Node