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

add monacoin #22

Merged
merged 2 commits into from
Aug 4, 2018
Merged

add monacoin #22

merged 2 commits into from
Aug 4, 2018

Conversation

wakiyamap
Copy link
Contributor

I added a description for monacoin.
If you need to change the port, I will rewrite it immediately.

I have a question.
Should I write "satoshilabs"?
Please let me know if it needs to be rewritten.
master...wakiyamap:master#diff-b18adf308f4776cacd512b2e1bb47929R2

@martinboehm
Copy link
Contributor

Thank you very much for your contribution! It looks good.

The specified explorer links https://insight.electrum-mona.org/ and https://testnet-mona.insight.monaco-ex.org/, are not working for me.

Also, do you have somewhere a running, publicly accessible instance of monacoin blockbook, so that we could check that it works correctly?

@wakiyamap
Copy link
Contributor Author

At first, I am sorry if it was English strange because I use google translate.

I passed the build but got the following error.
I am looking for a solution.

~/go/src/blockbook$ ./blockbook --help
panic: duplicate Bitcoin network

goroutine 1 [running]:
blockbook/bchain/coins/monacoin.init.0()
	/home/wakiyamap/go/src/blockbook/bchain/coins/monacoin/monacoinparser.go:39 +0x51b

~/go/src/blockbook$ ./blockbook -sync -blockchaincfg=configs/bitcoin_testnet.json -httpserver=127.0.0.1:8333 -socketio=127.0.01:8334 -certfile=server/testcert -logtostderr 
panic: duplicate Bitcoin network

goroutine 1 [running]:
blockbook/bchain/coins/monacoin.init.0()
	/home/wakiyamap/go/src/blockbook/bchain/coins/monacoin/monacoinparser.go:39 +0x51b

~/go/src/blockbook$ ./blockbook -sync -blockchaincfg=configs/monacoin.json -httpserver=127.0.0.1:8333 -socketio=127.0.01:8334 -certfile=server/testcert -logtostderr
panic: duplicate Bitcoin network

goroutine 1 [running]:
blockbook/bchain/coins/monacoin.init.0()
	/home/wakiyamap/go/src/blockbook/bchain/coins/monacoin/monacoinparser.go:39 +0x51b

About the blockchain explorer, it is accessible with the following URL.
https://insight.electrum-mona.org/insight
https://testnet-mona.insight.monaco-ex.org/insight

@martinboehm
Copy link
Contributor

martinboehm commented Jul 10, 2018

  1. the problem with the duplicate Bitcoin network - please change magic numbers in the monacoinparser.go, rows 11-13 to something else. The numbers are now equal to bitcoin magics, which causes the panic. It actually does not matter to what you set them as long as they are different from bitcoin.
  2. explorer links: please specify the links including the /insight in the service file.

@wakiyamap
Copy link
Contributor Author

thanks @martinboehm

  1. The cause of the error was that magics was the same as litecoin. So I rewrite dummy magics.
  2. explorer URL is changed.

I tried to build a node but is this fine?
http://160.16.120.62:9041/

SSL connection is not working properly.
https://blockbook.electrum-mona.org:9041/

I used this command.
./blockbook -sync -blockchaincfg=configs/monacoin.json -datadir=~/.blockbookdb/data -httpserver=160.16.120.62:9041 -socketio=160.16.120.62:9141 -explorer=https://insight.electrum-mona.org/api/ -logtostderr

@martinboehm
Copy link
Contributor

martinboehm commented Jul 12, 2018

  1. For ssl you have to specify a certificate. You can use our test self signed certificate using the flag -certfile=server/testcert.
  2. I am able to access your blockbook socket.io interface on the address http://160.16.120.62:9141/. It seem to be synchronize to the latest block. Good work!
  3. Blockbook has a test page http://160.16.120.62:9141/test.html, which can be used to try various socket.io requests. However, when I try to call getAddressTxids request for any address, for example MEss5fk2p5YsGxsWn6GXzL1DZeTW5Y2K8n, I get an error {"error":{"message":"address collision"}}. So there is something wrong with the implementation. Maybe the network params (PubKeyHashAddrID and ScriptHashAddrID) in the monacoinparser.go are not correct.

@wakiyamap
Copy link
Contributor Author

I can't register PubKeyHashAddrID and ScriptHashAddrID , so I used monautil(btcutil's clone).
getAddressTxids is ok , for examle MJk7p9x7zAgxkgPV2SeAWRhgzsAZVMeDVu , PLRhdzo4iYXW2Lpra5fpsY4avyzBiR8Aqn , mona1q49knemcefarfkvuqr7rgajdu3x5gx8pzdnurgq.

@wakiyamap
Copy link
Contributor Author

