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
21 stars 22 forks source link

syscoin block explorer? #185

Open SIKOo971 opened 1 year ago

SIKOo971 commented 1 year ago

Hello @sondreb @dangershony Brothers. Can we able to create syscoin block explorer?

sondreb commented 1 year ago

We're only supporting Bitcoin-based blockchains. If anyone want to add support and maintain support for other type of blockchains, we'd be more than happy to review and accept pull requests.

SIKOo971 commented 1 year ago

I understand, but for me now! im stuck with this page https://www.blockcore.net/create-chain

SIKOo971 commented 1 year ago

I have Cointype, SCRIPT_ADDRESS = 0x5 PUBLIC_KEY_ADDRESS = 0x3f SEGWIT_ADDRESS = sys

Just Trying to understand what other things i need to create, even how i add this config to indexer command like dotnet run --chain=SYS

SIKOo971 commented 1 year ago

@sondreb will you help me with configuration. i will try to maintained on my VPS

dangershony commented 1 year ago

Ah its a blockcore based coin you are making? are you planning to merge this to the blockcore repo? to have blockcore run an indexer for you it must be merged to our repo.

Just Trying to understand what other things i need to create, even how i add this config to indexer command like dotnet run --chain=SYS

It won't work that way, if you run it yourself you need to override the configuration file in app.settings

dangershony commented 1 year ago

I would suggest you submit a PR to blockcore so we can review what you did

SIKOo971 commented 1 year ago

@dangershony yes it is blockchain based coin. https://coinmarketcap.com/currencies/syscoin/

so how i am locally do this?

SIKOo971 commented 1 year ago

i am new learner here, dont know how to put pr

SIKOo971 commented 1 year ago

For example. tried to change --Chain=BTC Settings. how i can do locally?

dangershony commented 1 year ago

Ah syscoin is an existing blockchain and it seems to be utxo based right?
https://github.com/syscoin/syscoin

It should be possible to create a fullnode for it on blockcore however you can probably also just run a syscoin node and use our explorer. it will be easiest if yo find a syscoin docker hub node and just reference that in the indexer deployment scripts

dangershony commented 1 year ago

or you can create your own docker image here https://github.com/syscoin/docker-syscoind

dangershony commented 1 year ago

Syscoin is the only dual chain UTXO / EVM architecture where all of the following characteristics are working in perfect harmony to comprise the layer 1 protocol.

Seems its like Cirrus the stratis sidechain a UTXO and smart contract meshed together.

SIKOo971 commented 1 year ago

Ok i understand, i created syscoind. but how i use --chain=syc

SIKOo971 commented 1 year ago

can you add sys in your blockcore list. so it will be easy for me. because i tried to use custom_btc. but its giving me error.

