-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Alethio/lite-explorer-docker-compose
Lite explorer docker compose
- Loading branch information
Showing
3 changed files
with
249 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ Memento is a tool developed by Alethio to scrape and index data from any web3-co | |
|
||
The main goal of the tool is to scrape the raw data from the network, do the necessary transformations and insert it into an indexed database from which it is exposed through the integrated API. | ||
|
||
Seamless integration with the [Ethereum Lite Explorer by Alethio](https://github.com/Alethio/ethereum-lite-explorer) is coming soon to provide you the full blockchain exploration capabilities without the need of a third party. | ||
Seamless integration with the [Ethereum Lite Explorer by Alethio](https://github.com/Alethio/ethereum-lite-explorer) provides you the full blockchain exploration capabilities without the need of a third party. | ||
|
||
Easily check the system status, perform various actions and manage your configuration through the built-in dashboard. | ||
Easily check the system status, perform various actions and manage your configuration through the built-in dashboard. | ||
|
||
![memento dashboard](/web/assets/images/preview.png "Memento dashboard") | ||
|
||
|
@@ -17,10 +17,11 @@ Easily check the system status, perform various actions and manage your configur | |
- [Configuration](#configuration) | ||
- [Via dashboard](#via-dashboard) | ||
- [Via config file / command line arguments](#via-config-file--command-line-arguments) | ||
- [Installation](#installation) | ||
- [Building from source](#building-from-source) | ||
- [Running with docker-compose](#running-with-docker-compose) | ||
- [Running](#running) | ||
- [Memento with Lite Explorer](#memento-with-lite-explorer) | ||
- [Standalone via docker compose](#standalone-via-docker-compose) | ||
- [Running with Docker](#running-with-docker) | ||
- [Building from source](#building-from-source) | ||
- [Example output](#example-output) | ||
- [Result](#result) | ||
- [Example setups](#example-setups) | ||
|
@@ -107,42 +108,36 @@ REDIS_PASSWORD | |
PG_PASSWORD | ||
``` | ||
|
||
### Installation | ||
#### Building from source | ||
**Prerequisites** | ||
- a working Golang environment (tested with go v1.12.9) | ||
- requires go modules (`>=go v1.11`) | ||
- Postgres | ||
- Redis >= 5.0 | ||
- A JSON-RPC enabled and accessible Ethereum Client (Infura also works) | ||
### Running | ||
|
||
**Clone the repo** | ||
```shell script | ||
git clone [email protected]:Alethio/memento.git | ||
cd memento | ||
``` | ||
#### Memento with [Lite Explorer](https://github.com/Alethio/ethereum-lite-explorer) | ||
We've included a [docker-compose](./docker-compose-explorer.yml) that packages a full working environment with Memento and the [Ethereum Lite Explorer by Alethio](https://github.com/Alethio/ethereum-lite-explorer). | ||
|
||
**Build the executable** (it uses go modules, so it will automatically download the dependencies): | ||
Copy the config and edit it as needed. By default, the values for postgres and redis are correct for using with docker compose. | ||
```shell script | ||
make | ||
``` | ||
mkdir -p .volumes/memento | ||
mkdir -p .volumes/lite-explorer | ||
|
||
**Copy the sample configuration** and do the necessary adjustments | ||
```shell script | ||
cp config-sample.yml config.yml | ||
cp config-sample.yml .volumes/memento/config.yml | ||
cp lite-explorer.config.json .volumes/lite-explorer/config.json | ||
``` | ||
|
||
**Start scraping** :tada: | ||
Start everything | ||
```shell script | ||
./memento run --vv | ||
docker-compose up -d | ||
``` | ||
|
||
**Open the dashboard to check progress** | ||
Open the dashboard to check indexing progress | ||
``` | ||
http://localhost:3000 | ||
``` | ||
|
||
#### Running with docker-compose | ||
Open the Lite Explorer and start exploring :tada: | ||
``` | ||
http://localhost:80 | ||
``` | ||
|
||
#### Standalone via docker compose | ||
The simplest way to run the whole setup is by using the included docker compose | ||
|
||
Copy the config and edit it as needed. By default, the values for postgres and redis are correct for using with docker compose. | ||
|
@@ -182,6 +177,40 @@ Open the dashboard to check progress | |
http://localhost:3000 | ||
``` | ||
|
||
### Building from source | ||
**Prerequisites** | ||
- a working Golang environment (tested with go v1.12.9) | ||
- requires go modules (`>=go v1.11`) | ||
- Postgres | ||
- Redis >= 5.0 | ||
- A JSON-RPC enabled and accessible Ethereum Client (Infura also works) | ||
|
||
**Clone the repo** | ||
```shell script | ||
git clone [email protected]:Alethio/memento.git | ||
cd memento | ||
``` | ||
|
||
**Build the executable** (it uses go modules, so it will automatically download the dependencies): | ||
```shell script | ||
make | ||
``` | ||
|
||
**Copy the sample configuration** and do the necessary adjustments | ||
```shell script | ||
cp config-sample.yml config.yml | ||
``` | ||
|
||
**Start scraping** :tada: | ||
```shell script | ||
./memento run --vv | ||
``` | ||
|
||
**Open the dashboard to check progress** | ||
``` | ||
http://localhost:3000 | ||
``` | ||
|
||
#### Example output | ||
![image](https://user-images.githubusercontent.com/8313779/68114387-9109d600-fefe-11e9-8fd0-9666968654a7.png) | ||
|
||
|
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,43 @@ | ||
version: '3.7' | ||
services: | ||
redis: | ||
container_name: memento-redis | ||
image: redis:5.0.5-alpine | ||
restart: always | ||
command: ["redis-server", "--appendonly", "yes"] | ||
volumes: | ||
- .volumes/redis:/data | ||
postgres: | ||
container_name: memento-postgres | ||
image: postgres:11.5-alpine | ||
restart: always | ||
environment: | ||
- POSTGRES_USER=memento | ||
- POSTGRES_DB=memento | ||
- POSTGRES_PASSWORD=password | ||
volumes: | ||
- .volumes/postgresql:/var/lib/postgresql/data | ||
memento: | ||
container_name: memento | ||
image: alethio/memento:latest | ||
restart: always | ||
depends_on: | ||
- redis | ||
- postgres | ||
ports: | ||
- 127.0.0.1:3001:3001 | ||
- 127.0.0.1:3000:3000 | ||
environment: | ||
- PG_PASSWORD=password | ||
volumes: | ||
- .volumes/memento:/config | ||
explorer: | ||
container_name: memento-lite-explorer | ||
image: alethio/ethereum-lite-explorer:latest | ||
restart: always | ||
depends_on: | ||
- memento | ||
ports: | ||
- 127.0.0.1:80:80 | ||
volumes: | ||
- .volumes/lite-explorer/config.json:/usr/share/nginx/html/config.json |
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,149 @@ | ||
{ | ||
"GOOGLE_ANALYTICS_ID": null, | ||
"HOTJAR_ID": null, | ||
"SENTRY_ENABLED": false, | ||
|
||
"pluginsUrl": "plugins", | ||
|
||
"plugins": { | ||
"plugin://aleth.io/eth-common?v=2.4.0": { | ||
|
||
}, | ||
"plugin://aleth.io/3box?v=1.1.0": { | ||
"ipfsUrlMask": "https://ipfs.infura.io/ipfs/%s" | ||
}, | ||
"plugin://aleth.io/eth-memento?v=1.1.0": { | ||
"apiBasePath": "http://localhost:3001/api/explorer" | ||
} | ||
}, | ||
|
||
"pages": [{ | ||
"def": "page://aleth.io/block", | ||
"children": { | ||
"sidebar": [{ | ||
"def": "context://aleth.io/block/list", | ||
"children": [ | ||
{ "def": "module://aleth.io/block/list" } | ||
] | ||
}], | ||
"content": [{ | ||
"def": "module://aleth.io/memento/block/basic", | ||
"pageCritical": true, | ||
"children": { | ||
"confirmations": [ | ||
{ "def": "module://aleth.io/block/confirmations" } | ||
] | ||
} | ||
}, { | ||
"def": "module://aleth.io/memento/block/txs", | ||
"pageCritical": true | ||
}, { | ||
"def": "module://aleth.io/memento/block/advanced", | ||
"pageCritical": true | ||
}, { | ||
"def": "module://aleth.io/memento/block/logs-bloom", | ||
"pageCritical": true | ||
}] | ||
} | ||
}, { | ||
"def": "page://aleth.io/uncle", | ||
"children": { | ||
"content": [{ | ||
"def": "module://aleth.io/memento/uncle/details", | ||
"pageCritical": true | ||
}] | ||
} | ||
}, { | ||
"def": "page://aleth.io/tx", | ||
"children": { | ||
"sidebar": [{ | ||
"def": "context://aleth.io/memento/tx/parentBlock", | ||
"children": [{ | ||
"def": "module://aleth.io/tx/list" | ||
}] | ||
}], | ||
"content": [{ | ||
"def": "context://aleth.io/memento/tx/parentBlock", | ||
"pageCritical": true, | ||
"children": [{ | ||
"def": "module://aleth.io/memento/tx/basic", | ||
"children": { | ||
"blockConfirmations": [{ | ||
"def": "context://aleth.io/memento/tx/parentBlock", | ||
"children": [{ | ||
"def": "module://aleth.io/block/confirmations" | ||
}] | ||
}] | ||
} | ||
}, { | ||
"def": "module://aleth.io/memento/tx/advanced" | ||
}, { | ||
"def": "module://aleth.io/memento/tx/summary" | ||
}, { | ||
"def": "module://aleth.io/memento/tx/payload" | ||
}] | ||
}] | ||
} | ||
}, { | ||
"def": "page://aleth.io/account", | ||
"children": { | ||
"identicon": [{ | ||
"def": "module://aleth.io/3box/profile", | ||
"children": { | ||
"fallback": [{ "def": "module://aleth.io/account/identicon" }] | ||
} | ||
}], | ||
"top": [ | ||
{ "def": "module://aleth.io/memento/account/details", "pageCritical": true } | ||
], | ||
"bottom": [ | ||
{ "def": "module://aleth.io/memento/account/txs" }, | ||
{ "def": "module://aleth.io/memento/account/contract" } | ||
] | ||
} | ||
}, { | ||
"def": "page://aleth.io/dashboard", | ||
"children": { | ||
"content": [ | ||
{ "def": "module://aleth.io/search" }, | ||
{ | ||
"def": "context://aleth.io/dashboard/latestBlockRange", | ||
"children": [ | ||
{ | ||
"def": "module://aleth.io/dashboard/charts", | ||
"children": { | ||
"content": [{ | ||
"def": "module://aleth.io/dashboard/blocksChart", | ||
"children": { | ||
"children": [ | ||
{ | ||
"def": "context://aleth.io/block/latest", | ||
"children": [ | ||
{ "def": "module://aleth.io/dashboard/latestBlockInfo" } | ||
] | ||
} | ||
] | ||
} | ||
}] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}], | ||
|
||
"rootModules": { | ||
"toolbarTop": [{ | ||
"def": "module://aleth.io/toolbar/search" | ||
}], | ||
"toolbarBottom": [{ | ||
"def": "module://aleth.io/toolbar/feedback" | ||
}], | ||
"topbar": [{ | ||
"def": "module://aleth.io/topbar/search" | ||
}, { | ||
"def": "module://aleth.io/topbar/feedback" | ||
}] | ||
} | ||
} |