Skip to content

Commit 36cd396

Browse files
authoredJan 7, 2019
Merge pull request #30 from kargakis/instructions
Add more complete instructions on how to setup grin-explorer
2 parents 4839370 + 4cd0435 commit 36cd396

File tree

1 file changed

+45
-11
lines changed

1 file changed

+45
-11
lines changed
 

‎README.org

+45-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
* Grin-Explorer
22

3-
Grin-Explorer is the first block explorer for the [[http://grin-tech.org][Grin]]
3+
Grin-Explorer is the first block explorer for the [[https://grin-tech.org][Grin]]
44
blockchain. This is the source code for the instance running at
55
[[https://grinexplorer.net]].
66

7-
I hope it provides a useful service for anybody interested in grin and to its
8-
developers.
7+
I hope it provides a useful service for anybody interested in Grin and to its
8+
development.
99

1010
** Bugs, Feature Requests, etc.
1111

@@ -27,16 +27,50 @@ that repo.p
2727

2828
Python >= 3.5 and PostgreSQL >= 9.3 are required.
2929

30+
Grin is required to run as an archival node and basic auth needs to be disabled
31+
in its REST API. Set `archive_mode = true` and comment out `api_secret_path` in
32+
`grin-server.toml` respectively.
33+
3034
*** Installation
3135

32-
- Clone this repo
33-
- ~cd grin-explorer~
34-
- ~python3 -m venv venv~
35-
- ~source venv/bin/activate~
36-
- ~pip install -r requirements~
37-
- ~cd grinexplorer~
38-
- ~./manage.py runserver~
36+
Start PostgreSQL. Note that the following is just an example to run PostgreSQL,
37+
you should ensure you use your own user and credentials when setting it up.
38+
```sh
39+
sudo postgresql-setup --initdb
40+
sudo systemctl start postgresql
41+
sudo -u postgres -i
42+
# psql
43+
postgres=# \password postgres
44+
Enter new password:
45+
Enter it again:
46+
postgres=# CREATE USER myuser WITH PASSWORD 'mypass';
47+
postgres=# CREATE DATABASE mydb;
48+
postgres=# GRANT ALL PRIVILEGES ON DATABASE mydb to myuser;
49+
postgres=# \q
50+
sudo systemctl restart postgresql
51+
```
52+
53+
Start `grin-explorer`. Again, ensure you use your own credentials for Django.
54+
```sh
55+
git clone https://github.com/mimblewimble/grin-explorer
56+
cd grin-explorer
57+
python3 -m venv venv
58+
source venv/bin/activate
59+
pip install -r requirements.txt
60+
# SECRET_KEY is required by Django
61+
export SECRET_KEY=somesecretkey
62+
# PostgreSQL configuration
63+
export DB_NAME=mydb
64+
export DB_USER=myuser
65+
export DB_PASSWORD=mypass
66+
export DB_HOST=127.0.0.1
67+
export DB_PORT=5432
68+
python3 ./grinexplorer/manage.py migrate
69+
python3 ./grinexplorer/manage.py runserver
70+
```
3971

4072
*** Import blockchain
41-
- ~./manage.py import_from_tip http://127.0.0.1:13413~
73+
```sh
74+
python3 ./grinexplorer/manage.py import_from_tip http://127.0.0.1:13413
75+
```
4276

0 commit comments

Comments
 (0)
Please sign in to comment.