github.com/klaytn/klaytn@v1.12.1/node/cn/gen_config.go (about)

     1  // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
     2  
     3  package cn
     4  
     5  import (
     6  	"math/big"
     7  	"time"
     8  
     9  	"github.com/klaytn/klaytn/blockchain"
    10  	"github.com/klaytn/klaytn/common"
    11  	"github.com/klaytn/klaytn/consensus/istanbul"
    12  	"github.com/klaytn/klaytn/datasync/downloader"
    13  	"github.com/klaytn/klaytn/node/cn/gasprice"
    14  	"github.com/klaytn/klaytn/storage/database"
    15  	"github.com/klaytn/klaytn/storage/statedb"
    16  )
    17  
    18  // MarshalTOML marshals as TOML.
    19  func (c Config) MarshalTOML() (interface{}, error) {
    20  	type Config struct {
    21  		Genesis                 *blockchain.Genesis `toml:",omitempty"`
    22  		NetworkId               uint64
    23  		SyncMode                downloader.SyncMode
    24  		NoPruning               bool
    25  		WorkerDisable           bool
    26  		DownloaderDisable       bool
    27  		FetcherDisable          bool
    28  		ParentOperatorAddr      *common.Address `toml:",omitempty"`
    29  		AnchoringPeriod         uint64
    30  		SentChainTxsLimit       uint64
    31  		OverwriteGenesis        bool
    32  		StartBlockNumber        uint64
    33  		DBType                  database.DBType
    34  		SkipBcVersionCheck      bool `toml:"-"`
    35  		SingleDB                bool
    36  		NumStateTrieShards      uint
    37  		EnableDBPerfMetrics     bool
    38  		LevelDBCompression      database.LevelDBCompressionType
    39  		LevelDBBufferPool       bool
    40  		LevelDBCacheSize        int
    41  		DynamoDBConfig          database.DynamoDBConfig
    42  		TrieCacheSize           int
    43  		TrieTimeout             time.Duration
    44  		TrieBlockInterval       uint
    45  		TriesInMemory           uint64
    46  		SenderTxHashIndexing    bool
    47  		ParallelDBWrite         bool
    48  		TrieNodeCacheConfig     statedb.TrieNodeCacheConfig
    49  		SnapshotCacheSize       int
    50  		SnapshotAsyncGen        bool
    51  		ServiceChainSigner      common.Address `toml:",omitempty"`
    52  		ExtraData               []byte         `toml:",omitempty"`
    53  		GasPrice                *big.Int
    54  		Rewardbase              common.Address `toml:",omitempty"`
    55  		TxPool                  blockchain.TxPoolConfig
    56  		GPO                     gasprice.Config
    57  		EnablePreimageRecording bool
    58  		EnableInternalTxTracing bool
    59  		Istanbul                istanbul.Config
    60  		DocRoot                 string `toml:"-"`
    61  		WsEndpoint              string `toml:",omitempty"`
    62  		TxResendInterval        uint64
    63  		TxResendCount           int
    64  		TxResendUseLegacy       bool
    65  		NoAccountCreation       bool
    66  		IsPrivate               bool
    67  		AutoRestartFlag         bool
    68  		RestartTimeOutFlag      time.Duration
    69  		DaemonPathFlag          string
    70  		RPCGasCap               *big.Int `toml:",omitempty"`
    71  		RPCEVMTimeout           time.Duration
    72  		RPCTxFeeCap             float64
    73  	}
    74  	var enc Config
    75  	enc.Genesis = c.Genesis
    76  	enc.NetworkId = c.NetworkId
    77  	enc.SyncMode = c.SyncMode
    78  	enc.NoPruning = c.NoPruning
    79  	enc.WorkerDisable = c.WorkerDisable
    80  	enc.DownloaderDisable = c.DownloaderDisable
    81  	enc.FetcherDisable = c.FetcherDisable
    82  	enc.ParentOperatorAddr = c.ParentOperatorAddr
    83  	enc.AnchoringPeriod = c.AnchoringPeriod
    84  	enc.SentChainTxsLimit = c.SentChainTxsLimit
    85  	enc.OverwriteGenesis = c.OverwriteGenesis
    86  	enc.StartBlockNumber = c.StartBlockNumber
    87  	enc.DBType = c.DBType
    88  	enc.SkipBcVersionCheck = c.SkipBcVersionCheck
    89  	enc.SingleDB = c.SingleDB
    90  	enc.NumStateTrieShards = c.NumStateTrieShards
    91  	enc.EnableDBPerfMetrics = c.EnableDBPerfMetrics
    92  	enc.LevelDBCompression = c.LevelDBCompression
    93  	enc.LevelDBBufferPool = c.LevelDBBufferPool
    94  	enc.LevelDBCacheSize = c.LevelDBCacheSize
    95  	enc.DynamoDBConfig = c.DynamoDBConfig
    96  	enc.TrieCacheSize = c.TrieCacheSize
    97  	enc.TrieTimeout = c.TrieTimeout
    98  	enc.TrieBlockInterval = c.TrieBlockInterval
    99  	enc.TriesInMemory = c.TriesInMemory
   100  	enc.SenderTxHashIndexing = c.SenderTxHashIndexing
   101  	enc.ParallelDBWrite = c.ParallelDBWrite
   102  	enc.TrieNodeCacheConfig = c.TrieNodeCacheConfig
   103  	enc.SnapshotCacheSize = c.SnapshotCacheSize
   104  	enc.SnapshotAsyncGen = c.SnapshotAsyncGen
   105  	enc.ServiceChainSigner = c.ServiceChainSigner
   106  	enc.ExtraData = c.ExtraData
   107  	enc.GasPrice = c.GasPrice
   108  	enc.Rewardbase = c.Rewardbase
   109  	enc.TxPool = c.TxPool
   110  	enc.GPO = c.GPO
   111  	enc.EnablePreimageRecording = c.EnablePreimageRecording
   112  	enc.EnableInternalTxTracing = c.EnableInternalTxTracing
   113  	enc.Istanbul = c.Istanbul
   114  	enc.DocRoot = c.DocRoot
   115  	enc.WsEndpoint = c.WsEndpoint
   116  	enc.TxResendInterval = c.TxResendInterval
   117  	enc.TxResendCount = c.TxResendCount
   118  	enc.TxResendUseLegacy = c.TxResendUseLegacy
   119  	enc.NoAccountCreation = c.NoAccountCreation
   120  	enc.IsPrivate = c.IsPrivate
   121  	enc.AutoRestartFlag = c.AutoRestartFlag
   122  	enc.RestartTimeOutFlag = c.RestartTimeOutFlag
   123  	enc.DaemonPathFlag = c.DaemonPathFlag
   124  	enc.RPCGasCap = c.RPCGasCap
   125  	enc.RPCEVMTimeout = c.RPCEVMTimeout
   126  	enc.RPCTxFeeCap = c.RPCTxFeeCap
   127  	return &enc, nil
   128  }
   129  
   130  // UnmarshalTOML unmarshals from TOML.
   131  func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
   132  	type Config struct {
   133  		Genesis                 *blockchain.Genesis `toml:",omitempty"`
   134  		NetworkId               *uint64
   135  		SyncMode                *downloader.SyncMode
   136  		NoPruning               *bool
   137  		WorkerDisable           *bool
   138  		DownloaderDisable       *bool
   139  		FetcherDisable          *bool
   140  		ParentOperatorAddr      *common.Address `toml:",omitempty"`
   141  		AnchoringPeriod         *uint64
   142  		SentChainTxsLimit       *uint64
   143  		OverwriteGenesis        *bool
   144  		StartBlockNumber        *uint64
   145  		DBType                  *database.DBType
   146  		SkipBcVersionCheck      *bool `toml:"-"`
   147  		SingleDB                *bool
   148  		NumStateTrieShards      *uint
   149  		EnableDBPerfMetrics     *bool
   150  		LevelDBCompression      *database.LevelDBCompressionType
   151  		LevelDBBufferPool       *bool
   152  		LevelDBCacheSize        *int
   153  		DynamoDBConfig          *database.DynamoDBConfig
   154  		TrieCacheSize           *int
   155  		TrieTimeout             *time.Duration
   156  		TrieBlockInterval       *uint
   157  		TriesInMemory           *uint64
   158  		SenderTxHashIndexing    *bool
   159  		ParallelDBWrite         *bool
   160  		TrieNodeCacheConfig     *statedb.TrieNodeCacheConfig
   161  		SnapshotCacheSize       *int
   162  		SnapshotAsyncGen        *bool
   163  		ServiceChainSigner      *common.Address `toml:",omitempty"`
   164  		ExtraData               []byte          `toml:",omitempty"`
   165  		GasPrice                *big.Int
   166  		Rewardbase              *common.Address `toml:",omitempty"`
   167  		TxPool                  *blockchain.TxPoolConfig
   168  		GPO                     *gasprice.Config
   169  		EnablePreimageRecording *bool
   170  		EnableInternalTxTracing *bool
   171  		Istanbul                *istanbul.Config
   172  		DocRoot                 *string `toml:"-"`
   173  		WsEndpoint              *string `toml:",omitempty"`
   174  		TxResendInterval        *uint64
   175  		TxResendCount           *int
   176  		TxResendUseLegacy       *bool
   177  		NoAccountCreation       *bool
   178  		IsPrivate               *bool
   179  		AutoRestartFlag         *bool
   180  		RestartTimeOutFlag      *time.Duration
   181  		DaemonPathFlag          *string
   182  		RPCGasCap               *big.Int `toml:",omitempty"`
   183  		RPCEVMTimeout           *time.Duration
   184  		RPCTxFeeCap             *float64
   185  	}
   186  	var dec Config
   187  	if err := unmarshal(&dec); err != nil {
   188  		return err
   189  	}
   190  	if dec.Genesis != nil {
   191  		c.Genesis = dec.Genesis
   192  	}
   193  	if dec.NetworkId != nil {
   194  		c.NetworkId = *dec.NetworkId
   195  	}
   196  	if dec.SyncMode != nil {
   197  		c.SyncMode = *dec.SyncMode
   198  	}
   199  	if dec.NoPruning != nil {
   200  		c.NoPruning = *dec.NoPruning
   201  	}
   202  	if dec.WorkerDisable != nil {
   203  		c.WorkerDisable = *dec.WorkerDisable
   204  	}
   205  	if dec.DownloaderDisable != nil {
   206  		c.DownloaderDisable = *dec.DownloaderDisable
   207  	}
   208  	if dec.FetcherDisable != nil {
   209  		c.FetcherDisable = *dec.FetcherDisable
   210  	}
   211  	if dec.ParentOperatorAddr != nil {
   212  		c.ParentOperatorAddr = dec.ParentOperatorAddr
   213  	}
   214  	if dec.AnchoringPeriod != nil {
   215  		c.AnchoringPeriod = *dec.AnchoringPeriod
   216  	}
   217  	if dec.SentChainTxsLimit != nil {
   218  		c.SentChainTxsLimit = *dec.SentChainTxsLimit
   219  	}
   220  	if dec.OverwriteGenesis != nil {
   221  		c.OverwriteGenesis = *dec.OverwriteGenesis
   222  	}
   223  	if dec.StartBlockNumber != nil {
   224  		c.StartBlockNumber = *dec.StartBlockNumber
   225  	}
   226  	if dec.DBType != nil {
   227  		c.DBType = *dec.DBType
   228  	}
   229  	if dec.SkipBcVersionCheck != nil {
   230  		c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
   231  	}
   232  	if dec.SingleDB != nil {
   233  		c.SingleDB = *dec.SingleDB
   234  	}
   235  	if dec.NumStateTrieShards != nil {
   236  		c.NumStateTrieShards = *dec.NumStateTrieShards
   237  	}
   238  	if dec.EnableDBPerfMetrics != nil {
   239  		c.EnableDBPerfMetrics = *dec.EnableDBPerfMetrics
   240  	}
   241  	if dec.LevelDBCompression != nil {
   242  		c.LevelDBCompression = *dec.LevelDBCompression
   243  	}
   244  	if dec.LevelDBBufferPool != nil {
   245  		c.LevelDBBufferPool = *dec.LevelDBBufferPool
   246  	}
   247  	if dec.LevelDBCacheSize != nil {
   248  		c.LevelDBCacheSize = *dec.LevelDBCacheSize
   249  	}
   250  	if dec.DynamoDBConfig != nil {
   251  		c.DynamoDBConfig = *dec.DynamoDBConfig
   252  	}
   253  	if dec.TrieCacheSize != nil {
   254  		c.TrieCacheSize = *dec.TrieCacheSize
   255  	}
   256  	if dec.TrieTimeout != nil {
   257  		c.TrieTimeout = *dec.TrieTimeout
   258  	}
   259  	if dec.TrieBlockInterval != nil {
   260  		c.TrieBlockInterval = *dec.TrieBlockInterval
   261  	}
   262  	if dec.TriesInMemory != nil {
   263  		c.TriesInMemory = *dec.TriesInMemory
   264  	}
   265  	if dec.SenderTxHashIndexing != nil {
   266  		c.SenderTxHashIndexing = *dec.SenderTxHashIndexing
   267  	}
   268  	if dec.ParallelDBWrite != nil {
   269  		c.ParallelDBWrite = *dec.ParallelDBWrite
   270  	}
   271  	if dec.TrieNodeCacheConfig != nil {
   272  		c.TrieNodeCacheConfig = *dec.TrieNodeCacheConfig
   273  	}
   274  	if dec.SnapshotCacheSize != nil {
   275  		c.SnapshotCacheSize = *dec.SnapshotCacheSize
   276  	}
   277  	if dec.SnapshotAsyncGen != nil {
   278  		c.SnapshotAsyncGen = *dec.SnapshotAsyncGen
   279  	}
   280  	if dec.ServiceChainSigner != nil {
   281  		c.ServiceChainSigner = *dec.ServiceChainSigner
   282  	}
   283  	if dec.ExtraData != nil {
   284  		c.ExtraData = dec.ExtraData
   285  	}
   286  	if dec.GasPrice != nil {
   287  		c.GasPrice = dec.GasPrice
   288  	}
   289  	if dec.Rewardbase != nil {
   290  		c.Rewardbase = *dec.Rewardbase
   291  	}
   292  	if dec.TxPool != nil {
   293  		c.TxPool = *dec.TxPool
   294  	}
   295  	if dec.GPO != nil {
   296  		c.GPO = *dec.GPO
   297  	}
   298  	if dec.EnablePreimageRecording != nil {
   299  		c.EnablePreimageRecording = *dec.EnablePreimageRecording
   300  	}
   301  	if dec.EnableInternalTxTracing != nil {
   302  		c.EnableInternalTxTracing = *dec.EnableInternalTxTracing
   303  	}
   304  	if dec.Istanbul != nil {
   305  		c.Istanbul = *dec.Istanbul
   306  	}
   307  	if dec.DocRoot != nil {
   308  		c.DocRoot = *dec.DocRoot
   309  	}
   310  	if dec.WsEndpoint != nil {
   311  		c.WsEndpoint = *dec.WsEndpoint
   312  	}
   313  	if dec.TxResendInterval != nil {
   314  		c.TxResendInterval = *dec.TxResendInterval
   315  	}
   316  	if dec.TxResendCount != nil {
   317  		c.TxResendCount = *dec.TxResendCount
   318  	}
   319  	if dec.TxResendUseLegacy != nil {
   320  		c.TxResendUseLegacy = *dec.TxResendUseLegacy
   321  	}
   322  	if dec.NoAccountCreation != nil {
   323  		c.NoAccountCreation = *dec.NoAccountCreation
   324  	}
   325  	if dec.IsPrivate != nil {
   326  		c.IsPrivate = *dec.IsPrivate
   327  	}
   328  	if dec.AutoRestartFlag != nil {
   329  		c.AutoRestartFlag = *dec.AutoRestartFlag
   330  	}
   331  	if dec.RestartTimeOutFlag != nil {
   332  		c.RestartTimeOutFlag = *dec.RestartTimeOutFlag
   333  	}
   334  	if dec.DaemonPathFlag != nil {
   335  		c.DaemonPathFlag = *dec.DaemonPathFlag
   336  	}
   337  	if dec.RPCGasCap != nil {
   338  		c.RPCGasCap = dec.RPCGasCap
   339  	}
   340  	if dec.RPCEVMTimeout != nil {
   341  		c.RPCEVMTimeout = *dec.RPCEVMTimeout
   342  	}
   343  	if dec.RPCTxFeeCap != nil {
   344  		c.RPCTxFeeCap = *dec.RPCTxFeeCap
   345  	}
   346  	return nil
   347  }