Documentation ¶
Index ¶
- Variables
- func DataDirCache() string
- func DataDirETH() string
- func DataDirIPFS() string
- func ETHAddr() string
- func IPFSAPIAddr() string
- func IPFSAPIURL() string
- func IPFSGatewayURL() string
- func Initialize()
- func KeyDir() string
- func KeyStoreDirETH() string
- func LoadConfig() error
- func RPCAddr() string
- func SaveConfig(config *Config) error
- func SaveGenesis(cfg *Config) (err error)
- type API
- type APIConfig
- type APIHTTPHeaders
- type AWSConfig
- type Addresses
- type Alloc
- type Child
- type Clique
- type Config
- type ConnMgr
- type Datastore
- type Discovery
- type ETHConfig
- type ETHKeyFile
- type Experimental
- type Gateway
- type GatewayHTTPHeaders
- type Genesis
- type GenesisConfig
- type HashConfig
- type IPFSConfig
- type IPFSServerConfig
- type Identity
- type Ipns
- type Mdns
- type Mounts
- type NodeConfig
- type Pubsub
- type Reprovider
- type Routing
- type Spec
- type Swarm
- type TLSCertificate
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultNodeContractAddr = "0xbaEEB7a3AF34a365ACAa1f8464A3374B58ac9889"
DefaultNodeContractAddr ...
View Source
var DefaultTokenContractAddr = "0x9064322CfeE623A447ba5aF0dA6AD3341c073535"
DefaultTokenContractAddr ...
View Source
var WorkDir = ""
WorkDir ...
Functions ¶
func SaveGenesis ¶
SaveGenesis write genesis file when the file is not exist
Types ¶
type APIConfig ¶
type APIConfig struct { Port int `json:"port" mapstructure:"port"` Version string `json:"version" mapstructure:"version"` UseTLS bool `json:"use_tls" mapstructure:"use_tls"` TLS TLSCertificate `json:"tls" mapstructure:"tls"` Certificate []tls.Certificate `json:"certificate" mapstructure:"certificate"` Timeout time.Duration `json:"timeout" mapstructure:"timeout"` }
APIConfig ...
type AWSConfig ¶
type AWSConfig struct { HostedZoneID string `json:"hosted_zone_id" mapstructure:"hosted_zone_id"` RecordName string `json:"record_name" mapstructure:"record_name"` AwsAccessKeyID string `json:"aws_access_key_id" mapstructure:"aws_access_key_id"` AwsSecretAccessKey string `json:"aws_secret_access_key" mapstructure:"aws_secret_access_key"` }
AWSConfig ...
type Addresses ¶
type Addresses struct { API string `json:"API"` Announce []interface{} `json:"Announce"` Gateway string `json:"Gateway"` NoAnnounce []interface{} `json:"NoAnnounce"` Swarm []string `json:"Swarm"` }
Addresses ...
type Child ¶
type Child struct { Path string `json:"path"` SyncWrites bool `json:"syncWrites"` Truncate bool `json:"truncate"` Type string `json:"type"` }
Child ...
type Config ¶
type Config struct { Node NodeConfig `json:"node" mapstructure:"node"` API APIConfig `json:"api" mapstructure:"api"` UseTLS bool `json:"use_tls" mapstructure:"use_tls"` TLS TLSCertificate `json:"tls" mapstructure:"tls"` Schema string `json:"schema" mapstructure:"schema"` Path string `json:"path" mapstructure:"path" ` Account string `json:"account" mapstructure:"account"` Identity string `json:"identity" mapstructure:"identity"` PrivateKey string `json:"private_key" mapstructure:"private_key"` ETH ETHConfig `json:"eth" mapstructure:"eth"` IPFS IPFSConfig `json:"ipfs" mapstructure:"ipfs"` AWS AWSConfig `json:"aws" mapstructure:"aws"` Interval int64 `json:"interval" mapstructure:"interval"` NodeType int `json:"node_type" mapstructure:"node_type"` Limit int64 `json:"limit" mapstructure:"limit"` Debug bool `json:"debug" mapstructure:"debug"` BootNode []string `json:"boot_node" mapstructure:"boot_node"` }
Config ...
type ConnMgr ¶
type ConnMgr struct { GracePeriod string `json:"GracePeriod"` HighWater int64 `json:"HighWater"` LowWater int64 `json:"LowWater"` Type string `json:"Type"` }
ConnMgr ...
type Datastore ¶
type Datastore struct { BloomFilterSize int64 `json:"BloomFilterSize"` GCPeriod string `json:"GCPeriod"` HashOnRead bool `json:"HashOnRead"` Spec Spec `json:"Spec"` StorageGCWatermark int64 `json:"StorageGCWatermark"` StorageMax string `json:"StorageMax"` }
Datastore ...
type ETHConfig ¶
type ETHConfig struct { Enable bool `json:"enable" mapstructure:"enable"` LogOutput bool `json:"log_output" mapstructure:"log_output"` //output log to screen Name string `json:"name" mapstructure:"name"` //bin name Port int `json:"port" mapstructure:"port"` NodeAddr string `json:"node_addr" mapstructure:"node_addr"` //node contract address TokenAddr string `json:"token_addr" mapstructure:"token_addr"` //token contract address MessageAddr string `json:"message_addr" mapstructure:"message_addr"` //dmessage contract address DTagAddr string `json:"dtag_addr" mapstructure:"dtag_addr"` //dtag contract address }
ETHConfig ...
type ETHKeyFile ¶
type ETHKeyFile struct { Name string `json:"name" mapstructure:"name"` Pass string `json:"pass" mapstructure:"pass"` }
ETHKeyFile ...
type Experimental ¶
type Experimental struct { FilestoreEnabled bool `json:"FilestoreEnabled"` Libp2PStreamMounting bool `json:"Libp2pStreamMounting"` P2PHTTPProxy bool `json:"P2pHttpProxy"` PreferTLS bool `json:"PreferTLS"` Quic bool `json:"QUIC"` ShardingEnabled bool `json:"ShardingEnabled"` UrlstoreEnabled bool `json:"UrlstoreEnabled"` }
Experimental ...
type Gateway ¶
type Gateway struct { APICommands []interface{} `json:"APICommands"` HTTPHeaders GatewayHTTPHeaders `json:"HTTPHeaders"` NoFetch bool `json:"NoFetch"` PathPrefixes []interface{} `json:"PathPrefixes"` RootRedirect string `json:"RootRedirect"` Writable bool `json:"Writable"` }
Gateway ...
type GatewayHTTPHeaders ¶
type GatewayHTTPHeaders struct { AccessControlAllowHeaders []string `json:"Access-Control-Allow-Headers"` AccessControlAllowMethods []string `json:"Access-Control-Allow-Methods"` AccessControlAllowOrigin []string `json:"Access-Control-Allow-Origin"` }
GatewayHTTPHeaders ...
type Genesis ¶
type Genesis struct { Config GenesisConfig `json:"config"` Nonce string `json:"nonce"` Timestamp string `json:"timestamp"` ExtraData string `json:"extraData"` GasLimit string `json:"gasLimit"` Difficulty string `json:"difficulty"` MixHash string `json:"mixHash"` Coinbase string `json:"coinbase"` Alloc map[string]Alloc `json:"alloc"` Number string `json:"number"` GasUsed string `json:"gasUsed"` ParentHash string `json:"parentHash"` }
Genesis ...
type GenesisConfig ¶
type GenesisConfig struct { ChainID int64 `json:"chainId"` HomesteadBlock int64 `json:"homesteadBlock"` Eip150Block int64 `json:"eip150Block"` Eip150Hash string `json:"eip150Hash"` Eip155Block int64 `json:"eip155Block"` Eip158Block int64 `json:"eip158Block"` ByzantiumBlock int64 `json:"byzantiumBlock"` ConstantinopleBlock int64 `json:"constantinopleBlock"` Clique Clique `json:"clique"` }
GenesisConfig ...
type HashConfig ¶
type HashConfig struct {
Path string `json:"path" mapstructure:"path"`
}
HashConfig ...
type IPFSConfig ¶
type IPFSConfig struct { Enable bool `json:"enable" mapstructure:"enable"` LogOutput bool `json:"log_output" mapstructure:"log_output"` //output log to screen Name string `json:"name" mapstructure:"name"` API int `json:"api" mapstructure:"api"` Gateway int `json:"gateway" mapstructure:"gateway"` Timeout int `json:"timeout" mapstructure:"timeout"` }
IPFSConfig ...
type IPFSServerConfig ¶
type IPFSServerConfig struct { API API `json:"API"` Addresses Addresses `json:"Addresses"` Bootstrap []string `json:"Bootstrap"` Datastore Datastore `json:"Datastore"` Discovery Discovery `json:"Discovery"` Experimental Experimental `json:"Experimental"` Gateway Gateway `json:"Gateway"` Identity Identity `json:"Identity"` Ipns Ipns `json:"Ipns"` Mounts Mounts `json:"Mounts"` Pubsub Pubsub `json:"Pubsub"` Reprovider Reprovider `json:"Reprovider"` Routing Routing `json:"Routing"` Swarm Swarm `json:"Swarm"` }
IPFSServerConfig ...
func LoadIPFSServerConfig ¶
func LoadIPFSServerConfig(cfg *Config) (*IPFSServerConfig, error)
LoadIPFSServerConfig ...
type Ipns ¶
type Ipns struct { RecordLifetime string `json:"RecordLifetime"` RepublishPeriod string `json:"RepublishPeriod"` ResolveCacheSize int64 `json:"ResolveCacheSize"` }
Ipns ...
type Mounts ¶
type Mounts struct { FuseAllowOther bool `json:"FuseAllowOther"` Ipfs string `json:"IPFS"` Ipns string `json:"IPNS"` }
Mounts ...
type NodeConfig ¶
type NodeConfig struct { Port int `json:"port" mapstructure:"port"` BindPort int `json:"bind_port" mapstructure:"bind_port"` BackupSeconds time.Duration `json:"backup_seconds" mapstructure:"backup_seconds"` ConnectMax int `json:"connect_max" mapstructure:"connect_max"` PoolMax int `json:"pool_max" mapstructure:"pool_max"` }
NodeConfig ...
type Pubsub ¶
type Pubsub struct { DisableSigning bool `json:"DisableSigning"` Router string `json:"Router"` StrictSignatureVerification bool `json:"StrictSignatureVerification"` }
Pubsub ...
type Reprovider ¶
Reprovider ...
type Spec ¶
type Spec struct { Child Child `json:"child"` Prefix string `json:"prefix"` Type string `json:"type"` }
Spec ...
type Swarm ¶
type Swarm struct { AddrFilters interface{} `json:"AddrFilters"` ConnMgr ConnMgr `json:"ConnMgr"` DisableBandwidthMetrics bool `json:"DisableBandwidthMetrics"` DisableNatPortMap bool `json:"DisableNatPortMap"` DisableRelay bool `json:"DisableRelay"` EnableAutoNATService bool `json:"EnableAutoNATService"` EnableAutoRelay bool `json:"EnableAutoRelay"` EnableRelayHop bool `json:"EnableRelayHop"` }
Swarm ...
type TLSCertificate ¶
type TLSCertificate struct { KeyFile string `json:"key_file" mapstructure:"key_file"` KeyPassFile string `json:"key_pass_file" mapstructure:"key_pass_file"` }
TLSCertificate ...
Click to show internal directories.
Click to hide internal directories.