Skip to content

Commit 14bc520

Browse files
committed
update readme and support linux
1 parent f232d5b commit 14bc520

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,73 @@ event.subscribe = {
5252
* **enable**: plugin can receive nothing if the value is false.
5353
* **topic**: the value is the kafka topic to receive events. Make sure it has been created and Kafka process is running
5454

55-
##### Run Kafka
55+
##### Install Kafka
56+
On Mac:
57+
```
58+
brew install kafka
59+
```
60+
61+
On Linux:
62+
```
63+
cd /usr/local
64+
wget http://archive.apache.org/dist/kafka/0.8.2.1/kafka_2.11-0.8.2.1.tgz
65+
tar -xzvf kafka_2.11-0.8.2.1.tgz
66+
mv kafka_2.11-0.8.2.1 kafka
67+
68+
add "export PATH=$PATH:/usr/local/kafka/bin" to end of /etc/profile
69+
source /etc/profile
5670
71+
72+
kafka-server-start.sh /usr/local/kafka/config/server.properties &
73+
```
74+
75+
76+
##### Run Kafka
77+
On Mac:
5778
```
5879
zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties & kafka-server-start /usr/local/etc/kafka/server.properties
5980
```
6081

82+
On Linux:
83+
/usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties &
84+
85+
6186
#### Create topics to receive events, the topic is defined in config.conf
6287

88+
On Mac:
6389
```
6490
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic block
6591
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic transaction
6692
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractlog
6793
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractevent
6894
```
6995

96+
On Linux:
97+
```
98+
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic block
99+
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic transaction
100+
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractlog
101+
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractevent
102+
```
103+
104+
#### Kafka consumer
105+
106+
On Mac:
107+
```
108+
kafka-console-consumer --bootstrap-server localhost:9092 --topic block --from-beginning
109+
kafka-console-consumer --bootstrap-server localhost:9092 --topic transaction --from-beginning
110+
kafka-console-consumer --bootstrap-server localhost:9092 --topic contractlog --from-beginning
111+
kafka-console-consumer --bootstrap-server localhost:9092 --topic contractevent --from-beginning
112+
```
113+
114+
On Linux:
115+
```
116+
kafka-console-consumer.sh --zookeeper localhost:2181 --topic block --from-beginning
117+
kafka-console-consumer.sh --zookeeper localhost:2181 --topic transaction --from-beginning
118+
kafka-console-consumer.sh --zookeeper localhost:2181 --topic contractlog --from-beginning
119+
kafka-console-consumer.sh --zookeeper localhost:2181 --topic contractevent --from-beginning
120+
```
121+
70122
### Load plugin in Java-tron
71123
* add --es to command line, for example:
72124
```

plugins/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ subprojects {
99
}
1010

1111
task plugin(type: Jar) {
12+
manifest {
13+
attributes 'Plugin-Class': "${pluginClass}",
14+
'Plugin-Id': "${pluginId}",
15+
'Plugin-Version': "${version}",
16+
'Plugin-Provider': "${pluginProvider}"
17+
}
18+
1219
baseName = "plugin-${pluginId}"
1320
into('classes') {
1421
with jar

0 commit comments

Comments
 (0)