mimblewimble / grin-explorer Goto Github PK
View Code? Open in Web Editor NEWBlockchain explorer for grin
License: GNU Affero General Public License v3.0
Blockchain explorer for grin
License: GNU Affero General Public License v3.0
Hello,
When I tried to execute command 'pip install -r requirements.txt' I got error:
Do you have any ideas?
Can psycopg2-binary be replaced for psycopg2?
`grinviet@bangnode1:$ cd grin-explorer/grin-explorer$ python3 -m venv venv
grinviet@bangnode1:
grinviet@bangnode1:/grin-explorer$ source venv/bin/activate/grin-explorer$ pip install -r requirements.txt
(venv) grinviet@bangnode1:
Requirement already satisfied: Django==2.2.24 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (2.2.24)
Collecting psycopg2==2.8.6
Using cached psycopg2-2.8.6.tar.gz (383 kB)
Requirement already satisfied: requests==2.20.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (2.20.0)
Requirement already satisfied: django_chartit==0.2.9 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 4)) (0.2.9)
Requirement already satisfied: sqlparse>=0.2.2 in ./venv/lib/python3.8/site-packages (from Django==2.2.24->-r requirements.txt (line 1)) (0.4.1)
Requirement already satisfied: pytz in ./venv/lib/python3.8/site-packages (from Django==2.2.24->-r requirements.txt (line 1)) (2021.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./venv/lib/python3.8/site-packages (from requests==2.20.0->-r requirements.txt (line 3)) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.8/site-packages (from requests==2.20.0->-r requirements.txt (line 3)) (2021.5.30)
Requirement already satisfied: idna<2.8,>=2.5 in ./venv/lib/python3.8/site-packages (from requests==2.20.0->-r requirements.txt (line 3)) (2.7)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in ./venv/lib/python3.8/site-packages (from requests==2.20.0->-r requirements.txt (line 3)) (1.24.3)
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/grinviet/grin-explorer/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1k1oyfoq/psycopg2_df9110f2abf94ef9a904f31bf5f57f45/setup.py'"'"'; file='"'"'/tmp/pip-install-1k1oyfoq/psycopg2_df9110f2abf94ef9a904f31bf5f57f45/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-4j97i64s
cwd: /tmp/pip-install-1k1oyfoq/psycopg2_df9110f2abf94ef9a904f31bf5f57f45/
Complete output (40 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/init.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120007 -DHAVE_LO64=1 -I/home/grinviet/grin-explorer/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.h>
| ^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
https://www.psycopg.org/docs/install.html).
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /home/grinviet/grin-explorer/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1k1oyfoq/psycopg2_df9110f2abf94ef9a904f31bf5f57f45/setup.py'"'"'; file='"'"'/tmp/pip-install-1k1oyfoq/psycopg2_df9110f2abf94ef9a904f31bf5f57f45/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-i_iae1wj/install-record.txt --single-version-externally-managed --compile --install-headers /home/grinviet/grin-explorer/venv/include/site/python3.8/psycopg2
cwd: /tmp/pip-install-1k1oyfoq/psycopg2_df9110f2abf94ef9a904f31bf5f57f45/
Complete output (40 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/init.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120007 -DHAVE_LO64=1 -I/home/grinviet/grin-explorer/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.h>
| ^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/grinviet/grin-explorer/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1k1oyfoq/psycopg2_df9110f2abf94ef9a904f31bf5f57f45/setup.py'"'"'; file='"'"'/tmp/pip-install-1k1oyfoq/psycopg2_df9110f2abf94ef9a904f31bf5f57f45/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-i_iae1wj/install-record.txt --single-version-externally-managed --compile --install-headers /home/grinviet/grin-explorer/venv/include/site/python3.8/psycopg2 Check the logs for full command output.
`
I removed .grin and after a couple of hours running latest testnet1 code, I'm seeing " 1 / 4 / 320" peers, can't get any more good ones and ping/pong lines show 0 @ 0 vs us 135 645 922 @ 15032
and a single node stuck at 35 432 595 @ 0
Meanwhile, gitter chat talks about seeing >8 healthy peers and grinexplorer is at 138 194 082 @ 20429 so my node is clearly behind, just can't find the healthy nodes. Maybe because I'm only talking to nodes already banned by the more long-running healthy ones. Either way, exposing the grin explorer list of known good nodes in a best-effort way could be very helpful.
Maybe format it like grin server -s $IP:$PORT start
.
Note: It seems multiple server start
commands won't work without stopping your grin server in between, so the instruction should be: stop grin, then grin server ...
and it's not very automation-friendly yet. Maybe mimblewimble/grin#218 will mean adding a feature that accepts an ip:port that gets queued up to be asked for peers, and that could be used for reviving a stuck node like mine currently is (at height 15xxx for hours and hours).
I'm also thinking we'd want the total difficulty formatted somehow to make it more readable, maybe grouping together every 3 digits (western) or 4 digits (asian). Maybe just make it a slight color difference in the explorer.
Should also work for the partial hashes from the debug output:
Dec 09 13:12:29.954 DEBG Requesting block f260933e from peer 37.59.48.28:13414
Cycles in cuckooN are scaled with (N-1)*2^(N-30) in difficulty. Should update difficulty accordingly.
It would be nice to see more information of the node in the health
section. Information like: Header and Network height, inbound and outbound connections and the status of the node, maybe.
The idea being, if you can ask the node that is first to know about a block, you should peer with either that node, or one of it's closest peers.
If you also can get to know the ip:port of a node that is much slower at getting that block, then you could on purpose place your newly spun up, but reliably hosted node, as a go-between and connect to both of these, making the gossip network scale better as a result.
On our explorer https://www.grinmint.com/explorer/ we have this graph.
Which doesn't looks like https://grinexplorer.net and I'm assuming that's why the page takes a very long time to load.
Is there a specific configuration to reduce the range (or have something that looks like what you have @hendi)?
Maybe grinexplorer could have an output with the most up to date list of seemingly unwanted peers.
This could be formatted like a dynamic "getting started with grin" kind of living documentation, that gets autogenerated from the last known grin network situation.
By formatting it as one peer per row, curl -X POST http://localhost:13413/v1/peers/$IP:$PORT/ban
, anyone having trouble syncing up or who want to avoid a lot of gossiping with outdated peers could copy&paste the list to their local node. This is meant as a help in messy situations when a breaking update has been made and lots of nodes are not yet updated.
Note that grin's ban API endpoint is currently "forever" but will become time limited, but until that is done, it might also be a good idea to keep a note about cleaning out the ban list manually by removing .grin/peers as soon as you've got your node synced up.
Currently grin-explorer warn about forks sometimes older than 1000. I would say warning about less than 60 blocks seems okay but not more than that.
For example -
https://grinexplorer.net/block/5df58803ba2df2eb3f649bd1cae11e93ffb8f649b075169fd0709764a4a2046c
Block reward is 50 grin
Fees should be considerably less than that (milligrins?)
Given a block (hash) it would be useful to be able to view all chains (all heads of chains?) that include this block.
We see a lot of forks in testnet1 - and it would be great if we could know what forked off ahead of a given block.
So a node operator could see what is ahead of them during syncing or if they appear to be on the wrong fork.
Hello,
I just built a new explorer https://scan.grin.money and the remaining issue is that the chart only show 3 recent days data and it only has the heights data last 3 days. I already enabled my node to archive mode. I wonder how can my node have data from genesis blocks like https://grinexplorer.net/?
Is it possible to have your exported data in postgresql or your full blockchain directory data_chain?
Thank you.
Traceback (most recent call last):
File "./manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/home/quentinlesceller/grin-explorer/grinexplorer/blockchain/management/commands/import_from_tip.py", line 38, in handle
(status, block_hash, prev_hash) = self.fetch_and_store_block(hash, parent)
File "/home/quentinlesceller/grin-explorer/grinexplorer/blockchain/management/commands/import_from_tip.py", line 79, in fetch_and_store_block
**block_data["header"],
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/query.py", line 413, in create
obj.save(force_insert=True, using=self.db)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/base.py", line 718, in save
force_update=force_update, update_fields=update_fields)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/base.py", line 748, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/base.py", line 831, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/base.py", line 869, in _do_insert
using=using, raw=raw)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/query.py", line 1136, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1289, in execute_sql
cursor.execute(sql, params)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/quentinlesceller/miniconda3/lib/python3.7/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
django.db.utils.DataError: integer out of range
As a node operator it would be really useful to view blocks (chain heads?) that are known about that have higher total_difficulty than me.
Particularly in testnet1 with the wide variety of forks in play right now.
Just a reminder to @hendi as requested.
After Update to Testnet2 #14 we need to compute the difficulty from the total difficulty.
See mimblewimble/grin#777 for reference.
TLDR:
let target_difficulty = header.total_difficulty.clone() - prev.total_difficulty.clone();
If I'm trying to find exactly when a particularly transaction happened, or if it was ever broadcast at all, it would be great to be able to search by commit and then have it bring up the relevant block. Otherwise I would have to guess
I SENT 7,569 GRIN TO MY GATE ACCOUNT ON 01.05.2023.
BUT OUTPUTS WERE NOT CREATED BECAUSE I DID NOT WRITE THE GATE MEMO CODE.
GRIN DID NOT COME BACK TO MY WALLET AND IT DID NOT COME TO MY GATE ACCOUNT. GATE WANTS OUTPUTS FROM ME, CAN YOU HELP ME?
ACCOUNT TO SEND : grin1r0h47e3gh254yt2sr5xvqlgtxyhu4eccl7442v6rrxp8et9maucs0nx2md
SLATE : 4cf53a63-6583-4b31-a573-7a9daf4fdb03
Kernels : 0866507dd1e9f5beb672e8182c7ff24899cbe1e9f9281594887cc4d9316bc08b20
OUTPUTS : NO DATA CREATED
SENT ACCOUNT : grin1n26np6apy07576qx6yz4qayuwxcpjvl87a2mjv3jpk6mnyz8y4vq65ahjm
file:///C:/Users/Casper/Desktop/transactions.json
After restarting the process, I get this
$ python3 ./grinexplorer/manage.py import_from_tip http://127.0.0.1:13413
height=10919, tip=01eb56a93f0c82bc9938ff7788960ac38613e266d4a171cbe43cd372f6012e5b
Stored block 01eb56a93f0c82bc9938ff7788960ac38613e266d4a171cbe43cd372f6012e5b @ 10919
Stored block 013aa818df9edca4f235c751a02edaf601784520476dc6b39b717078f2a6cd4e @ 10918
Marked block 013aa8 as previous of block 01eb56
Stored block 003ca230fec9f7c83226c178c8cb27901b54a3375858f9cf8c00f093e7eafe01 @ 10917
Marked block 003ca2 as previous of block 013aa8
Stored block 02369cb2055ad587884462ed66098ba400bb89191ba7c3c63b5f5a57b9ece87e @ 10916
Marked block 02369c as previous of block 003ca2
Stored block 011711091da6ea588ed4b757cee63fdd3cd4ced535da30a957c2ea3d07f52f14 @ 10915
Marked block 011711 as previous of block 02369c
Stored block 01d6ce01291bdab0a02951bd9ed044842b855da9de10f01096a9707778376657 @ 10914
Marked block 01d6ce as previous of block 011711
Block 02dee96cbcf6edeec5653b12fda07702db26b09a2742a2ae6b1e86dc9aea3806 already exists @ 10913
Stored block 02dee9 as previous of block 01d6ce
== exiting early
Originally posted by @Kargakis in #33 (comment)
E.g. https://www.grinmint.com/output/080f1bd3cf9d2734c7557ee499d66696a0d583928c0f6fc6df0bdea67502301d30 or https://grinexplorer.net/output/09809f26e8057766c093e9603630ba13bbd7798c68d7e03eea111d835a866df724 should be a 404 instead of a 500. Should be relatively easy to fix.
Since mimblewimble/grin#954 there is a total kernel offset in Block API.
Currently this difference makes the import function crash.
Feature request:
Monitoring of STRATUM server in order to add to each block which pool did mine this block.
This would allow you at the same time to provide some statistics about mining distribution of GRIN network.
I've noticed a heavy load on our database simply to display the list of blocks.
The query is the following:
SELECT "blockchain_block"."hash", "blockchain_block"."version", "blockchain_block"."height", "blockchain_block"."previous_id", "blockchain_block"."prev_root", "blockchain_block"."timestamp", "blockchain_block"."output_root", "blockchain_block"."range_proof_root", "blockchain_block"."kernel_root", "blockchain_block"."nonce", "blockchain_block"."edge_bits", "blockchain_block"."cuckoo_solution", "blockchain_block"."total_difficulty", "blockchain_block"."secondary_scaling", "blockchain_block"."total_kernel_offset", T2."hash", T2."version", T2."height", T2."previous_id", T2."prev_root", T2."timestamp", T2."output_root", T2."range_proof_root", T2."kernel_root", T2."nonce", T2."edge_bits", T2."cuckoo_solution", T2."total_difficulty", T2."secondary_scaling", T2."total_kernel_offset" FROM "blockchain_block" LEFT OUTER JOIN "blockchain_block" T2 ON ("blockchain_block"."previous_id" = T2."hash") ORDER BY "blockchain_block"."timestamp" DESC LIMIT 20;
This query is extremely expensive and very slow even on a powerful db (like 10s to compute). I am wondering whether we are missing an index somewhere.
Here is the table description:
explorer=> \d+ blockchain_block
Table "public.blockchain_block"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
---------------------+--------------------------+-----------+----------+---------+----------+--------------+-------------
hash | character varying(64) | | not null | | extended | |
version | integer | | not null | | plain | |
height | integer | | not null | | plain | |
timestamp | timestamp with time zone | | not null | | plain | |
output_root | character varying(64) | | not null | | extended | |
range_proof_root | character varying(64) | | not null | | extended | |
kernel_root | character varying(64) | | not null | | extended | |
nonce | text | | not null | | extended | |
total_difficulty | bigint | | not null | | plain | |
previous_id | character varying(64) | | | | extended | |
total_kernel_offset | character varying(64) | | not null | | extended | |
edge_bits | integer | | not null | | plain | |
cuckoo_solution | bigint[] | | not null | | extended | |
prev_root | character varying(64) | | not null | | extended | |
secondary_scaling | integer | | not null | | plain | |
Indexes:
"blockchain_block_pkey" PRIMARY KEY, btree (hash)
"blockchain_block_hash_7b6393e6_like" btree (hash varchar_pattern_ops)
"blockchain_block_height_bf2470f4" btree (height)
"blockchain_block_previous_id_ead75ff5" btree (previous_id)
"blockchain_block_previous_id_ead75ff5_like" btree (previous_id varchar_pattern_ops)
Foreign-key constraints:
"blockchain_block_previous_id_ead75ff5_fk_blockchain_block_hash" FOREIGN KEY (previous_id) REFERENCES blockchain_block(hash) DEFERRABLE INITIALLY DEFERRED
Referenced by:
TABLE "blockchain_block" CONSTRAINT "blockchain_block_previous_id_ead75ff5_fk_blockchain_block_hash" FOREIGN KEY (previous_id) REFERENCES blockchain_block(hash) DEFERRABLE INITIALLY DEFERRED
TABLE "blockchain_input" CONSTRAINT "blockchain_input_block_id_0d78b8c6_fk_blockchain_block_hash" FOREIGN KEY (block_id) REFERENCES blockchain_block(hash) DEFERRABLE INITIALLY DEFERRED
TABLE "blockchain_kernel" CONSTRAINT "blockchain_kernel_block_id_8c53f550_fk_blockchain_block_hash" FOREIGN KEY (block_id) REFERENCES blockchain_block(hash) DEFERRABLE INITIALLY DEFERRED
TABLE "blockchain_output" CONSTRAINT "blockchain_output_block_id_2a940961_fk_blockchain_block_hash" FOREIGN KEY (block_id) REFERENCES blockchain_block(hash) DEFERRABLE INITIALLY DEFERRED
@hendi any idea?
Add a text box explaining data sources, something like
"Data in this explorer is collected from multiple grin servers in 4 geo locations. This makes it possible to detect forks, and many alternative blocks for same height can be seen in the explorers list of Recent blocks. This explorer aims to be the most accurate and up to date view of the grin blockchains. "
Show which fork a block belongs to and display its total cumulative difficulty, highlight the "best" chain, etc.
The only way to import the blockchain into Postgres currently is by disabling basic auth in the grin rest api.
on gitter it was discussed if we have > 1 block/min on average.
Idea: when presenting a "block" or a "chain", show count(blocks) / minute_diff(tip.lookback(5*diff_adjust_window), tip)
Necessary because of mimblewimble/grin#3329
Chain height is based on best known chain (tot.diff.) while Latest block is whatever was most recently seen.
Separate this, so one block of info is about the best chain, and another block of info is about alternative chains that may have newer blocks.
Best would be to show several alternative forks, that can be "named" and sorted by falling tot.diff similar to how debug outputs show (or will show) that info
tot_diff @ height (hash)
Hello Hendi,
It's me again, finally I could get most data of blockchain, just one small issue remaining, I can't get data before 05-Feb-2019. Not sure if it's due to hard-fork during that period or python or postgresql limitation.
I also discovered that Grinmint got same issue like me, you could see the examples here:
https://scan.grin.money/block/000000bbf9aacf955891b3e5703d06d1649921ca6216dd15b22b31595c4fe0ac
Block 29,143
https://grinmint.com/block/000002a3eed065f456ce9f31377389ee85f605cec9d3c4824f972ddbe618efa9
Block 29,141
When we click on the inputs, it shown 404 not found error.
Thanks for your help.
E.g. https://grinexplorer.net/search?q=430112 needs some display fixes
See for example blocks 430112 and 430255 which do not seem to exist on https://grinmint.com/explorer
Stored block 00e3a7aee38f533af6dc1efb877657c7732c72d9d11194d09d74be18b7315060 @ 7968
Marked block 00e3a7 as previous of block 00d2e3
Stored block 02acf66db0199bcf5f528475cb6d1687680a6b0f7193183d1ed17e399d5ba48f @ 7967
Marked block 02acf6 as previous of block 00e3a7
Stored block 00672e00ef1d11970ebbb13fcbdacb333b0b3ff064a16357f7f17a352d74b409 @ 7966
Marked block 00672e as previous of block 02acf6
Stored block 0070d72cdb2a699ed180672572ef82bf122d08b44ae22e30ed087bacac037fe9 @ 7965
Marked block 0070d7 as previous of block 00672e
Stored block 00ec07f76524a1c1705668221964989ed49552a120bf878b507d760d7160fc76 @ 7964
Marked block 00ec07 as previous of block 0070d7
Stored block 0239f4657058df78f70e023b2a46414f31bd346251615938e32f093073337589 @ 7963
Marked block 0239f4 as previous of block 00ec07
Stored block 01b66fa15c67a1df43264eb27882933cf2cd9243e6a9a67b60a7ea284fb8220d @ 7962
Marked block 01b66f as previous of block 0239f4
Traceback (most recent call last):
File "./grinexplorer/manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/mkargaki/projects/grin-explorer/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/mkargaki/projects/grin-explorer/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/mkargaki/projects/grin-explorer/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/mkargaki/projects/grin-explorer/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/home/mkargaki/projects/grin-explorer/grinexplorer/blockchain/management/commands/import_from_tip.py", line 47, in handle
(status, block_hash, prev_hash) = self.fetch_and_store_block(hash, parent)
File "/home/mkargaki/projects/grin-explorer/grinexplorer/blockchain/management/commands/import_from_tip.py", line 61, in fetch_and_store_block
block_data = requests.get(self.API_BASE + "blocks/" + hash).json()
File "/home/mkargaki/projects/grin-explorer/venv/lib64/python3.6/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
After having done
$ sudo apt install postgresql postgresql-contrib
$ sudo postgresql-setup --initdb
sudo: postgresql-setup: command not found
Where is the postgresql-setup command described in the installation instructions? It does not exist anywhere on the server.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.