• GET TEST COINS
  • HARDWARE REQUIREMENTS
  • DATABASE SNAPSHOT
  • NILE CONFIG FILE

Tron

  • Releases
  • Faucet
  • How to Join
  • How to Run
  • Proposals

How to Run a Nile java-tron Node


Java-tron nodes support to be deployed on Linux or MacOS operating systems, and rely on Oracle JDK 1.8, other versions of JDK are not supported.

1. Building the Source Code:


If you have already downloaded the latest Jar package, you can skip this step.

Building java-tron requires git package and 64-bit version of Oracle JDK 1.8 to be installed, other JDK versions are not supported yet. Make sure you operate on Linux and MacOS operating systems.

Clone the repo and switch to the Nile branch
$ git clone https://github.com/tron-nile-testnet/nile-testnet.git
$ cd nile-testnet
$ git checkout -t origin/master

then run the following command to build java-tron, the FullNode.jar file can be found in java-tron/build/libs/ after build successfully.
$ ./gradlew clean build -x test

2. Hardware Requirements:


Minimum:
  • CPU with 8 cores
  • 16GB RAM
  • 150GB free storage space

Recommended:
  • CPU with 16+ cores
  • 32GB+ RAM
  • High Performance SSD with at least 200GB free space
  • 100+ MB/s download Internet service

Running java-tron requires 64-bit version of Oracle JDK 1.8 to be installed, other JDK versions are not supported yet. Make sure you operate on Linux and MacOS operating systems.

3. Download database snapshot and config file:


  • You can download the latest snapshots file at : https://database.nileex.io/
  • You can download the latest configuration file at : config-nile.conf

4. Start the nodes:


You should decompress the downloaded database snapshot and name it "output-directory" then use the following command to start it:

$ nohup java -Xms9G -Xmx9G -XX:ReservedCodeCacheSize=256m \
             -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m \
             -XX:MaxDirectMemorySize=1G -XX:+PrintGCDetails \
             -XX:+PrintGCDateStamps  -Xloggc:gc.log \
             -XX:+UseConcMarkSweepGC -XX:NewRatio=2 \
             -XX:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled \
             -XX:+HeapDumpOnOutOfMemoryError \
             -XX:+UseCMSInitiatingOccupancyOnly  -XX:CMSInitiatingOccupancyFraction=70 \
             -jar FullNode.jar -c config.conf >> start.log 2>&1 &



Test Network Configuration File:


net {
  type = mainnet
  # type = testnet
}

storage {
  # Directory for storing persistent data
  db.version = 2,
  db.engine = "LEVELDB",
  db.sync = false,
  db.directory = "database",
  index.directory = "index",
  transHistory.switch = "on",
  # 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
    //    },
  ]

  needToUpdateAsset = true

  //dbsettings is needed when using rocksdb as the storage implement (db.version=2 and db.engine="ROCKSDB").
  //we'd strongly recommend that do not modify it unless you know every item's meaning clearly.
  dbSettings = {
    levelNumber = 7
    //compactThreads = 32
    blocksize = 64  // n * KB
    maxBytesForLevelBase = 256  // n * MB
    maxBytesForLevelMultiplier = 10
    level0FileNumCompactionTrigger = 4
    targetFileSizeBase = 256  // n * MB
    targetFileSizeMultiplier = 1
  }

  //backup settings when using rocks db as the storage implement (db.version=2 and db.engine="ROCKSDB").
  //if you want to use the backup plugin, please confirm set the db.version=2 and db.engine="ROCKSDB" above.
  backup = {
    enable = false  // indicate whether enable the backup plugin
    propPath = "prop.properties" // record which bak directory is valid
    bak1path = "bak1/database" // you must set two backup directories to prevent application halt unexpected(e.g. kill -9).
    bak2path = "bak2/database"
    frequency = 10000   // indicate backup db once every 10000 blocks processed.
  }
  
  # if true, transaction cache initialization will be faster. default false
  # txCache.initOptimization = true

  # data root setting, for check data, currently, only reward-vi is used.
  merkleRoot = {
    reward-vi = b474b61f93824cd70106f8f5283fa740d61b83a7d57a3c12401d627f1fae0a77
  }
}

node.discovery = {
  enable = true
  persist = true
  bind.ip = ""
  external.ip = null
}



node.backup {
  port = 10001

  # my priority, each member should use different priority
  priority = 8

  # peer's ip list, can't contain mine
  members = [
    # "ip",
    # "ip"
  ]
}



