-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
118 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
## K8s | ||
|
||
```bash | ||
cd ./k8s | ||
./up-dev.sh | ||
cd - | ||
|
||
#Run Sawtooth transaction processor | ||
cd ./tp | ||
npm install | ||
rm ./.env | ||
cp ./.env.minikube ./.env | ||
node ./index.js | ||
cd - | ||
``` | ||
|
||
Mongo Express: | ||
http://192.168.99.100:30081/ | ||
|
||
|
||
```bash | ||
|
||
cd ./app | ||
npm install | ||
rm ./.env | ||
cp ./.env.minikube ./.env | ||
|
||
node ./sawtooth-sub-events.js | ||
node ./sawtooth-post.js | ||
node ./sawtooth-get.js | ||
node ./mongo-sample.js | ||
|
||
|
||
#kafka | ||
node ./send.js | ||
node ./receive.js | ||
node ./send.js #Repeat | ||
cd - | ||
|
||
|
||
./down.sh | ||
|
||
``` | ||
|
||
```bash | ||
cd ./k8s | ||
./down.sh | ||
cd - | ||
``` | ||
|
||
## k8s inside cluster | ||
|
||
```bash | ||
cd ./k8s | ||
./up.sh | ||
cd - | ||
|
||
./docker-build.sh | ||
``` | ||
|
||
```bash | ||
kubectl run --rm -it borrar --image le999/app:1.0 --restart=Never -- bash | ||
|
||
cp ./.env.k8s ./.env | ||
|
||
node ./sawtooth-sub-events.js | ||
node ./sawtooth-post.js | ||
node ./sawtooth-get.js | ||
node ./mongo-sample.js | ||
|
||
|
||
#kafka | ||
node ./send.js | ||
node ./receive.js | ||
node ./send.js #Repeat | ||
|
||
``` | ||
|
||
```bash | ||
cd ./k8s | ||
./down.sh | ||
cd - | ||
``` | ||
|
||
## Details | ||
|
||
Only tested with node v10, Im not sure sawtooth SDK works for other versions | ||
|
||
|
||
## Docs Kafka | ||
https://hub.docker.com/r/bitnami/kafka/ | ||
'Accessing Kafka with internal and external clients' | ||
|
||
https://github.com/Blizzard/node-rdkafka | ||
https://kafka.apache.org/quickstart | ||
|
||
|
||
```bash | ||
|
||
docker exec -it kafka_kafka_1 bash | ||
/opt/bitnami/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper:2181 --topic mytopic --partitions 1 --replication-factor 1 | ||
/opt/bitnami/kafka/bin/kafka-topics.sh --describe --zookeeper zookeeper:2181 --topic mytopic | ||
/opt/bitnami/kafka/bin/kafka-console-producer.sh --topic mytopic --bootstrap-server localhost:9092 | ||
/opt/bitnami/kafka/bin/kafka-console-consumer.sh --topic mytopic --from-beginning --bootstrap-server localhost:9092 | ||
|
||
``` | ||
|