crossle / hacker-news-mixin-bot

Post new hot stories from Hacker News to Mixin bot (Mixin ID: 7000100124)
MIT License
20 stars 5 forks source link

can not run 'blaze' service #1

Closed hxzqlh closed 6 years ago

hxzqlh commented 6 years ago

I built the souce code with my config/config.go:

package config

const (
    DatabasePath      = "./news.db"
    MixinClientId     = "17ab3368-1d48-44b0-a11d-f3b91a1e140d"
    MixinClientSecret = "3fd6c40e18569f2c16bfae3e01fb81dea1e5f66dff178fbe8bb44c74d61a6285"
    MixinPin          = "432834"
    MixinSessionId    = "36cd2c61-e35b-4dd8-97a7-6968c0cd913f"
    MixinPinToken     = "kbAlh7feq3a7inzpNZOWK0qZwZ+J/HG7ns6rwS1GuYwUJOK7WlUD1V7SVAAjgryyuEHZLsrFkcsoMn07jdc3oMU0NJMGSKbocPieHPOaQiCGAGrqhadLCgW94I15sBfQDhgaW6JN7GNX7ToruekdEVW2VC4cXASLJQ1YoyPjw5A="
    MixinPrivateKey   = `-----BEGIN RSA PRIVATE KEY-----
    MIICXAIBAAKBgQCr94AAZtAK9i94vElPLMKGUzxhSxtGFt6nklKQsBGGY3ut/o/t
    qRI+CEh7njRwSUa7PCO3Xlct2wv/TDT4Mn15JTCsQpj0ICcbvs3/PvSB5AzKMwi9
    WQ4I/YXRukJunCADsDQ23MTOzQaG8fc9Yg5GN6gF0IeLPNnznKl314e6WwIDAQAB
    AoGAWhoJxSwZYUTwRpBQ0N0g5wSBpHCXz7d33dD61biK1iEV0mqIuvtVBY+Nese/
    rf2Ww8+U3yTdBLe6p38kWc8Kkiy8hsYhCnfw8fvmnbfxQSJWHHZfVuFLVvIsO4qf
    MOK/xQflgptIZp589hxE1venAS0NUJSxRwwKucXRbuV5GIECQQDefYn/m/vABlCu
    xi/oVY/wcIxSyD4RF0aCpS+XOquOFnugTfQhM1q+YI1iGXP8NAn/ai43IjNgXskk
    q8fHo2ahAkEAxd3yIBlH7l1Yf4rY2N9hdMGw7/vtzwHtCdisWB8Zxnn1giPxKnNk
    8jeK4ulJ2VXSrpz1qK4nUUM5BHRmi8yLewJAVJAofDOAGvsLfXIsUUT8AWn1m50q
    IfrTvOIl1XfiLo4TDNm0GU5YhhVSh1+fOtNYnXBxAlmIZ29/SeXUd+d+IQJBAKmr
    xqJry1jFRswnvgdKlgFOznEbsTLfzemxmSf/k1S05CfytizWwutJYZluvtrVU1JU
    WfuJS0HNySjev8iFX90CQGYS67uDcEfETJT2Lqz5I8nbRZ9IXflyrlnwFlbh0+mJ
    6GcoPqMe2twppk4N8oZorwsPpCsbdp3mBNbTHUnsuGY=
    -----END RSA PRIVATE KEY-----`
)

then run:

hxzdeMac-mini:~/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot (master) $ ./hacker-news-mixin-bot -service blaze
2018/10/12 17:42:57 start blaze
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x444e18b]

goroutine 1 [running]:
github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client.SignAuthenticationToken(0x46b98ce, 0x24, 0x46b98f2, 0x24, 0x46c64c0, 0x384, 0x46a6c22, 0x3, 0x46a69d5, 0x1, ...)
    /Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client/auth.go:28 +0x81b
github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client.connectMixinBlaze(0x46b98ce, 0x24, 0x46b98f2, 0x24, 0x46c64c0, 0x384, 0x4e00000, 0x0, 0x4a00d50)
    /Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client/blaze.go:187 +0xc0
github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client.Loop(0x49b11e0, 0xc42005c940, 0x49ab260, 0x4a2ede0, 0x46b98ce, 0x24, 0x46b98f2, 0x24, 0x46c64c0, 0x384, ...)
    /Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client/blaze.go:83 +0xba
main.StartBlaze(0xc420087540, 0x0, 0x0)
    /Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/blaze.go:27 +0x1f8
main.main()
    /Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/main.go:20 +0x183
crossle commented 6 years ago

The private key should clear the empty

package config

const (
    DatabasePath      = "./news.db"
    MixinClientId     = "17ab3368-1d48-44b0-a11d-f3b91a1e140d"
    MixinClientSecret = "3fd6c40e18569f2c16bfae3e01fb81dea1e5f66dff178fbe8bb44c74d61a6285"
    MixinPin          = "432834"
    MixinSessionId    = "36cd2c61-e35b-4dd8-97a7-6968c0cd913f"
    MixinPinToken     = "kbAlh7feq3a7inzpNZOWK0qZwZ+J/HG7ns6rwS1GuYwUJOK7WlUD1V7SVAAjgryyuEHZLsrFkcsoMn07jdc3oMU0NJMGSKbocPieHPOaQiCGAGrqhadLCgW94I15sBfQDhgaW6JN7GNX7ToruekdEVW2VC4cXASLJQ1YoyPjw5A="
    MixinPrivateKey   = `-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCr94AAZtAK9i94vElPLMKGUzxhSxtGFt6nklKQsBGGY3ut/o/t
qRI+CEh7njRwSUa7PCO3Xlct2wv/TDT4Mn15JTCsQpj0ICcbvs3/PvSB5AzKMwi9
WQ4I/YXRukJunCADsDQ23MTOzQaG8fc9Yg5GN6gF0IeLPNnznKl314e6WwIDAQAB
AoGAWhoJxSwZYUTwRpBQ0N0g5wSBpHCXz7d33dD61biK1iEV0mqIuvtVBY+Nese/
rf2Ww8+U3yTdBLe6p38kWc8Kkiy8hsYhCnfw8fvmnbfxQSJWHHZfVuFLVvIsO4qf
MOK/xQflgptIZp589hxE1venAS0NUJSxRwwKucXRbuV5GIECQQDefYn/m/vABlCu
xi/oVY/wcIxSyD4RF0aCpS+XOquOFnugTfQhM1q+YI1iGXP8NAn/ai43IjNgXskk
q8fHo2ahAkEAxd3yIBlH7l1Yf4rY2N9hdMGw7/vtzwHtCdisWB8Zxnn1giPxKnNk
8jeK4ulJ2VXSrpz1qK4nUUM5BHRmi8yLewJAVJAofDOAGvsLfXIsUUT8AWn1m50q
IfrTvOIl1XfiLo4TDNm0GU5YhhVSh1+fOtNYnXBxAlmIZ29/SeXUd+d+IQJBAKmr
xqJry1jFRswnvgdKlgFOznEbsTLfzemxmSf/k1S05CfytizWwutJYZluvtrVU1JU
WfuJS0HNySjev8iFX90CQGYS67uDcEfETJT2Lqz5I8nbRZ9IXflyrlnwFlbh0+mJ
6GcoPqMe2twppk4N8oZorwsPpCsbdp3mBNbTHUnsuGY=
-----END RSA PRIVATE KEY-----`
)