diff --git a/README.md b/README.md index 30622f7e18..fcba696aa3 100644 --- a/README.md +++ b/README.md @@ -114,11 +114,11 @@ target/release/ckb run ### Send Transaction via RPC -Find RPC port in the log output, the following command assumes 3030 is used: +Find RPC port in the log output, the following command assumes 8114 is used: ```shell curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "inputs":[], "outputs":[], "deps":[]}]}' \ - -H 'content-type:application/json' 'http://localhost:3030' + -H 'content-type:application/json' 'http://localhost:8114' ``` ### Advanced diff --git a/devtools/playground/random_transaction.rb b/devtools/playground/random_transaction.rb index 56d78eb786..94abc7c579 100755 --- a/devtools/playground/random_transaction.rb +++ b/devtools/playground/random_transaction.rb @@ -3,7 +3,7 @@ require 'net/http' require 'uri' -URL = ARGV[0] || "http://localhost:3030" +URL = ARGV[0] || "http://localhost:8114" CKB_BIN = ARGV[1] || "./target/debug/ckb" ACCOUNTS = [ { diff --git a/explorer/src/components/app.vue b/explorer/src/components/app.vue index 48268f8736..705f186010 100644 --- a/explorer/src/components/app.vue +++ b/explorer/src/components/app.vue @@ -33,7 +33,7 @@ import JsonRPC from "simple-jsonrpc-js" export default { data: function() { return { - addr: 'http://localhost:3030/', + addr: 'http://localhost:8114/', blocks: [], transactions: [], block: {}, diff --git a/rpc/src/integration_test.rs b/rpc/src/integration_test.rs index 31eded0846..577f82e55f 100644 --- a/rpc/src/integration_test.rs +++ b/rpc/src/integration_test.rs @@ -22,35 +22,35 @@ use std::sync::Arc; //TODO: build_rpc_trait! do not surppot trait bounds build_rpc_trait! { pub trait IntegrationTestRpc { - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"submit_solution","params": [1]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"submit_solution","params": [1]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "submit_pow_solution")] fn submit_pow_solution(&self, u64) -> Result<()>; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "deps":[], "inputs":[], "outputs":[]}]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "deps":[], "inputs":[], "outputs":[]}]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "send_transaction")] fn send_transaction(&self, Transaction) -> Result; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_block")] fn get_block(&self, H256) -> Result>; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_transaction","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_transaction","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_transaction")] fn get_transaction(&self, H256) -> Result>; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_hash","params": [1]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_hash","params": [1]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_block_hash")] fn get_block_hash(&self, u64) -> Result>; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_tip_header","params": []}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_tip_header","params": []}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_tip_header")] fn get_tip_header(&self) -> Result
; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_template","params": []}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_template","params": []}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_block_template")] fn get_block_template(&self) -> Result; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_cells_by_type_hash","params": ["0x1b1c832d02fdb4339f9868c8a8636c3d9dd10bd53ac7ce99595825bd6beeffb3", 1, 10]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_cells_by_type_hash","params": ["0x1b1c832d02fdb4339f9868c8a8636c3d9dd10bd53ac7ce99595825bd6beeffb3", 1, 10]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_cells_by_type_hash")] fn get_cells_by_type_hash(&self, H256, u64, u64) -> Result>; diff --git a/rpc/src/server.rs b/rpc/src/server.rs index e1266ae41a..ad9a945401 100644 --- a/rpc/src/server.rs +++ b/rpc/src/server.rs @@ -18,31 +18,31 @@ use std::sync::Arc; build_rpc_trait! { pub trait Rpc { - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "deps":[], "inputs":[], "outputs":[]}]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "deps":[], "inputs":[], "outputs":[]}]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "send_transaction")] fn send_transaction(&self, Transaction) -> Result; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_block")] fn get_block(&self, H256) -> Result>; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_transaction","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_transaction","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_transaction")] fn get_transaction(&self, H256) -> Result>; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_hash","params": [1]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_hash","params": [1]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_block_hash")] fn get_block_hash(&self, u64) -> Result>; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_tip_header","params": []}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_tip_header","params": []}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_tip_header")] fn get_tip_header(&self) -> Result
; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_template","params": []}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_template","params": []}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_block_template")] fn get_block_template(&self) -> Result; - // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_cells_by_type_hash","params": ["0x1b1c832d02fdb4339f9868c8a8636c3d9dd10bd53ac7ce99595825bd6beeffb3", 1, 10]}' -H 'content-type:application/json' 'http://localhost:3030' + // curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_cells_by_type_hash","params": ["0x1b1c832d02fdb4339f9868c8a8636c3d9dd10bd53ac7ce99595825bd6beeffb3", 1, 10]}' -H 'content-type:application/json' 'http://localhost:8114' #[rpc(name = "get_cells_by_type_hash")] fn get_cells_by_type_hash(&self, H256, u64, u64) -> Result>; } diff --git a/src/config/default.json b/src/config/default.json index 8d90220925..ef4fdd4f20 100644 --- a/src/config/default.json +++ b/src/config/default.json @@ -9,14 +9,10 @@ }, "network": { "listen_addresses": [ - "/ip4/0.0.0.0/tcp/0" - ], - "boot_nodes": [ - "/ip4/127.0.0.1/tcp/12345/p2p/QmVMJYDCL2vDnk4PmRGNdDRTWRnfeboUsriYA9CixJsBRf" - ], - "reserved_nodes": [ - "/ip4/127.0.0.1/tcp/12345/p2p/QmVMJYDCL2vDnk4PmRGNdDRTWRnfeboUsriYA9CixJsBRf" + "/ip4/0.0.0.0/tcp/8115" ], + "boot_nodes": [], + "reserved_nodes": [], "only_reserved_peers": false, "min_peers": 4, "max_peers": 8, @@ -24,7 +20,7 @@ "nodes_file": "nodes.json" }, "rpc": { - "listen_addr": "0.0.0.0:0" + "listen_addr": "0.0.0.0:8114" }, "sync": { "verification_level": "Full",