Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to connect a custom chain #3

Open
didiermis opened this issue Sep 2, 2022 · 7 comments
Open

How to connect a custom chain #3

didiermis opened this issue Sep 2, 2022 · 7 comments

Comments

@didiermis
Copy link

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

@arjanz
Copy link
Member

arjanz commented Sep 2, 2022

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
Copy link
Author

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
Copy link
Member

arjanz commented Sep 2, 2022

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
Copy link
Author

didiermis commented Sep 2, 2022

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:

  • Clone repo
  • Run ./init.sh
  • Change the endpoint
    SUBSTRATE_RPC_URL=wss://n1.polka.systems
  • Run docker-compose up --build
  • Go to: Polkascan UI: http://127.0.0.1:8080/
    Am I missing something?
    Do I need to configure my own local DB?

I greatly appreciate your help.

@arjanz
Copy link
Member

arjanz commented Sep 2, 2022

@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
Copy link
Author

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

  • Clone repo
  • Run ./init.sh
  • Run docker-compose up --build
  • Press ctrl + c to stop it
  • Run again docker-compose up --build
  • HERE: It says a problem related to MySQL:

image

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:

  • Clone repo
  • Run ./init.sh
  • Run docker-compose up --build
  • Press ctrl + c to stop it
  • Restart containers/volumes
  • Run again docker-compose up --build
  • Same problem with MySQL.

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:

  • docker rmi $(docker images -a -q)
  • docker volume prune

What am I missing here? Thanks in advance.

@wouterter
Copy link
Contributor

Are you still having problems with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants