block-core / blockcore-indexer

Blockcore Indexer scans the blockchain of Blockcore-derived chains and stores transaction information in a MongoDB database with REST API available for Block Explorers to use.
MIT License
20 stars 22 forks source link

Installation Full Guide For Indexer. #172

Closed SIKOo971 closed 1 year ago

SIKOo971 commented 1 year ago

Hello, I Recently Google And Found your explorer, it seems so nice. Actually i want to build my local bitcoin block explorer with mongodb. Can you please make a Proper Guide For Installation From Node ==> Indexer ===> Explorer. So Beginers can easyly play with new stuff.

I Want to install install in ubuntu linux based server.

dangershony commented 1 year ago

Hi there, that's a good idea I'll try to do one asap

SIKOo971 commented 1 year ago

Hi there, that's a good idea I'll try to do one asap

Yeah Sure, I Will wait for it.

dangershony commented 1 year ago

Hi before I start to write a guide in our documentation you can take a look at this instructions

This instructions will enable you to deploy an nginx reverese proxy (to allow SSL access with your domain using letsencrypt) and deploy indexers for each chain you want and an explorer.

Reverese proxy - https://github.com/block-core/chaininfo#reverse-proxy-route-dns-to-containers
Indexer - https://github.com/block-core/chaininfo#domain-names
Explorer- https://github.com/block-core/chaininfo#chains

Note to install a bitcoin exploerer it's a bit more complicated because of the size of the chain and because I recommend using bitcoin core so you will have to play around with the docker script a bit to use a bitcoin core image, also Bitcoin requires about 450GB for the node and about 1T for the explorer (assuming you store raw transactions in mongodb) so you will need a big SSD.

Let me know if this helps

SIKOo971 commented 1 year ago

I Understand, Its a bit complicated but i will figure out. but for now i am looking how to run indexer from ubuntu with bitcoin core and then how to setup explorer localhost.

SIKOo971 commented 1 year ago

I Used, Iquidus Explorer with the help of this tutorial. https://web.archive.org/web/20210228210054/https://stakeandnodes.net/iquidus-explorer-installation-guide/

It works but syncing the bitcoin blockchain on my 1TB SSD is so slow, that's why I am looking for other explorers.

I wish and hope you guys created a simple guide from, Node, Then Indexer, Then Explorer.

dangershony commented 1 year ago

Ah I see, our deployment is far simpler because it uses docker everything is already setup in the scripts

However you will need a Bitcoin image.

I will work on a guide as well 👍

SIKOo971 commented 1 year ago

Sure Brother 👍 I Am Waiting.

SIKOo971 commented 1 year ago

@dangershony Hello, when the manual simple guide will be available?

sondreb commented 1 year ago

@dangershony Hello, when the manual simple guide will be available?

You want to run it using docker, or locally? I can write up a very quick guide that explains startup parameters and how to run it, either from code or binaries or docker.

SIKOo971 commented 1 year ago

Actually For Me Manual Nodejs + Mongo Is Good. But If Docker Is Easy So I Am Happy To Assist.

sondreb commented 1 year ago

I have added some instruction to the README on how to run either using docker or directly from source. Please let us know if this is enough or you need more?

https://github.com/block-core/blockcore-indexer

YakupIpek commented 1 year ago

I would like to know if it is possible to specify launch profile as

dotnet run --launch-profile "CIRRUS (TEST)"

This was giving me invalid json when i tried last time.

sondreb commented 1 year ago

This works:

dotnet run --project src/Blockcore.Indexer.Cirrus/Blockcore.Indexer.Cirrus.csproj --launch-profile "CIRRUS (MAIN)"

Make sure you quote the name since it has spaces in it.

SIKOo971 commented 1 year ago

Still I'm Confused. like i installed fresh ubuntu 18.04. then i install nodejs, docker both. i am running bitcoind. how i configure indexer to bitcoind and with custom mongo database for example database name BTCExplorer. and then what command and conf i have to use to run so my indexer run with bitcoind and then. how i connect my indexer to blockcore explorer.

please guide

dangershony commented 1 year ago

Hi @SIKOo971 I will release a guide soon, however the guide is using docker and not installing each component manually. Using docker is far simpler and will require little work on your side (it will also handle the ssl part)

If you want to deploy manually that also possible.

  1. run a bitcoin core fullnode and set it up with RPC and with username and password See here for some commands to set in the config file https://github.com/block-core/chaininfo/blob/master/docker/BTC/docker-compose.yml#L57

  2. run mongod v5 (default port is fine)

  3. run the indexer with this command --chain=BTC

  4. to run the explorer, I think @sondreb will be more helpful

dangershony commented 1 year ago

FYI hope this helps

https://docs.blockcore.net/explorer/

SIKOo971 commented 1 year ago

Hi @SIKOo971 I will release a guide soon, however the guide is using docker and not installing each component manually. Using docker is far simpler and will require little work on your side (it will also handle the ssl part)

If you want to deploy manually that also possible.

  1. run a bitcoin core fullnode and set it up with RPC and with username and password See here for some commands to set in the config file https://github.com/block-core/chaininfo/blob/master/docker/BTC/docker-compose.yml#L57
  2. run mongod v5 (default port is fine)
  3. run the indexer with this command --chain=BTC
  4. to run the explorer, I think @sondreb will be more helpful

where should i run --chain=BTC this command. in which folder can you please tell me full command

dangershony commented 1 year ago

where should i run --chain=BTC this command. in which folder can you please tell me full command

This is the indexer node.
Assuming you have mongod running and a bitcoin core node running with the rpc user and password enabled Clone this repo blockcore-indexer In the path src/Blockcore.Indexer/ run the command dotnet run --chain=BTC This will pull the bitcoin configuration from https://github.com/block-core/chaininfo/blob/master/chains/BTC.json However you may need to overwrite this config values do this in appsettings.json or appsettings.Development.json

SIKOo971 commented 1 year ago

I Will Try My Best To Configure As You Guide Me, And Will Ask If Any Help I Am Required.

dangershony commented 1 year ago

No problem, we are also available on discord

SIKOo971 commented 1 year ago

Ok, Whats your discord server?

SIKOo971 commented 1 year ago

I have some doubt, regarding which mongo database name i have to create and how it will be connected to BTC.JSON & Appsettings.json

dangershony commented 1 year ago

You shouldn't need to name the database, the code will do that.

Discord is on our website

SIKOo971 commented 1 year ago

Thanks Brother Finally Its Done. @dangershony Is there any wallet or way we import our Strax Key?

dangershony commented 1 year ago

coinvault.io can manage strax, but can you elaborate what you mean by strax key?

SIKOo971 commented 1 year ago

i mean to say, if i have wif key how can i import is there any way?

sondreb commented 1 year ago

i mean to say, if i have wif key how can i import is there any way?

WIF is your private key. This you should only import into the node, not indexer. Sounds like you are running bitcoin-core, so that's where you would use that. The indexer itself doesn't do any signing or need any keys, it just delivers read-only data from the blockchain.

SIKOo971 commented 1 year ago

@sondreb Actually i am asking, where i can import my WIF. i am asking about strax coin

SIKOo971 commented 1 year ago

My Bitcoin explorer issue solved. i am closing this please reply my new ticket @sondreb @dangershony