polkascan / explorer

Polkascan Substrate Explorer
GNU General Public License v3.0
44 stars 46 forks source link

How to connect a custom chain #3

Open didiermis opened 2 years ago

didiermis commented 2 years ago

Hey, I was wondering how can I setup a connection to a custom chain, using the following wss: wss://n1.polka.systems

arjanz commented 2 years ago

Have you tried replacing the SUBSTRATE_RPC_URL variable in https://github.com/polkascan/explorer/blob/main/docker-compose.yml#L14 and have a go? For most Substrate based chains it should work out of the box.

didiermis commented 2 years ago

Isn't working, is still running the docker image. I got this error when I change the wss:

harvester_1       | Traceback (most recent call last):
harvester_1       |   File "app/harvester.py", line 394, in <module>
harvester_1       |     harvester.run(args.action)
harvester_1       |   File "app/harvester.py", line 292, in run
harvester_1       |     self.init()
harvester_1       |   File "app/harvester.py", line 237, in init
harvester_1       |     raise ValueError(
harvester_1       | ValueError: Connected chain 'Polka Systems - Chaos' does not match chain 'Development' in database

Can you help me?

arjanz commented 2 years ago

Then probably you changed the endpoint for an existing database used on another chain, you will need to flush the current database or create a new one for this chain..

didiermis commented 2 years ago

Thank you @arjanz, I'm not an experienced developer, sorry if this questions sounds dumb but, As far as I understand, the steps I need to follow:

I greatly appreciate your help.

arjanz commented 2 years ago

@didiermis this is about right, you don't need to setup your own DB (it's included in the docker-compose file). Just make sure you clear any existing Docker volumes, because these will be reused if already created. See for example https://docs.tibco.com/pub/mash-local/4.3.0/doc/html/docker/GUID-BD850566-5B79-4915-987E-430FC38DAAE4.html

didiermis commented 2 years ago

Morning, The other day I was trying the following (using the original code connected to the node template):

After this, I tried the page u mentioned above: https://docs.tibco.com/pub/mash-local/4.3.0/doc/html/docker/GUID-BD850566-5B79-4915-987E-430FC38DAAE4.html The new process:

My restart script looks like this:

echo "Stop the container(s) using the following command:"
docker-compose down --volumes

echo "Delete all containers using the following command:"
docker rm -f $(docker ps -a -q)

echo "Delete all volumes using the following command:"
docker volume rm $(docker volume ls -q)

echo "Restart the containers using the following command:"
docker-compose up -d

I also tried deleting all Docker images and containers (it takes a long time to build the project) with no success:

What am I missing here? Thanks in advance.

wouterter commented 1 year ago

Are you still having problems with this?