node {
  # trust node for solidity node
  # trustNode = "ip:port"
  trustNode = "127.0.0.1:50051"

  # expose extension api to public or not
  walletExtensionApi = true

  listen.port = 18888

  connection.timeout = 2

  tcpNettyWorkThreadNum = 0

  udpNettyWorkThreadNum = 1

  # Number of validate sign thread, default availableProcessors / 2
  # validateSignThreadNum = 16

  maxConnections = 30

  minConnections = 8

  minActiveConnections = 3

  maxActiveNodesWithSameIp = 2

  maxHttpConnectNumber = 50

  minParticipationRate = 15

  zenTokenId = 1000016

  # check the peer data transfer ,disconnect factor
  disconnectNumberFactor = 0.4
  maxConnectNumberFactor = 0.8
  receiveTcpMinDataLength = 2048
  isOpenFullTcpDisconnect = true

  p2p {
    version = 201910292
  }

  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"
  ]

  # read node.active and node.passive periodically, default false
  # checkInterval unit: second
  dynamicConfig {
    # enable = false
    # checkInterval = 600
  }

  fastForward = [
  ]

  http {
    fullNodePort = 8090
    solidityPort = 8091
  }

  # use your ipv6 address for node discovery and tcp connection, default false
  # enableIpv6 = false

  # if your node's highest block num is below than all your pees', try to acquire new connection. default false
  # effectiveCheckEnable = false

  # Enable node detect
  # nodeDetectEnable = false

  dns {
    # dns urls to get nodes, url format tree://{pubkey}@{domain}, default empty
    treeUrls = [
      #"tree://APFGGTFOBVE2ZNAB3CSMNNX6RRK3ODIRLP2AA5U4YFAA6MSYZUYTQ@nodes1.example.org",
    ]
  }

  rpc {
    port = 50051
    #solidityPort = 50061
    # 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 = 1

    # The switch of the reflection service, effective for all gRPC services
    # reflectionService = true
  }

  # 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 = 8

  # Limits the maximum percentage (default 75%) of producing block interval
  # to provide sufficient time to perform other operations e.g. broadcast block
  # blockProducedTimeOut = 75

  # Limits the maximum number (default 700) of transaction from network layer
  # netMaxTrxPerSecond = 700

}

## rate limiter config
rate.limiter = {
  # Use global settings to limit the QPS of the entire node or every ip address
  # global.qps = 1000
  # global.ip.qps = 100

  # 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"
    #  },
  ]
}


seed.node = {
  # List of the seed nodes
  # Seed nodes are stable full nodes
  # example:
  # ip.list = [
  #   "ip:port",
  #   "ip:port"
  # ]
  ip.list = [
    "44.236.192.97:18888",
    "44.236.125.107:18888",
    "44.232.119.174:18888",
    "52.39.105.180:18888",
    "54.70.52.47:18888"
  ]
}

