You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/implement-a-customized-actuator-en.md
+38-31Lines changed: 38 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,13 +36,19 @@ message Transaction {
36
36
AccountCreateContract = 0;
37
37
TransferContract = 1;
38
38
........
39
-
SumContract = 52;
39
+
SumContract = 60;
40
40
}
41
41
...
42
42
}
43
43
```
44
44
45
-
Then register a function to ensure that gRPC can receive and identify the requests of this contract. Currently, gRPC protocols are all defined in `src/main/protos/api/api.proto`. To add an `InvokeSum` interface in Wallet Service:
45
+
Then register a function to ensure that gRPC can receive and identify the requests of this contract. Currently, gRPC protocols are all defined in `src/main/protos/api/api.proto`. First add the import for the new proto file at the top of `api.proto`:
46
+
47
+
```protobuf
48
+
import "core/contract/math_contract.proto";
49
+
```
50
+
51
+
Then add an `InvokeSum` interface in the Wallet service:
46
52
47
53
```protobuf
48
54
service Wallet {
@@ -60,13 +66,11 @@ service Wallet {
60
66
```
61
67
At last, recompile the modified proto files. Compiling the java-tron project directly will compile the proto files as well, `protoc` command is also supported.
62
68
63
-
*Currently, java-tron uses protoc v3.4.0. Please keep the same version when compiling by `protoc` command.*
64
-
65
69
```shell
66
-
# recommended
70
+
# recommended — also recompiles proto files automatically
67
71
./gradlew build -x test
68
72
69
-
# or build via protoc
73
+
# or build via protoc (ensure the protoc version matches the one declared in build.gradle)
@@ -78,7 +82,11 @@ After compilation, the corresponding .class under the java_out directory will be
78
82
79
83
For now, the default Actuator supported by java-tron is located in `org.tron.core.actuator`. Creating `SumActuator` under this directory:
80
84
85
+
> **Note**: The Actuator must be placed in the `org.tron.core.actuator` package. At node startup, `TransactionRegister.registerActuator()` uses reflection to scan that package and auto-discovers every `AbstractActuator` subclass. Each subclass is instantiated once (triggering the `super()` constructor which calls `TransactionFactory.register()`), so no manual registration code is needed.
Copy file name to clipboardExpand all lines: docs/modular-deployment-en.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# How to deploy java-tron after modularization
2
2
3
-
After modularization, java-tron is launched via shell script instead of typing command: `java -jar FullNode.jar`.
3
+
After modularization, the recommended way to launch java-tron is via the shell script generated in `bin/`. The classic `java -jar FullNode.jar` command is still fully supported as an alternative.
4
4
5
-
*`java -jar FullNode.jar` still works, but will be deprecated in future*.
5
+
> **Supported platforms**: Linux and macOS. Windows is not supported.
6
6
7
7
## Download
8
8
@@ -29,7 +29,7 @@ After unzip, two directories will be generated in java-tron: `bin` and `lib`, sh
29
29
30
30
## Startup
31
31
32
-
Use the corresponding script to start java-tron according to the OS type, use `*.bat` on Windows, Linux demo is as below:
32
+
Use the shell script to start java-tron (Linux / macOS):
A modularized java-tron consists of six modules: framework, protocol, common, chainbase, consensusand actuator. The function of each module is elaborated below.
19
+
A modularized java-tron consists of eight modules: framework, protocol, common, chainbase, consensus, actuator, crypto and plugins. The function of each module is elaborated below.
20
20
21
21
### framework
22
22
@@ -67,4 +67,11 @@ Actuator module defines the `Actuator` interface, which includes 4 different met
67
67
4. calcFee: define the logic of calculating transaction fees
68
68
69
69
Depending on their businesses, developers may set up Actuator accordingly and customize the processing of different types of transactions.
70
-
70
+
71
+
### crypto
72
+
73
+
Crypto module encapsulates cryptographic primitives used across the project, including elliptic curve key operations, hash functions and signature verification. It depends only on `common` and has no dependency on other business modules, keeping cryptographic logic isolated and auditable.
74
+
75
+
### plugins
76
+
77
+
Plugins module provides standalone operational tools packaged as independent executable JARs, such as `Toolkit.jar` and `ArchiveManifest.jar`. These tools support database maintenance tasks like migration, compaction and lite-node data pruning, and can be run without starting a full node.
0 commit comments