fail: Blockcore.Indexer.Core.Sync.SyncServer[0]
      Sync
      System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Array size too big')
         at NBitcoin.BitcoinStream.ReadWriteArray[T](T[]& data)
         at NBitcoin.BitcoinStream.ReadWriteList[TList,TItem](TList& data)
         at NBitcoin.BitcoinStream.ReadWrite[TList,TItem](TList& list)
         at Blockcore.Consensus.BlockInfo.PosTransaction.ReadWrite(BitcoinStream stream)
         at NBitcoin.BitcoinStream.ReadWrite[T](T& data)
         at NBitcoin.BitcoinStream.ReadWriteArray[T](T[]& data)
         at NBitcoin.BitcoinStream.ReadWriteList[TList,TItem](TList& data)
         at NBitcoin.BitcoinStream.ReadWrite[T](List`1& list)
         at Blockcore.Consensus.BlockInfo.Block.ReadWrite(BitcoinStream stream)
         at Blockcore.Consensus.BlockInfo.PosBlock.ReadWrite(BitcoinStream stream)
         at NBitcoin.BitcoinSerializableExtensions.ReadWrite(IBitcoinSerializable serializable, Byte[] bytes, ConsensusFactory consensusFactory)
         at Blockcore.Consensus.BlockInfo.Block.Parse(String hex, ConsensusFactory consensusFactory)
         at Blockcore.Indexer.Core.Sync.SyncOperations.SyncBlockInternal(SyncConnection connection, BlockInfo block) in C:\Users\CRSTUDIO\Downloads\blockcore-indexer-master\blockcore-indexer-master\src\Blockcore.Indexer.Core\Sync\SyncOperations.cs:line 239
         at Blockcore.Indexer.Core.Sync.SyncOperations.FetchFullBlock(SyncConnection connection, BlockInfo block) in C:\Users\CRSTUDIO\Downloads\blockcore-indexer-master\blockcore-indexer-master\src\Blockcore.Indexer.Core\Sync\SyncOperations.cs:line 105
         at Blockcore.Indexer.Core.Sync.SyncTasks.BlockPuller.FetchBlockAsync(Int64 tip) in C:\Users\CRSTUDIO\Downloads\blockcore-indexer-master\blockcore-indexer-master\src\Blockcore.Indexer.Core\Sync\SyncTasks\BlockPuller.cs:line 192
dangershony commented 1 year ago

You need to go to this files and make changes there https://github.com/block-core/blockcore-indexer/blob/master/src/Blockcore.Indexer/appsettings.json#L20 https://github.com/block-core/blockcore-indexer/blob/master/src/Blockcore.Indexer/CUSTOM.json

But this is not gonna be so easy because it depends if a syscoin transactions can be serialized with one of our consensus serializers

can you add sys in your blockcore list. so it will be easy for me.

I suppose we can try if I find the time but it might be a big job for a dev to do that

SIKOo971 commented 1 year ago

I will wait, if you can make syscoin indexer. i will see my self too.. but waiting from your side

dangershony commented 1 year ago

ok if I find time soon I will try to do it

SIKOo971 commented 1 year ago

sure thank bro @dangershony <3

SIKOo971 commented 1 year ago

Hello Brother, @dangershony how are you, is there anything done?

dangershony commented 1 year ago

Not yet no, perhaps join our discord and maybe others in the community can help?

SIKOo971 commented 1 year ago

@dangershony I Followed your instructions. and i finally created just changes done in custom.json and it works :) Thanks brother @dangershony

SIKOo971 commented 1 year ago

@dangershony Brother, how can we stop sync and RPC connection? and just use the indexer without sync

SIKOo971 commented 1 year ago

@dangershony @sondreb Hello Brothers, how are you. guys please help me, i tried to create RVN and my indexer stop sync http://74.208.160.105:9910/ in 1218326 height. and giving me error.

New

dangershony commented 1 year ago

This most likely means you are using the wrong consensus factory, the code serializer is failing because there fields it's not expecting.

Is RVN a POS network? Do you need to use a POS consensus factory?

SIKOo971 commented 1 year ago

RVN Is PoW Network. what should i have to do?

dangershony commented 1 year ago

You have to find out what are the different fileds that get serialized.

In your indexer settings file what did you set as the consensus factory type?

SIKOo971 commented 1 year ago

i used custom.json and just change the symbol and RPC credentials.

dangershony commented 1 year ago

Ok so on the custom I suppose you left this part as is? https://github.com/block-core/blockcore-indexer/blob/master/src/Blockcore.Indexer/CUSTOM.json#L12

Here you probably need to change the factory type to POW, can you try "NetworkConsensusFactoryType": "Blockcore.Consensus.BlockInfo.ConsensusFactory, Blockcore",

SIKOo971 commented 1 year ago

SHould i have to resync? because same issue not starting

SIKOo971 commented 1 year ago

Check This Error After Changing NetworkConsensusFactoryType

Capture

dangershony commented 1 year ago

Yes it can't find the type perhaps the command I gave you was missing something

dangershony commented 1 year ago

Sorry try this line

"NetworkConsensusFactoryType": "Blockcore.Consensus.ConsensusFactory, Blockcore"

SIKOo971 commented 1 year ago

fail: Blockcore.Indexer.Core.Sync.SyncServer[0] Sync System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Array size not big') at NBitcoin.Protocol.VarString.ReadWrite(BitcoinStream stream) at NBitcoin.BitcoinStream.ReadWrite(Script data) at NBitcoin.BitcoinStream.ReadWrite(Script& script) at Blockcore.Consensus.TransactionInfo.TxIn.ReadWrite(BitcoinStream stream) at NBitcoin.BitcoinStream.ReadWrite[T](T& data) at NBitcoin.BitcoinStream.ReadWriteArray[T](T[]& data) at NBitcoin.BitcoinStream.ReadWriteList[TList,TItem](TList& data) at Blockcore.Consensus.TransactionInfo.Transaction.ReadWrite(BitcoinStream stream) at NBitcoin.BitcoinStream.ReadWrite[T](T& data) at NBitcoin.BitcoinStream.ReadWriteArray[T](T[]& data) at NBitcoin.BitcoinStream.ReadWriteList[TList,TItem](TList& data) at Blockcore.Consensus.BlockInfo.Block.ReadWrite(BitcoinStream stream) at NBitcoin.BitcoinSerializableExtensions.ReadWrite(IBitcoinSerializable serializable, Byte[] bytes, ConsensusFactory consensusFactory) at Blockcore.Consensus.BlockInfo.Block.Parse(String hex, ConsensusFactory consensusFactory) at Blockcore.Indexer.Core.Sync.SyncOperations.SyncBlockInternal(SyncConnection connection, BlockInfo block) in /root/blockcore-indexer/src/Blockcore.Indexer.Core/Sync/SyncOperations.cs:line 239 at Blockcore.Indexer.Core.Sync.SyncOperations.FetchFullBlock(SyncConnection connection, BlockInfo block) in /root/blockcore-indexer/src/Blockcore.Indexer.Core/Sync/SyncOperations.cs:line 105 at Blockcore.Indexer.Core.Sync.SyncTasks.BlockPuller.FetchBlockAsync(Int64 tip) in /root/blockcore-indexer/src/Blockcore.Indexer.Core/Sync/SyncTasks/BlockPuller.cs:line 192

Still Same Error.

SIKOo971 commented 1 year ago

Should i have to re-sync? with this changes

dangershony commented 1 year ago

That's a different error see when it tries to serialize the script NBitcoin.BitcoinStream.ReadWrite(Script data)

I think its serialization so it means the blocks for this network don't serialize the same. Is this network implemented in C# somewhere like NBitcoin?

SIKOo971 commented 1 year ago

Dont Know brother, everything fine. just stuck in sync.

SIKOo971 commented 1 year ago

CAN I TRY TO RESYNC? AND for example if i dont want to sync. how can i use indexer without network and sync standalone?

dangershony commented 1 year ago

You will need to implement a consensus factory, not so easy but possible.

how can i use indexer without network and sync standalone?

I am not sure I understand. What is RVN github?

SIKOo971 commented 1 year ago

RVN is Ravencoin.

SIKOo971 commented 1 year ago

You will need to implement a consensus factory, not so easy but possible.

how can i use indexer without network and sync standalone?

I am not sure I understand. What is RVN github?

How to implement?

SIKOo971 commented 1 year ago

I want to know, for example my indexer stuck right now, how can i stop sync & rpc connections. and just query locally addresses

SIKOo971 commented 1 year ago

http://74.208.160.105:9910/ I start resync with this settings "NetworkConsensusFactoryType": "Blockcore.Consensus.ConsensusFactory, Blockcore"

let see what gonna happen

dangershony commented 1 year ago

You can access the swagger in this url http://74.208.160.105:9910/docs/index.html

SIKOo971 commented 1 year ago

Brother, When my server stop sync and i can access throught brower. but when i query http://74.208.160.105:9910/api/query/address/RRGYxRYGhvUuXBpvypLK9YdaXDk6Gs95LS

Its Didnt Work, Just Browser Hang Round Round, And For Example Rightnow Server Is Ok Re-Sync And If I Try To Query Same Address In Brower So its Work Find.

SIKOo971 commented 1 year ago

Actually my vps has not enough space to save node blocks and mongo both. so i want to save only mongo for query. and i am asking is there any possible way to open indexer and api runs without sync and rpc Because blockchain synced half?

dangershony commented 1 year ago

Its Didnt Work, Just Browser Hang Round Round,

This can be because it did not run indexes, it does that at the end.

is there any possible way to open indexer and api runs without sync and rpc

Once the sync is complete you can stop the node and just use indexer and mongodb yes but you need it to finish so it will run indexes

SIKOo971 commented 1 year ago

oh ok. http://74.208.160.105:9910/ check @dangershony brother rightnow its syncing hopefully everything works find. or else i will ask you later.

SIKOo971 commented 1 year ago

to implement a consensus factory

@dangershony Brother Will you help me to implement a consensus factory, for ravencoin.

SIKOo971 commented 1 year ago

@dangershony @sondreb Anyone Reply?

dangershony commented 1 year ago

Hi mate, this might be a big task. Can you perhaps try to find out how ravencoin differs from bitcoin, what fields are different? It will be easier to know then how much work it will be Is ravencoin implemented in NBitcoin?