Skip to content

Commit beabf95

Browse files
authored
cmd/geth, cmd/puppeth: replace deprecated rpc and ws flags in tests and docs (#21317)
1 parent 6ccce09 commit beabf95

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ above command does. It will also create a persistent volume in your home direct
162162
saving your blockchain as well as map the default ports. There is also an `alpine` tag
163163
available for a slim version of the image.
164164

165-
Do not forget `--rpcaddr 0.0.0.0`, if you want to access RPC from other containers
165+
Do not forget `--http.addr 0.0.0.0`, if you want to access RPC from other containers
166166
and/or hosts. By default, `geth` binds to the local interface and RPC endpoints is not
167167
accessible from the outside.
168168

@@ -182,16 +182,16 @@ you'd expect.
182182

183183
HTTP based JSON-RPC API options:
184184

185-
* `--rpc` Enable the HTTP-RPC server
186-
* `--rpcaddr` HTTP-RPC server listening interface (default: `localhost`)
187-
* `--rpcport` HTTP-RPC server listening port (default: `8545`)
188-
* `--rpcapi` API's offered over the HTTP-RPC interface (default: `eth,net,web3`)
189-
* `--rpccorsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced)
185+
* `--http` Enable the HTTP-RPC server
186+
* `--http.addr` HTTP-RPC server listening interface (default: `localhost`)
187+
* `--http.port` HTTP-RPC server listening port (default: `8545`)
188+
* `--http.api` API's offered over the HTTP-RPC interface (default: `eth,net,web3`)
189+
* `--http.corsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced)
190190
* `--ws` Enable the WS-RPC server
191-
* `--wsaddr` WS-RPC server listening interface (default: `localhost`)
192-
* `--wsport` WS-RPC server listening port (default: `8546`)
193-
* `--wsapi` API's offered over the WS-RPC interface (default: `eth,net,web3`)
194-
* `--wsorigins` Origins from which to accept websockets requests
191+
* `--ws.addr` WS-RPC server listening interface (default: `localhost`)
192+
* `--ws.port` WS-RPC server listening port (default: `8546`)
193+
* `--ws.api` API's offered over the WS-RPC interface (default: `eth,net,web3`)
194+
* `--ws.origins` Origins from which to accept websockets requests
195195
* `--ipcdisable` Disable the IPC-RPC server
196196
* `--ipcapi` API's offered over the IPC-RPC interface (default: `admin,debug,eth,miner,net,personal,shh,txpool,web3`)
197197
* `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it)

cmd/geth/consolecmd_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func TestHTTPAttachWelcome(t *testing.T) {
104104
port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P
105105
geth := runGeth(t,
106106
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
107-
"--etherbase", coinbase, "--rpc", "--rpcport", port)
107+
"--etherbase", coinbase, "--http", "--http.port", port)
108108
defer func() {
109109
geth.Interrupt()
110110
geth.ExpectExit()
@@ -121,7 +121,7 @@ func TestWSAttachWelcome(t *testing.T) {
121121

122122
geth := runGeth(t,
123123
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
124-
"--etherbase", coinbase, "--ws", "--wsport", port)
124+
"--etherbase", coinbase, "--ws", "--ws.port", port)
125125
defer func() {
126126
geth.Interrupt()
127127
geth.ExpectExit()

cmd/geth/les_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (g *gethrpc) waitSynced() {
9797

9898
func startGethWithRpc(t *testing.T, name string, args ...string) *gethrpc {
9999
g := &gethrpc{name: name}
100-
args = append([]string{"--networkid=42", "--port=0", "--nousb", "--rpc", "--rpcport=0", "--rpcapi=admin,eth,les"}, args...)
100+
args = append([]string{"--networkid=42", "--port=0", "--nousb", "--http", "--http.port=0", "--http.api=admin,eth,les"}, args...)
101101
t.Logf("Starting %v with rpc: %v", name, args)
102102
g.geth = runGeth(t, args...)
103103
// wait before we can attach to it. TODO: probe for it properly

cmd/puppeth/module_explorer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ FROM puppeth/blockscout:latest
3535
ADD genesis.json /genesis.json
3636
RUN \
3737
echo 'geth --cache 512 init /genesis.json' > explorer.sh && \
38-
echo $'geth --networkid {{.NetworkID}} --syncmode "full" --gcmode "archive" --port {{.EthPort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --rpc --rpcapi "net,web3,eth,shh,debug" --rpccorsdomain "*" --rpcvhosts "*" --ws --wsorigins "*" --exitwhensynced' >> explorer.sh && \
39-
echo $'exec geth --networkid {{.NetworkID}} --syncmode "full" --gcmode "archive" --port {{.EthPort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --rpc --rpcapi "net,web3,eth,shh,debug" --rpccorsdomain "*" --rpcvhosts "*" --ws --wsorigins "*" &' >> explorer.sh && \
38+
echo $'geth --networkid {{.NetworkID}} --syncmode "full" --gcmode "archive" --port {{.EthPort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --http --http.api "net,web3,eth,shh,debug" --http.corsdomain "*" --http.vhosts "*" --ws --ws.origins "*" --exitwhensynced' >> explorer.sh && \
39+
echo $'exec geth --networkid {{.NetworkID}} --syncmode "full" --gcmode "archive" --port {{.EthPort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --http --http.api "net,web3,eth,shh,debug" --http.corsdomain "*" --http.vhosts "*" --ws --ws.origins "*" &' >> explorer.sh && \
4040
echo '/usr/local/bin/docker-entrypoint.sh postgres &' >> explorer.sh && \
4141
echo 'sleep 5' >> explorer.sh && \
4242
echo 'mix do ecto.drop --force, ecto.create, ecto.migrate' >> explorer.sh && \

cmd/puppeth/module_wallet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ADD genesis.json /genesis.json
3737
RUN \
3838
echo 'node server.js &' > wallet.sh && \
3939
echo 'geth --cache 512 init /genesis.json' >> wallet.sh && \
40-
echo $'exec geth --networkid {{.NetworkID}} --port {{.NodePort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --rpc --rpcaddr=0.0.0.0 --rpccorsdomain "*" --rpcvhosts "*"' >> wallet.sh
40+
echo $'exec geth --networkid {{.NetworkID}} --port {{.NodePort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --http --http.addr=0.0.0.0 --http.corsdomain "*" --http.vhosts "*"' >> wallet.sh
4141
4242
RUN \
4343
sed -i 's/PuppethNetworkID/{{.NetworkID}}/g' dist/js/etherwallet-master.js && \

0 commit comments

Comments
 (0)