ah.....
viacoin use 9041 port
digibyte use 9042 port
Should I change the port of Monacoin?
9041->9043? etc....

@martinboehm
Copy link
Contributor

Don't worry about ports, I will assign a free port to Monacoin when I merge your pull request.
Could you please provide me a running version of Blockbook with https support? I cannot connect wallet to http version.

@martinboehm
Copy link
Contributor

Thank you. Please, map the port 9141 to https://blockbook.electrum-mona.org. The port 9041 is intended to be used internally, mainly for Prometheus stats gathering.

@lae
Copy link

lae commented Jul 24, 2018

Martin, sorry for Japanese, I think there was some confusion so I'm clarifying for Wakiyama.

@wakiyamap nginxの構築は元から不要でしたと思います。普通に、-certfile=server/testcertのフラグをblockbookに付けたらSSLを利用可能になります。多分クライエントも直接9141(とか)のポートを叩けるのでは?

@martinboehm
Copy link
Contributor

はい、lae は正しい :-)

@wakiyamap
Copy link
Contributor Author

sorry. I am not good at English . (>_<)
I tried the same setting as vertcoin, how is it ?
https://vtc5.trezor.io/test.html

https://blockbook.electrum-mona.org/test.html
https://blockbook.electrum-mona.org/api

@martinboehm
Copy link
Contributor

I was able to connect successfully the Trezor Wallet to your https://blockbook.electrum-mona.org.

Then I pulled your code and run unittests using command go test -tags="unittest" ./.... Unfortunately, the tests TestAddressToOutputScript_Mainnet and Test_UnpackTx in the monacoin_test.go failed.

Also, your dep tool seems to make unnecessary formatting differences in the Gopkg.lock. Could you please try to resolve it?

@wakiyamap
Copy link
Contributor Author

Perhaps this is OK?

I got this result.

~/go/src/blockbook$ go test -tags="unittest" ./...
?       blockbook       [no test files]
?       blockbook/api   [no test files]
?       blockbook/bchain        [no test files]
?       blockbook/bchain/coins  [no test files]
ok      blockbook/bchain/coins/bch      0.057s
ok      blockbook/bchain/coins/btc      0.048s
ok      blockbook/bchain/coins/btg      0.077s
?       blockbook/bchain/coins/dash     [no test files]
ok      blockbook/bchain/coins/dogecoin 0.045s
ok      blockbook/bchain/coins/eth      0.092s
ok      blockbook/bchain/coins/litecoin 0.043s
ok      blockbook/bchain/coins/monacoin 0.070s
ok      blockbook/bchain/coins/namecoin 0.055s
?       blockbook/bchain/coins/utils    [no test files]
ok      blockbook/bchain/coins/vertcoin 0.057s
ok      blockbook/bchain/coins/zec      0.046s
?       blockbook/common        [no test files]
ok      blockbook/db    0.130s
ok      blockbook/server        0.021s

@@ -10,6 +10,7 @@ import (
"blockbook/bchain/coins/eth"
"blockbook/bchain/coins/litecoin"
"blockbook/bchain/coins/namecoin"
"blockbook/bchain/coins/monacoin"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wakiyamap Guess it should be sorted here like this.

	"blockbook/bchain/coins/eth"
	"blockbook/bchain/coins/litecoin"
	"blockbook/bchain/coins/monacoin"
	"blockbook/bchain/coins/namecoin"

go fmt may helps you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a,b,c,d.......m,n.....
My english is so poor. lol
thanks.

@cryptcoin-junkey
Copy link

In addition to blockchain.go, some files also aren't applied go fmt.

@wakiyamap
Copy link
Contributor Author

Can I rebase it? I may pollute the commit in my poor English.

@martinboehm
Copy link
Contributor

Hi. Sorry that we are adding some work for you, but we have completely reworked (simplified) the way debian packages are created. It is already pushed to master, if you want to check it or you can wait a couple of days until we document it.

What is the idea behind the change:

  1. there is only one file which defines the coin packages: <coin>.json in configs/coins. The file defines all coin, backend and blockbook specifics. The packages are then generated from this file.
  2. we have added verification of the backend binary, so that the package is not created with faulty or malicious binary. The verification is controlled by "verification" and "verification_source" entries in the config json file.

@martinboehm martinboehm merged commit 2ff99bb into trezor:master Aug 4, 2018
@martinboehm
Copy link
Contributor

Thank you very much for cooperation. I changed the package maintainer to you.

@wakiyamap
Copy link
Contributor Author

thanks!

bidoudan pushed a commit to stibits-inc/blockbook that referenced this pull request Jul 4, 2022
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

Successfully merging this pull request may close these issues.

None yet

4 participants