4 Star 4 Fork 0

中光云计算(西安)有限公司/arty wandering

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
struct.go 2.61 KB
一键复制 编辑 原始数据 按行查看 历史
countpoison 提交于 2019-02-25 17:52 +08:00 . issues内容修改
package arty
import (
"context"
"github.com/Unknwon/goconfig"
"github.com/docker/docker/client"
)
//genesis.json的结构体
type Genesis struct {
Config Config `json:"config,omitempty"`
Nonce string `json:"nonce,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
ExtraData string `json:"extraData,omitempty"`
GasLimit string `json:"gasLimit,omitempty"`
Difficulty string `json:"difficulty,omitempty"`
MixHash string `json:"mixHash,omitempty"`
Coinbase string `json:"coinbase,omitempty"`
Alloc map[string]string `json:"alloc"`
Number string `json:"number,omitempty"`
GasUsed string `json:"gasUsed,omitempty"`
ParentHash string `json:"parentHash,omitempty"`
}
type Config struct {
ChainId int `json:"chainId,omitempty"`
HomesteadBlock int `json:"homesteadBlock,omitempty"`
Eip150Block int `json:"eip150Block,omitempty"`
Eip150Hash string `json:"eip150Hash,omitempty"`
Eip155Block int `json:"eip155Block,omitempty"`
Eip158Block int `json:"eip158Block,omitempty"`
ByzantiumBlock int `json:"byzantiumBlock,omitempty"`
ConstantinopleBlock int `json:"constantinopleBlock,omitempty"`
Ethash Ethash `json:"ethash,omitempty"`
}
type Ethash struct {
Ethash string `json:"ethash,omitempty"`
}
//整体数据的结构体
type GlobalConf struct {
Global GlobalSet
BootNood BootNoodConfig
Nodes map[string]*NodesConfig
DockerInitConfig DockerInitConfig
}
//全局配置结构
type GlobalSet struct {
WorkDir string
BaseDir string
BootNodeDir string
NodesDir string
BaseConfigFile string
BaseConfigFileByte *goconfig.ConfigFile
LocalIP string
NetworkId string
CoinBase string
DCFileContents []byte
NCFileContents []byte
}
//bootnode 配置结构
type BootNoodConfig struct {
Id string
Start bool
Status string
Port string
State string
IP string
Created int64
Genesis Genesis
}
//node节点配置结构
type NodesConfig struct {
Id string
Start bool
State string
Created int64
Status string
Cmdstr string
Port string
Etherbase string
NodeIniConfig *goconfig.ConfigFile
}
//docker需要的数据初始化
type DockerInitConfig struct {
Ctx context.Context
Cli *client.Client
Url string
Tag string
DOCKER_API_VERSION string
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/countpoison/arty.git
git@gitee.com:countpoison/arty.git
countpoison
arty
arty wandering
e63a34c810ae

搜索帮助