mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-20 18:10:41 +00:00
Implemented support for a custom RPC port
This commit is contained in:
parent
a9d5656a46
commit
d31303a592
1 changed files with 4 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package ethrpc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ethereum/eth-go/ethpub"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"net"
|
||||
|
|
@ -48,8 +49,9 @@ func (s *JsonRpcServer) Start() {
|
|||
}
|
||||
}
|
||||
|
||||
func NewJsonRpcServer(ethp *ethpub.PEthereum) (*JsonRpcServer, error) {
|
||||
l, err := net.Listen("tcp", ":8080")
|
||||
func NewJsonRpcServer(ethp *ethpub.PEthereum, port int) (*JsonRpcServer, error) {
|
||||
sport := fmt.Sprintf(":%d", port)
|
||||
l, err := net.Listen("tcp", sport)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue