如何使用Go-Ethereum使用AWS区块链服务?
AWS区块链服务为 http 和 websocket 协议提供了端点,但需要使用IAM签名验证来使用它们。
To use the HTTP endpoint, I just need to sign it in the http.RoundTripper 通过AWS SDK接口。但是,如果我需要使用WebSocket端点,我只能通过 websocket.dialer 通过 rpc.dialwebsocketwithdialer 由于go-ethereum的局限性,这意味着我无法通过实现接口来解决此问题。
如何使用Go-Ethereum使用AWS区块链服务的Websocket端点?
The AWS Blockchain service provides endpoints for HTTP and WebSocket protocols, but requires IAM signature verification to use them.
To use the HTTP endpoint, I just need to sign it in the http.RoundTripper interface via the AWS SDK. However, if I need to use a WebSocket endpoint, I can only pass in a websocket.Dialer structure via rpc.DialWebsocketWithDialer due to the limitations of go-ethereum, which means that I can't solve this problem by implementing an interface.
How do I use the AWS Blockchain Service's WebSocket endpoint with go-ethereum?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过阅读 github.com/gorilla/websocket/websocket 源代码,我发现在
(*Dialer)DialContext
函数将http.request指针传递到可自定义的代理
函数中,这意味着我可以编写一个功能,该函数与>
http.RoundTripper
用于注入标头。Websocket
HTTP
By reading the github.com/gorilla/websocket source code, I found out that there is a logic in the
(*Dialer) DialContext
function to pass the http.Request pointer into the customizableProxy
function, which means I can write a function that does the same thing ashttp.RoundTripper
for injecting header.WebSocket
HTTP