genesis.block = {
  # Reserve balance
  assets = [
    {
      accountName = "Zion"
      accountType = "AssetIssue"
      address = "TMWXhuxiT1KczhBxCseCDDsrhmpYGUcoA9"
      balance = "99000000000000000"
    },
    {
      accountName = "Sun"
      accountType = "AssetIssue"
      address = "TN21Wx2yoNYiZ7znuQonmZMJnH5Vdfxu78"
      balance = "99000000000000000"
    },
    {
      accountName = "Blackhole"
      accountType = "AssetIssue"
      address = "TDPJULRzVtzVjnBmZvfaTcTNQ2tsVi6XxQ"
      balance = "-9223372036854775808"
    }
  ]

  witnesses = [
    {
      address: TD23EqH3ixYMYh8CMXKdHyQWjePi3KQvxV,
      url = "http://GR1.com",
      voteCount = 100000026
    },
    {
      address: TCm4Lz1uP3tQm3jzpwFTG6o5UvSTA2XEHc,
      url = "http://GR2.com",
      voteCount = 100000025
    },
    {
      address: TTgDUgREiPBeY3iudD5e2eEibE4v4CE8C9,
      url = "http://GR3.com",
      voteCount = 100000024
    },
    {
      address: TFVDe7kMEmb8EuUxxp42kocQY1fFY727WS,
      url = "http://GR4.com",
      voteCount = 100000023
    },
    {
      address: TY4NSjctzTchHkhaCskVc5zQtnX9s1uxAX,
      url = "http://GR5.com",
      voteCount = 100000022
    },
    {
      address: TWSMPrm6aizvsJmPnjMB7x3UExJfRhyQhd,
      url = "http://GR6.com",
      voteCount = 100000021
    },
    {
      address: TKwLkSaCvqqpAB44qaHGTohCTCFoYw7ecy,
      url = "http://GR7.com",
      voteCount = 100000020
    },
    {
      address: TDsYmm1St9r4UZebDGWBcTMtfYTw9YX5h4,
      url = "http://GR8.com",
      voteCount = 100000019
    },
    {
      address: TFEQbWAPxhbUr1P14y9UJBUZo3LgtdqTS7,
      url = "http://GR9.com",
      voteCount = 100000018
    },
    {
      address: TCynAi8tb7UWP7uhLv6fe971KLm2KT8tcs,
      url = "http://GR10.com",
      voteCount = 100000017
    },
    {
      address: TC2YsLp4rzrt3AbeN3EryoSywrBjEUVCq3,
      url = "http://GR11.com",
      voteCount = 100000016
    },
    {
      address: THxMKH1uaL5FpURujkQR7u2sNZ2n5PSsiH,
      url = "http://GR12.com",
      voteCount = 100000015
    },
    {
      address: TWbzgoHimDcXWy19ts1An8bxA4JKjcYHeG,
      url = "http://GR13.com",
      voteCount = 100000014
    },
    {
      address: TW2LmXnVCEaxuVtQN8gZR1ixT5PNm4QLft,
      url = "http://GR14.com",
      voteCount = 100000013
    },
    {
      address: TVuqk4rYYVHVA6j6sSEnaLexhhoQhN8nyZ,
      url = "http://GR15.com",
      voteCount = 100000012
    },
    {
      address: TVMZu5ptZPhhkZ3Kaagkq35FmyuKNvUKJV,
      url = "http://GR16.com",
      voteCount = 100000011
    },
    {
      address: TFDHT8PqUrL2Bd8DeysSiHHBAEMidZgkhx,
      url = "http://GR17.com",
      voteCount = 100000010
    },
    {
      address: TVqz5Bj3M1uEenaSsw2NnXvTWChPj6K3hb,
      url = "http://GR18.com",
      voteCount = 100000009
    },
    {
      address: TSt8YNpARJkhdMdEV4C7ajH1tFHpZWzF1T,
      url = "http://GR19.com",
      voteCount = 100000008
    },
    {
      address: TTxWDjEb3Be1Ax8BCvK48cnaorZofLq2C9,
      url = "http://GR20.com",
      voteCount = 100000007
    },
    {
      address: TU5T838YtyZtEQKpnXEdRz3d8hJn6WHhjw,
      url = "http://GR21.com",
      voteCount = 100000006
    },
    {
      address: TRuSs1MpL3o2hzhU8r6HLC7WtDyVE9hsF6,
      url = "http://GR22.com",
      voteCount = 100000005
    },
    {
      address: TYMCoCZyAjWkWdUfEHg1oZQYbLKev282ou,
      url = "http://GR23.com",
      voteCount = 100000004
    },
    {
      address: TQvAyGATpLZymHbpeaRozJCKqSeRWVNhCJ,
      url = "http://GR24.com",
      voteCount = 100000003
    },
    {
      address: TYDd9nskbhJmLLNoe4yV2Z1SYtGjNa8wyg,
      url = "http://GR25.com",
      voteCount = 100000002
    },
    {
      address: TS5991Geh2qeHtw46rskpJyn6hFNbuZGGc,
      url = "http://GR26.com",
      voteCount = 100000001
    },
    {
      address: TKnn5MBnmXXeKdu9dxKVfKk4n1YdCeSRGr,
      url = "http://GR27.com",
      voteCount = 100000000
    }
  ]

  timestamp = "0" #2017-8-26 12:00:00

  parentHash = "0xe58f33f9baf9305dc6f82b9f1934ea8f0ade2defb951258d50167028c780351f"
}

// 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 =

#localwitnesskeystore = [
#  "localwitnesskeystore.json"
#]

block = {
  needSyncCheck = false
  maintenanceTimeInterval = 600000
  proposalExpireTime = 600000 //
}

# Transaction reference block, default is "head", configure to "solid" can avoid TaPos error
# trx.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.
# trx.expiration.timeInMilliseconds = 60000

vm = {
  supportConstant =true
  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
}

committee = {
  allowCreationOfContracts = 0  //mainnet:0 (reset by committee),test:1
  allowAdaptiveEnergy = 0  //mainnet:0 (reset by committee),test:1
}

event.subscribe = {
  native = {
    useNativeQueue = true // if true, use native message queue, else use event plugin.
    bindport = 5555 // bind port
    sendqueuelength = 1000 //max length of send queue
  }

  path = "" // absolute path of plugin
  server = "" // target server address to receive event triggers
  dbconfig = "" // dbname|username|password
  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"
    }
  ]

  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.
    ]
  }
}