This repository hosts custom Dockerfiles for building java-tron images that are more container-friendly and works out of the box.
Images are built with GitHub Actions. Available here.
Blockchain data are stored in /data
. No volume is mounted by default. Mount a volume to /data
for data persistence, or you'll lose data once the container is removed.
For example, you can use an existing output-directory
on your host system at /your/output-directory
with:
$ docker run -v /your/output-directory:/data sunstake/java-tron
Running a local, single-node test network can be helpful for developing and testing decentralized applications. With docker-java-tron
you can do it with a simple command by setting NETWORK
to dev
and enabling witness mode:
$ docker run -e NETWORK=dev -e WITNESS_MODE=true -p 8090:8090 sunstake/java-tron
Once the node is up you can access it like:
$ curl -X POST http://localhost:8090/wallet/getnowblock
The local network contains a witness account with a lot of test TRX:
Private Key: da146374a75310b9666e834ee4ad0866d6f4035967bfc76217c5a495fff9f0d0
Address: TPL66VK2gCXNCD7EJg9pgJRfqcRazjhUZY
Configuration can be done via environment variables. The entry script modifies the config file on the fly before the node is run.
The Tron network to connect to.
Options:
mainnet
(default)nile
dev
(local single-node test network)
The port on which the node listens on for P2P networking. Defaults to 18888
.
The port on which the node serves full node HTTP API. Defaults to 8090
.
The port on which the node serves solidity node HTTP API. Defaults to 8091
.
TVM time ratio to avoid timeout. See this issue. Defaults to 5.0
.
NOTE
This option is only supported on version
4.1.1
or higher.
Whether to enable witness mode (block producer), useful for running a local test network.
Options:
true
false
(default)
Whether to enable the Kafka event plugin.
Options:
true
false
(default)
Kafka server address for the event plugin. Mandatory if EVENT_PLUGIN_ENABLED
is true
.
Whether to enable the block
trigger for the event plugin.
Options:
true
false
(default)
Whether to enable the transaction
trigger for the event plugin.
Options:
true
false
(default)
Whether to enable the contractevent
trigger for the event plugin.
Options:
true
false
(default)
Whether to enable the contractlog
trigger for the event plugin.
Options:
true
false
(default)
Whether to enable the solidity
trigger for the event plugin.
Options:
true
false
(default)
Whether to enable the solidityevent
trigger for the event plugin.
Options:
true
false
(default)
Whether to enable the soliditylog
trigger for the event plugin.
Options:
true
false
(default)
Contract address filter for the event plugin. Multiple addresses are separated by space. By default no filter is applied.
Contract topic filter for the event plugin. Multiple topics are separated by space. By default no filter is applied.