Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chriamue/whisper-example
Docker compose environment and example for whisper.
https://github.com/chriamue/whisper-example
docker-compose geth p2p-network shh web3js whisper
Last synced: 17 days ago
JSON representation
Docker compose environment and example for whisper.
- Host: GitHub
- URL: https://github.com/chriamue/whisper-example
- Owner: chriamue
- License: unlicense
- Created: 2020-01-26T11:42:31.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:13:47.000Z (almost 2 years ago)
- Last Synced: 2024-07-30T21:03:15.744Z (3 months ago)
- Topics: docker-compose, geth, p2p-network, shh, web3js, whisper
- Language: JavaScript
- Size: 2.06 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# whisper-example
Docker compose environment and example for whisper.## Environment Init
A bootnode key was generated:
```bash
docker run --rm -v ${PWD}/bootnode/:/bootnode/:rw --entrypoint bootnode ethereum/client-go:alltools-v1.9.10 "-genkey=/bootnode/bootnode.key"
```New accounts where generated
```bash
docker-compose run --rm geth account new
```resulting in
```
Your new key was generatedPublic address of the key: 0x367E3Ac27dAf7595f5A62F0de74c37f15D459D45
Path of the secret key file: /keystore/UTC--2020-01-26T12-13-41.627717698Z--367e3ac27daf7595f5a62f0de74c37f15d459d45
```A second account was generated
```bash
docker-compose run --rm geth account new
```resulting
```
Your new key was generatedPublic address of the key: 0x771552299F38E66403371BE507189FB491cE8D2a
Path of the secret key file: /keystore/UTC--2020-01-26T12-15-05.597330011Z--771552299f38e66403371be507189fb491ce8d2a
```Warning: Never use these accounts outside this example.
A genesis file was created using puppeth.
```bash
docker-compose up --rm puppeth
```The genesis file was exported.
The nodes have to be initialized using the genesis file:
```bash
docker-compose run --no-deps --rm node1 init /genesis.json
docker-compose run --no-deps --rm node2 init /genesis.json
```## generate new keys
```bash
docker-compose run --rm geth account new
```## run
To send a message from app2 to app1 start the nodes.
```bash
docker-compose up -d node1
docker-compose up -d node2
```Wait some seconds the nodes can find each other using the bootnode.
Start the first app.
```bash
docker-compose up app1
```In another terminal start the second sending app.
```bash
docker-compose up app2
```App 2 will send Hello World! which will be printed on app 1.