Skip to content

Instantly share code, notes, and snippets.

@andelf
Created September 20, 2020 16:27
Show Gist options
  • Save andelf/d67f07e44c9e96e38704c0cbf3d7292a to your computer and use it in GitHub Desktop.
Save andelf/d67f07e44c9e96e38704c0cbf3d7292a to your computer and use it in GitHub Desktop.
java-tron config
# The Java-Tron Configuration File
log.level = {
root = "INFO" # TRACE;DEBUG;INFO;WARN;ERROR
}
## The Chain
net {
# option: [ mainnet | testnet ]
# the address will be prefixed with "a0" on the testnet, otherwish "41" will be prefixed
type = mainnet
# type = testnet
}
crypto {
engine = "eckey" # or sm2
}
block = {
needSyncCheck = false # first node : false, other : true
maintenanceTimeInterval = 21600000 # 1 day: 86400000(ms), 6 hours: 21600000(ms)
proposalExpireTime = 259200000 # 3 day: 259200000(ms)
}
committee = {
allowCreationOfContracts = 1 # mainnet:0 (reset by committee),test:1
allowAdaptiveEnergy = 1 # mainnet:0 (reset by committee),test:1
allowShieldedTransaction = 1 # mainnet:0 (reset by committee),test:1
allowMultiSign = 1 # mainnet:0 (reset by committee),test:1
allowSameTokenName = 1
allowTvmTransferTrc10 = 1
allowTvmConstantinople = 1
allowTvmSolidity059 = 1
}
actuator.whitelist = []
## Storage
storage {
db.version = 2,
# Directory for storing persistent data
db.directory = "database",
db.engine = "ROCKSDB", # "LEVELDB"
# default false, in this mod, the WAL write is not crash safe,
# but write performance will decrease when set sync = true.
db.sync = false,
index.directory = "index", # deprecated
# index.switch = # deprecated
# transactionRet will put into transactionRetStore when turn on
transHistory.switch = "on",
# depracated, used in a previous hard fork.
needToUpdateAsset = true,
# You can custom these 14 databases' configs:
# account, account-index, asset-issue, block, block-index,
# block_KDB, peers, properties, recent-block, trans,
# utxo, votes, witness, witness_schedule.
# Otherwise, db configs will remain defualt and data will be stored in
# the path of "output-directory" or which is set by "-d" ("--output-directory").
# Attention: name is a required field that must be set !!!
properties = [
# {
# name = "account",
# path = "storage_directory_test",
# createIfMissing = true,
# paranoidChecks = true,
# verifyChecksums = true,
# compressionType = 1, # compressed with snappy
# blockSize = 4096, # 4 KB = 4 * 1024 B
# writeBufferSize = 10485760, # 10 MB = 10 * 1024 * 1024 B
# cacheSize = 10485760, # 10 MB = 10 * 1024 * 1024 B
# maxOpenFiles = 100
# },
# {
# name = "account-index",
# path = "storage_directory_test",
# createIfMissing = true,
# paranoidChecks = true,
# verifyChecksums = true,
# compressionType = 1, # compressed with snappy
# blockSize = 4096, # 4 KB = 4 * 1024 B
# writeBufferSize = 10485760, # 10 MB = 10 * 1024 * 1024 B
# cacheSize = 10485760, # 10 MB = 10 * 1024 * 1024 B
# maxOpenFiles = 100
# },
]
# required when db.version = 2, and db.engine = "ROCKSDB"
dbSettings = {
levelNumber = 7
compactThreads = 4
blocksize = 64 # n * KB
maxBytesForLevelBase = 256 # n * MB
maxBytesForLevelMultiplier = 10
level0FileNumCompactionTrigger = 4
targetFileSizeBase = 256 # n * MB
targetFileSizeMultiplier = 1
}
backup = {
enable = false
# propPath =
# bak1path =
# bak2path =
# frequency =
}
}
## Node Settings
seed.node = {
# List of the seed nodes. This is used to enable the node can connect when join one net at first.
# If you deploy one private net, you must add some "ip:port" here for other node connecting.
# Seed nodes are stable full nodes, and the first SuperNode must be inclued in.
# example:
# ip.list = [
# "ip:port",
# "ip:port"
# ]
ip.list = [
"127.0.0.1:16666",
]
}
# this part of config is used to node discovery.
node.discovery = {
enable = true # you should set this entry value with ture if you want your node can be discovered by other node.
persist = true # this entry is used to determined to whether storing the peers in the database or not.
bind.ip = ""
external.ip = null # or external binding ip
}
node {
# 11111: mainnet; 20180622: testnet;
p2p.version = 20200208
# p2p listen port
listen.port = 16666
connection.timeout = 2
# trust node for solidity node
# trustNode = "ip:port"
trustNode = "127.0.0.1:40051"
# expose extension api to public or not
walletExtensionApi = true
tcpNettyWorkThreadNum = 0
udpNettyWorkThreadNum = 1
# Number of validate sign thread, default availableProcessors / 2
# validateSignThreadNum = 16
# sync pool
connectFactor = 0.3
activeConnectFactor = 0.1
# The maximum number of nodes that the current node can establish a connection
maxActiveNodes = 30
maxActiveNodesWithSameIp = 2
minParticipationRate = 0
# shielded transaction
fullNodeAllowShieldedTransaction = true
zenTokenId = 1000001
# check the peer data transfer, disconnect factor
disconnectNumberFactor = 0.4
maxConnectNumberFactor = 0.8
receiveTcpMinDataLength = 2048
isOpenFullTcpDisconnect = true
# Limits the maximum percentage (default 75%) of producing block interval
# to provide sufficient time to perform other operations e.g. broadcast block
# blockProducedTimeOut = 75
# maxHttpConnectNumber =
# Limits the maximum number (default 700) of transaction from network layer
netMaxTrxPerSecond = 1400
# number of solidity thread in the FullNode.
# If accessing solidity rpc and http interface timeout, could increase the number of threads,
# The default value is the number of cpu cores of the machine.
# solidity.threads = 4
active = [
# Active establish connection in any case
# Sample entries:
# "ip:port",
# "ip:port"
]
passive = [
# Passive accept connection in any case
# Sample entries:
# "ip:port",
# "ip:port"
]
fastForward = [
# "100.26.245.209:18888",
# "15.188.6.125:18888"
]
http = {
fullNodeEnable = true
fullNodePort = 8090
solidityEnable = false
# solidityPort = 8091
}
rpc = {
port = 0
solidityPort = 0 # useless, use random port
# Number of gRPC thread, default availableProcessors / 2
# thread = 16
# The maximum number of concurrent calls permitted for each incoming connection
# maxConcurrentCallsPerConnection =
# The HTTP/2 flow control window, default 1MB
# flowControlWindow =
# Connection being idle for longer than which will be gracefully terminated
maxConnectionIdleInMillis = 60000
# Connection lasting longer than which will be gracefully terminated
# maxConnectionAgeInMillis =
# The maximum message size allowed to be received on the server, default 4MB
# maxMessageSize =
# The maximum size of header list allowed to be received, default 8192
# maxHeaderListSize =
# Transactions can only be broadcast if the number of effective connections is reached.
minEffectiveConnection = 0
}
# this part of config is used to set backup node for witness service.
backup = {
priority = 8
port = 10001 # udp port
# peer ip list
members = [
]
}
}
## API Rate Limiter
rate.limiter = {
# Every api could be set a specific rate limit strategy. Three strategy are supported:GlobalPreemptibleAdapter、IPQPSRateLimiterAdapte、QpsRateLimiterAdapter
# GlobalPreemptibleAdapter: permit is the number of preemptible resource, every client must apply one resourse
# before do the request and release the resource after got the reponse automaticlly. permit should be a Integer.
# QpsRateLimiterAdapter: qps is the average request count in one second supported by the server, it could be a Double or a Integer.
# IPQPSRateLimiterAdapter: similar to the QpsRateLimiterAdapter, qps could be a Double or a Integer.
# If do not set, the "default strategy" is set.The "default startegy" is based on QpsRateLimiterAdapter, the qps is set as 10000.
#
# Sample entries:
#
http = [
# {
# component = "GetNowBlockServlet",
# strategy = "GlobalPreemptibleAdapter",
# paramString = "permit=1"
# },
# {
# component = "GetAccountServlet",
# strategy = "IPQPSRateLimiterAdapter",
# paramString = "qps=1"
# },
# {
# component = "ListWitnessesServlet",
# strategy = "QpsRateLimiterAdapter",
# paramString = "qps=1"
# }
],
rpc = [
# {
# component = "protocol.Wallet/GetBlockByLatestNum2",
# strategy = "GlobalPreemptibleAdapter",
# paramString = "permit=1"
# },
# {
# component = "protocol.Wallet/GetAccount",
# strategy = "IPQPSRateLimiterAdapter",
# paramString = "qps=1"
# },
# {
# component = "protocol.Wallet/ListWitnesses",
# strategy = "QpsRateLimiterAdapter",
# paramString = "qps=1"
# },
]
}
## The Genesis Block
genesis.block = {
# Reserve balance
assets = [
{
accountName = "Alice"
accountType = "AssetIssue"
address = "TCLBgkbfVkJroVBJVqBEsxtPNQEQMTQCLQ"
balance = "95000000000000000"
},
{
accountName = "Bob"
accountType = "AssetIssue"
address = "TBvJUBXorwBPzqvV38vjDgegj5Eh6g2Tsq"
balance = "5000000000000000"
},
{
accountName = "Carol"
accountType = "AssetIssue"
address = "TLfuw4tRywtxCusvTudbjf7PbcXjfe7qrw"
balance = "1000000000000000"
},
{
accountName = "Dave"
accountType = "AssetIssue"
address = "TWa5cxQFesyCQUm17usvHrVkKce6rMCV4H"
balance = "1000000000000000"
},
{
accountName = "Erin"
accountType = "AssetIssue"
address = "TVwvLcXD1WTK2gegh7tZ5Fxocfo8GttHgL"
balance = "1000000000000000"
},
{
accountName = "Frank"
accountType = "AssetIssue"
address = "TRsbuxREXKJKonexpejWhacE4sYHt1BSHV"
balance = "1000000000000000"
},
{
accountName = "Blackhole"
accountType = "AssetIssue"
# 410000000000000000000000000000000000000000
address = "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb"
balance = "-9223372036854775808"
},
]
witnesses = [
{
address: "TBvJUBXorwBPzqvV38vjDgegj5Eh6g2Tsq",
url = "https:://222.com",
voteCount = 10000
},
]
timestamp = "0" # unix timestamp_ms
# 256-bit hash
parentHash = "0000000000000000000000000000000000000000000000000000000000000001"
}
## Witness
# Optional.The default is empty.
# It is used when the witness account has set the witnessPermission.
# When it is not empty, the localWitnessAccountAddress represents the address of the witness account,
# and the localwitness is configured with the private key of the witnessPermissionAddress in the witness account.
# When it is empty,the localwitness is configured with the private key of the witness account.
# localWitnessAccountAddress =
# Optional. private key is needed if node is a witness.
# There are three ways to set the private key.
# 1. set --private-key in startup command
# 2. set private key in localwitness
# 3. using private key stored in localwitnesskeystore
# Priority order 1 > 2 > 3
localwitness = [
"2222222222222222222222222222222222222222222222222222222222222222"
]
#localwitnesskeystore = [
# "src/main/resources/localwitnesskeystore.json"
#]
### Transaction Hanlding
trx = {
# Transaction reference block, default is "head", configure to "solid" can avoid TaPoS error
# reference.block = "head" # head; solid;
# This property sets the number of milliseconds after the creation of the transaction that is expired, default value is 60000.
# expiration.timeInMilliseconds = 60000
}
vm = {
# Whether support trigger a constant contract. If transaction is a constant contract, fullnode will perform the transaction locally
# and return it with the result directly other than broadcast the transaction when supportConstant = true
supportConstant = false
# cpu rate for execute a transaction in VM
minTimeRatio = 0.0
maxTimeRatio = 5.0
saveInternalTx = true
# In rare cases, transactions that will be within the specified maximum execution time (default 10(ms)) are re-executed and packaged
# longRunningTime = 10
# vmTrace = false
}
## Event Subscribe
event.subscribe = {
# Use native queue
native = {
useNativeQueue = true # if true, use native message queue, else use event plugin.
bindport = 5555 # bind port
sendqueuelength = 1000 # max length of send queue
}
# Or event plugin
path = "" # absolute path of plugin
server = "" # target server address to receive event triggers
dbconfig = "" # dbname|username|password
# whether format the output of the contract
contractParse = true,
topics = [
{
triggerName = "block" # block trigger, the value can't be modified
enable = false
topic = "block" # plugin topic, the value could be modified
},
{
triggerName = "transaction"
enable = false
topic = "transaction"
},
{
triggerName = "contractevent"
enable = false
topic = "contractevent"
},
{
triggerName = "contractlog"
enable = false
topic = "contractlog"
},
{
triggerName = "solidity" # solidity block event trigger, the value can't be modified
enable = true # the default value is true
topic = "solidity"
}
]
filter = {
fromblock = "" # the value could be "", "earliest" or a specified block number as the beginning of the queried range
toblock = "" # the value could be "", "latest" or a specified block number as end of the queried range
contractAddress = [
"" # contract address you want to subscribe, if it's set to "", you will receive contract logs/events with any contract address.
]
contractTopic = [
"" # contract topic you want to subscribe, if it's set to "", you will receive contract logs/events with any contract topic.
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment