diff --git a/.github/workflows/deploy_mainnet.yml b/.github/workflows/deploy_mainnet.yml index 3fc5ac068c..78dcef21cf 100644 --- a/.github/workflows/deploy_mainnet.yml +++ b/.github/workflows/deploy_mainnet.yml @@ -26,5 +26,5 @@ jobs: chmod 600 private_key.pem sudo apt update sudo apt install -y --no-install-recommends openssh-server - ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && && docker image prune -a -f && docker ps | grep rooch | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ github.event.inputs.tagName }}' && docker run -d -v /data:/root -p 50051:50051 'ghcr.io/rooch-network/rooch:${{ github.event.inputs.tagName }}' server start -n main --btc-rpc-url '${{secrets.BTC_MAIN_RPC_URL}}' --btc-rpc-username rooch-main --btc-rpc-password '${{secrets.BTC_MAIN_RPC_PWD}}' --btc-start-block-height 0 --btc-end-block-height 767420 --data-import-mode 1" + ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && && docker image prune -a -f && docker ps | grep rooch | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ github.event.inputs.tagName }}' && docker run -d -v /data:/root -p 6767:6767 'ghcr.io/rooch-network/rooch:${{ github.event.inputs.tagName }}' server start -n main --btc-rpc-url '${{secrets.BTC_MAIN_RPC_URL}}' --btc-rpc-username rooch-main --btc-rpc-password '${{secrets.BTC_MAIN_RPC_PWD}}' --btc-start-block-height 0 --btc-end-block-height 767420 --data-import-mode 1" diff --git a/.github/workflows/deploy_testnet.yml b/.github/workflows/deploy_testnet.yml index cc547704b2..e84be09efd 100644 --- a/.github/workflows/deploy_testnet.yml +++ b/.github/workflows/deploy_testnet.yml @@ -64,4 +64,4 @@ jobs: chmod 600 private_key.pem sudo apt update sudo apt install -y --no-install-recommends openssh-server - ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a -f && docker ps | grep rooch | grep -v faucet | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | grep -v faucet | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ env.REF }}' && docker run -d --name rooch --restart unless-stopped -v /data:/root -p 50051:50051 'ghcr.io/rooch-network/rooch:${{ env.REF }}' server start -n test --btc-rpc-url '${{secrets.BTC_TEST_RPC_URL}}' --btc-rpc-username rooch-test --btc-rpc-password '${{secrets.BTC_TEST_RPC_PWD}}' --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"gcs\", \"config\": {\"bucket\": \"${{secrets.OPENDA_GCP_TESTNET_BUCKET}}\", \"credential\": \"${{secrets.OPENDA_GCP_TESTNET_CREDENTIAL}}\"}}}]}}'" + ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a -f && docker ps | grep rooch | grep -v faucet | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | grep -v faucet | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ env.REF }}' && docker run -d --name rooch --restart unless-stopped -v /data:/root -p 6767:6767 'ghcr.io/rooch-network/rooch:${{ env.REF }}' server start -n test --btc-rpc-url '${{secrets.BTC_TEST_RPC_URL}}' --btc-rpc-username rooch-test --btc-rpc-password '${{secrets.BTC_TEST_RPC_PWD}}' --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"gcs\", \"config\": {\"bucket\": \"${{secrets.OPENDA_GCP_TESTNET_BUCKET}}\", \"credential\": \"${{secrets.OPENDA_GCP_TESTNET_CREDENTIAL}}\"}}}]}}'" diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 1bdbd29751..aacf64b4ff 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -92,5 +92,5 @@ jobs: chmod 600 private_key.pem sudo apt update sudo apt install -y --no-install-recommends openssh-server - ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a -f && docker ps | grep main_debug | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep main_debug | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:main_debug' && docker run --rm -v /root:/root ghcr.io/rooch-network/rooch:main_debug server clean -n dev -f && docker run -d -v /root:/root -p 50051:50051 'ghcr.io/rooch-network/rooch:main_debug' server start -n dev --btc-rpc-url '${{secrets.BTC_REGTEST_RPC_URL}}' --btc-rpc-username rooch-regtest --btc-rpc-password '${{secrets.BTC_REGTEST_RPC_PWD}}' --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"fs\"}}]}}'" + ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a -f && docker ps | grep main_debug | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep main_debug | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:main_debug' && docker run --rm -v /root:/root ghcr.io/rooch-network/rooch:main_debug server clean -n dev -f && docker run -d -v /root:/root -p 6767:6767 'ghcr.io/rooch-network/rooch:main_debug' server start -n dev --btc-rpc-url '${{secrets.BTC_REGTEST_RPC_URL}}' --btc-rpc-username rooch-regtest --btc-rpc-password '${{secrets.BTC_REGTEST_RPC_PWD}}' --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"fs\"}}]}}'" ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST "cd /root/rooch && git pull origin main && bash scripts/check_dev_deploy_status.sh main_debug '${{ secrets.DEV_MNEMONIC_PHRASE }}'" diff --git a/crates/rooch-config/src/lib.rs b/crates/rooch-config/src/lib.rs index 164997ad2c..40db31d5d9 100644 --- a/crates/rooch-config/src/lib.rs +++ b/crates/rooch-config/src/lib.rs @@ -25,7 +25,6 @@ pub mod store_config; pub const ROOCH_DIR: &str = ".rooch"; pub const ROOCH_CONFIR_DIR: &str = "rooch_config"; pub const ROOCH_CLIENT_CONFIG: &str = "rooch.yaml"; -pub const ROOCH_SERVER_CONFIG: &str = "server.yaml"; pub const ROOCH_KEYSTORE_FILENAME: &str = "rooch.keystore"; pub static R_DEFAULT_BASE_DATA_DIR: Lazy = Lazy::new(|| { @@ -82,7 +81,7 @@ pub struct RoochOpt { pub store: StoreConfig, /// Optional custom port, which the rooch server should listen on. - /// The port on which the server should listen defaults to `50051` + /// The port on which the server should listen defaults to `6767` #[serde(skip_serializing_if = "Option::is_none")] #[clap(long, short = 'p')] pub port: Option, @@ -221,7 +220,7 @@ impl RoochOpt { } pub fn port(&self) -> u16 { - self.port.unwrap_or(50051) + self.port.unwrap_or(6767) } pub fn chain_id(&self) -> RoochChainID { diff --git a/crates/rooch-config/src/server_config.rs b/crates/rooch-config/src/server_config.rs index 142d1764d2..c5a1492f32 100644 --- a/crates/rooch-config/src/server_config.rs +++ b/crates/rooch-config/src/server_config.rs @@ -45,7 +45,7 @@ impl Default for ServerConfig { fn default() -> Self { Self { host: "0.0.0.0".to_string(), - port: 50051, + port: 6767, block_propose_duration_in_seconds: 5, } } diff --git a/crates/rooch-rpc-client/src/wallet_context.rs b/crates/rooch-rpc-client/src/wallet_context.rs index 3dc70b615a..14e4376f8d 100644 --- a/crates/rooch-rpc-client/src/wallet_context.rs +++ b/crates/rooch-rpc-client/src/wallet_context.rs @@ -8,8 +8,7 @@ use move_core_types::account_address::AccountAddress; use moveos_types::moveos_std::gas_schedule::GasScheduleConfig; use moveos_types::transaction::MoveAction; use rooch_config::config::{Config, PersistedConfig}; -use rooch_config::server_config::ServerConfig; -use rooch_config::{rooch_config_dir, ROOCH_CLIENT_CONFIG, ROOCH_SERVER_CONFIG}; +use rooch_config::{rooch_config_dir, ROOCH_CLIENT_CONFIG}; use rooch_key::keystore::account_keystore::AccountKeystore; use rooch_key::keystore::file_keystore::FileBasedKeystore; use rooch_key::keystore::Keystore; @@ -28,7 +27,6 @@ use tokio::sync::RwLock; pub struct WalletContext { client: Arc>>, pub client_config: PersistedConfig, - pub server_config: PersistedConfig, pub keystore: Keystore, pub address_mapping: BTreeMap, password: Option, @@ -40,22 +38,14 @@ impl WalletContext { pub fn new(config_path: Option) -> Result { let config_dir = config_path.unwrap_or(rooch_config_dir()?); let client_config_path = config_dir.join(ROOCH_CLIENT_CONFIG); - let server_config_path = config_dir.join(ROOCH_SERVER_CONFIG); let client_config: ClientConfig = PersistedConfig::read(&client_config_path).map_err(|err| { anyhow!( "Cannot open wallet config file at {:?}. Err: {err}, Use `rooch init` to configuration", client_config_path ) })?; - let server_config: ServerConfig = PersistedConfig::read(&server_config_path).map_err(|err| { - anyhow!( - "Cannot open server config file at {:?}. Err: {err}, Use `rooch init` to configuration", - server_config_path - ) - })?; let client_config = client_config.persisted(&client_config_path); - let server_config = server_config.persisted(&server_config_path); let keystore_result = FileBasedKeystore::load(&client_config.keystore_path); let keystore = match keystore_result { @@ -74,7 +64,6 @@ impl WalletContext { Ok(Self { client: Default::default(), client_config, - server_config, keystore, address_mapping, password: None, diff --git a/crates/rooch/src/commands/init.rs b/crates/rooch/src/commands/init.rs index 7cdf6cf865..55433b4acc 100644 --- a/crates/rooch/src/commands/init.rs +++ b/crates/rooch/src/commands/init.rs @@ -8,10 +8,7 @@ use clap::Parser; use fastcrypto::encoding::{Base64, Encoding}; use regex::Regex; use rooch_config::config::Config; -use rooch_config::server_config::ServerConfig; -use rooch_config::{ - rooch_config_dir, ROOCH_CLIENT_CONFIG, ROOCH_KEYSTORE_FILENAME, ROOCH_SERVER_CONFIG, -}; +use rooch_config::{rooch_config_dir, ROOCH_CLIENT_CONFIG, ROOCH_KEYSTORE_FILENAME}; use rooch_key::key_derive::hash_password; use rooch_key::keystore::account_keystore::AccountKeystore; use rooch_key::keystore::file_keystore::FileBasedKeystore; @@ -66,26 +63,6 @@ impl CommandAction<()> for Init { Err(error) => return Err(RoochError::GenerateKeyError(error.to_string())), }; - // Rooch server config init - let server_config_path = config_path.join(ROOCH_SERVER_CONFIG); - if !server_config_path.exists() { - let server_config = ServerConfig::default(); - - server_config - .persisted(server_config_path.as_path()) - .save()?; - - println!( - "Rooch server config file generated at {}", - server_config_path.display() - ); - } else { - println!( - "Rooch server config file already exists at {}", - server_config_path.display() - ); - } - // Prompt user for connect to devnet fullnode if config does not exist. if !client_config_path.exists() { let env = match std::env::var_os("ROOCH_CONFIG_WITH_RPC_URL") { @@ -117,7 +94,7 @@ impl CommandAction<()> for Init { if address_and_port_regex.is_match(&url) { url } else { - return Err(RoochError::CommandArgumentError("Invalid input format. Please provide a valid URL (e.g., http://0.0.0.0:50051).".to_owned())); + return Err(RoochError::CommandArgumentError("Invalid input format. Please provide a valid URL (e.g., http://0.0.0.0:6767).".to_owned())); } }; Some(if url.trim().is_empty() { diff --git a/docs/website/pages/build/getting-started/connect-to-rooch/connect-devnet.en-US.mdx b/docs/website/pages/build/getting-started/connect-to-rooch/connect-devnet.en-US.mdx index b43443e0c1..b868f769f8 100644 --- a/docs/website/pages/build/getting-started/connect-to-rooch/connect-devnet.en-US.mdx +++ b/docs/website/pages/build/getting-started/connect-to-rooch/connect-devnet.en-US.mdx @@ -10,7 +10,7 @@ rooch env list ```text Env Alias | RPC URL | Websocket URL | Active Env --------------------------------------------------------------------------------------------------------------------------------------------------------- - local | http://0.0.0.0:50051 | Null | + local | http://0.0.0.0:6767 | Null | dev | https://dev-seed.rooch.network:443/ | Null | True ``` diff --git a/docs/website/pages/build/getting-started/connect-to-rooch/connect-devnet.zh-CN.mdx b/docs/website/pages/build/getting-started/connect-to-rooch/connect-devnet.zh-CN.mdx index 9a32d2e249..165c7881ba 100644 --- a/docs/website/pages/build/getting-started/connect-to-rooch/connect-devnet.zh-CN.mdx +++ b/docs/website/pages/build/getting-started/connect-to-rooch/connect-devnet.zh-CN.mdx @@ -10,7 +10,7 @@ rooch env list ```text Env Alias | RPC URL | Websocket URL | Active Env --------------------------------------------------------------------------------------------------------------------------------------------------------- - local | http://0.0.0.0:50051 | Null | + local | http://0.0.0.0:6767 | Null | dev | https://dev-seed.rooch.network:443/ | Null | True ``` diff --git a/docs/website/pages/build/getting-started/connect-to-rooch/connect-testnet.en-US.mdx b/docs/website/pages/build/getting-started/connect-to-rooch/connect-testnet.en-US.mdx index 038ac69e64..a4ff754b6d 100644 --- a/docs/website/pages/build/getting-started/connect-to-rooch/connect-testnet.en-US.mdx +++ b/docs/website/pages/build/getting-started/connect-to-rooch/connect-testnet.en-US.mdx @@ -11,7 +11,7 @@ rooch env list ```bash Env Alias | RPC URL | Websocket URL | Active Env --------------------------------------------------------------------------------------------------------------------------------------------------------- - local | http://0.0.0.0:50051 | Null | + local | http://0.0.0.0:6767 | Null | dev | https://dev-seed.rooch.network:443/ | Null | True ``` @@ -36,7 +36,7 @@ rooch env list ```bash Env Alias | RPC URL | Websocket URL | Active Env --------------------------------------------------------------------------------------------------------------------------------------------------------- - local | http://0.0.0.0:50051 | Null | + local | http://0.0.0.0:6767 | Null | dev | https://dev-seed.rooch.network:443/ | Null | test | https://test-seed.rooch.network:443 | Null | True ``` diff --git a/docs/website/pages/build/getting-started/connect-to-rooch/connect-testnet.zh-CN.mdx b/docs/website/pages/build/getting-started/connect-to-rooch/connect-testnet.zh-CN.mdx index dda3b15cea..4de5e3016b 100644 --- a/docs/website/pages/build/getting-started/connect-to-rooch/connect-testnet.zh-CN.mdx +++ b/docs/website/pages/build/getting-started/connect-to-rooch/connect-testnet.zh-CN.mdx @@ -11,7 +11,7 @@ rooch env list ```bash Env Alias | RPC URL | Websocket URL | Active Env --------------------------------------------------------------------------------------------------------------------------------------------------------- - local | http://0.0.0.0:50051 | Null | + local | http://0.0.0.0:6767 | Null | dev | https://dev-seed.rooch.network:443/ | Null | True ``` @@ -36,7 +36,7 @@ rooch env list ```bash Env Alias | RPC URL | Websocket URL | Active Env --------------------------------------------------------------------------------------------------------------------------------------------------------- - local | http://0.0.0.0:50051 | Null | + local | http://0.0.0.0:6767 | Null | dev | https://dev-seed.rooch.network:443/ | Null | test | https://test-seed.rooch.network:443 | Null | True ``` diff --git a/docs/website/pages/build/getting-started/connect-to-rooch/run-local-testnet.en-US.mdx b/docs/website/pages/build/getting-started/connect-to-rooch/run-local-testnet.en-US.mdx index a81fb673ab..c359e9c0df 100644 --- a/docs/website/pages/build/getting-started/connect-to-rooch/run-local-testnet.en-US.mdx +++ b/docs/website/pages/build/getting-started/connect-to-rooch/run-local-testnet.en-US.mdx @@ -19,7 +19,7 @@ StoreConfig init store dir "/Users/username/.rooch/local/roochdb/rooch_store" "/ 2023-10-19T16:20:30.235233Z INFO rooch_sequencer::actor::sequencer: Load latest sequencer order 0 2023-10-19T16:20:30.235487Z INFO rooch_rpc_server: RPC Server proposer address: 0x5078ae74bac281e65fc446b467a843b186904a1b2d435f367030fc755eef1081 2023-10-19T16:20:30.235882Z INFO rooch_rpc_server: acl=Const("*") -2023-10-19T16:20:30.236662Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:50051 +2023-10-19T16:20:30.236662Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:6767 2023-10-19T16:20:30.236674Z INFO rooch_rpc_server: Available JSON-RPC methods : ["eth_blockNumber", "eth_getBalance", "eth_gasPrice", "net_version", "rooch_getBalance", "eth_sendTransaction", "rooch_sendRawTransaction", "rooch_getTransactionsByHash", "eth_getTransactionCount", "rooch_executeRawTransaction", "rooch_getEventsByEventHandle", "eth_sendRawTransaction", "eth_getTransactionByHash", "rooch_executeViewFunction", "rooch_getBalances", "eth_getBlockByNumber", "eth_feeHistory", "rooch_listStates", "rooch_getTransactionsByOrder", "eth_getBlockByHash", "rooch_getChainID", "eth_getTransactionReceipt", "eth_estimateGas", "eth_chainId", "rooch_getStates"] The active env was successfully switched to `local` ``` @@ -28,7 +28,7 @@ The active env was successfully switched to `local` 1. Name: local 2. ChainID: 4 -3. RPC: http://localhost:50051 +3. RPC: http://localhost:6767 ## Solve data compatibility issues diff --git a/docs/website/pages/build/getting-started/connect-to-rooch/run-local-testnet.zh-CN.mdx b/docs/website/pages/build/getting-started/connect-to-rooch/run-local-testnet.zh-CN.mdx index d46036dfc8..2ebc7005f9 100644 --- a/docs/website/pages/build/getting-started/connect-to-rooch/run-local-testnet.zh-CN.mdx +++ b/docs/website/pages/build/getting-started/connect-to-rooch/run-local-testnet.zh-CN.mdx @@ -16,7 +16,7 @@ $ rooch server start StoreConfig init store dir "/tmp/.tmpHkNH5Q/dev/roochdb/rooch_store" "/tmp/.tmpHkNH5Q/dev/roochdb/moveos_store" 2023-09-14T08:21:33.234354Z INFO moveos_common::utils: set max open fds 45056 2023-09-14T08:21:34.013627Z INFO rooch_rpc_server: acl=Const("*") -2023-09-14T08:21:34.013899Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:50051 +2023-09-14T08:21:34.013899Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:6767 2023-09-14T08:21:34.013910Z INFO rooch_rpc_server: Available JSON-RPC methods : ["eth_blockNumber", "eth_sendTransaction", "eth_sendRawTransaction", "net_version", "rooch_listAnnotatedStates", "rooch_sendRawTransaction", "rooch_getAnnotatedStates", "rooch_executeRawTransaction", "eth_estimateGas", "rooch_executeViewFunction", "rooch_getBalances", "rooch_getEvents", "rooch_getStates", "eth_getBalance", "eth_gasPrice", "eth_getTransactionByHash", "eth_getTransactionCount", "rooch_getTransactionByIndex", "rooch_getEventsByEventHandle", "eth_getTransactionReceipt", "rooch_getTransactionByHash", "eth_getBlockByNumber", "eth_feeHistory", "eth_getBlockByHash", "rooch_listStates", "rooch_getTransactionInfosByTxOrder", "eth_chainId", "rooch_getTransactionInfosByTxHash", "wallet_sign", "wallet_accounts"] ``` @@ -24,7 +24,7 @@ StoreConfig init store dir "/tmp/.tmpHkNH5Q/dev/roochdb/rooch_store" "/tmp/.tmpH 1. 名称: local 2. ChainID: 4 -3. RPC: http://localhost:50051 +3. RPC: http://localhost:6767 ## 解决数据兼容问题 diff --git a/docs/website/pages/build/reference/rooch-cli.en-US.mdx b/docs/website/pages/build/reference/rooch-cli.en-US.mdx index b3daacbb86..dd42b7dcd3 100644 --- a/docs/website/pages/build/reference/rooch-cli.en-US.mdx +++ b/docs/website/pages/build/reference/rooch-cli.en-US.mdx @@ -174,7 +174,7 @@ The response is similar to the following: ```shell Documentation generation successful! -2023-07-17T05:34:49.963869Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:50051 +2023-07-17T05:34:49.963869Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:6767 2023-07-17T05:34:49.963893Z INFO rooch_rpc_server: Available JSON-RPC methods : ["wallet_accounts", "eth_blockNumber", "eth_getBalance", "eth_gasPrice", "net_version", "eth_getTransactionCount", "eth_sendTransaction", "rooch_sendRawTransaction", "rooch_getAnnotatedStates", "eth_sendRawTransaction", "rooch_getTransactions", "rooch_executeRawTransaction", "rooch_getEventsByEventHandle", "rooch_getTransactionByHash", "rooch_executeViewFunction", "eth_getBlockByNumber", "rooch_getEvents", "eth_feeHistory", "eth_getTransactionByHash", "eth_getBlockByHash", "eth_getTransactionReceipt", "rooch_getTransactionInfosByTxOrder", "eth_estimateGas", "eth_chainId", "rooch_getTransactionInfosByTxHash", "wallet_sign", "rooch_getStates"] ``` diff --git a/docs/website/pages/build/reference/rooch-cli.zh-CN.mdx b/docs/website/pages/build/reference/rooch-cli.zh-CN.mdx index 4974e02598..e141f7de8c 100644 --- a/docs/website/pages/build/reference/rooch-cli.zh-CN.mdx +++ b/docs/website/pages/build/reference/rooch-cli.zh-CN.mdx @@ -174,7 +174,7 @@ Options: ```shell Documentation generation successful! -2023-07-17T05:34:49.963869Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:50051 +2023-07-17T05:34:49.963869Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:6767 2023-07-17T05:34:49.963893Z INFO rooch_rpc_server: Available JSON-RPC methods : ["wallet_accounts", "eth_blockNumber", "eth_getBalance", "eth_gasPrice", "net_version", "eth_getTransactionCount", "eth_sendTransaction", "rooch_sendRawTransaction", "rooch_getAnnotatedStates", "eth_sendRawTransaction", "rooch_getTransactions", "rooch_executeRawTransaction", "rooch_getEventsByEventHandle", "rooch_getTransactionByHash", "rooch_executeViewFunction", "eth_getBlockByNumber", "rooch_getEvents", "eth_feeHistory", "eth_getTransactionByHash", "eth_getBlockByHash", "eth_getTransactionReceipt", "rooch_getTransactionInfosByTxOrder", "eth_estimateGas", "eth_chainId", "rooch_getTransactionInfosByTxHash", "wallet_sign", "rooch_getStates"] ``` diff --git a/docs/website/pages/build/reference/rpc/json-rpc.en-US.mdx b/docs/website/pages/build/reference/rpc/json-rpc.en-US.mdx index ea7aba6200..8fdc94b731 100644 --- a/docs/website/pages/build/reference/rpc/json-rpc.en-US.mdx +++ b/docs/website/pages/build/reference/rpc/json-rpc.en-US.mdx @@ -1132,7 +1132,7 @@ Response: ### btc_queryUTXOs ```shell -curl --location 'http://localhost:50051' \ +curl --location 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data '{ "id": 101, @@ -1217,7 +1217,7 @@ curl --location 'http://localhost:50051' \ ### btc_queryUTXOs ```shell -curl --location 'http://localhost:50051' \ +curl --location 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data '{ "id": 101, @@ -1302,7 +1302,7 @@ curl --location 'http://localhost:50051' \ ### btc_queryInscriptions ```shell -curl --location 'http://localhost:50051' \ +curl --location 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data '{ "id": 101, @@ -1356,7 +1356,7 @@ curl --location 'http://localhost:50051' \ ### btc_queryInscriptions ```shell -curl --location 'http://localhost:50051' \ +curl --location 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data '{ "id": 101, diff --git a/docs/website/pages/build/reference/rpc/json-rpc.zh-CN.mdx b/docs/website/pages/build/reference/rpc/json-rpc.zh-CN.mdx index 4da4b400cd..8a83a24b6e 100644 --- a/docs/website/pages/build/reference/rpc/json-rpc.zh-CN.mdx +++ b/docs/website/pages/build/reference/rpc/json-rpc.zh-CN.mdx @@ -1132,7 +1132,7 @@ curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: app ### btc_queryUTXOs ```shell -curl --location 'http://localhost:50051' \ +curl --location 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data '{ "id": 101, @@ -1217,7 +1217,7 @@ curl --location 'http://localhost:50051' \ ### btc_queryUTXOs ```shell -curl --location 'http://localhost:50051' \ +curl --location 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data '{ "id": 101, @@ -1302,7 +1302,7 @@ curl --location 'http://localhost:50051' \ ### btc_queryInscriptions ```shell -curl --location 'http://localhost:50051' \ +curl --location 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data '{ "id": 101, @@ -1356,7 +1356,7 @@ curl --location 'http://localhost:50051' \ ### btc_queryInscriptions ```shell -curl --location 'http://localhost:50051' \ +curl --location 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data '{ "id": 101, diff --git a/docs/website/pages/build/tutorial/blog-demo.en-US.mdx b/docs/website/pages/build/tutorial/blog-demo.en-US.mdx index ebc331d3c0..767c7ac340 100644 --- a/docs/website/pages/build/tutorial/blog-demo.en-US.mdx +++ b/docs/website/pages/build/tutorial/blog-demo.en-US.mdx @@ -334,7 +334,7 @@ rooch server start After starting the Rooch service, you will see these two messages at the end, indicating that the Rooch service has been started normally. ```shell -2023-07-03T15:44:33.315228Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:50051 +2023-07-03T15:44:33.315228Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:6767 2023-07-03T15:44:33.315256Z INFO rooch_rpc_server: Available JSON-RPC methods : ["wallet_accounts", "eth_blockNumber", "eth_getBalance", "eth_gasPrice", "net_version", "eth_getTransactionCount", "eth_sendTransaction", "rooch_sendRawTransaction", "rooch_getAnnotatedStates", "eth_sendRawTransaction", "rooch_getTransactions", "rooch_executeRawTransaction", "rooch_getEventsByEventHandle", "rooch_getTransactionByHash", "rooch_executeViewFunction", "eth_getBlockByNumber", "rooch_getEvents", "eth_feeHistory", "eth_getTransactionByHash", "eth_getBlockByHash", "eth_getTransactionReceipt", "rooch_getTransactionInfosByOrder", "eth_estimateGas", "eth_chainId", "rooch_getTransactionInfosByHash", "wallet_sign", "rooch_getStates"] ``` @@ -742,7 +742,7 @@ You can freely change the content of the first parameter (`title`) and the secon Now, you can get the `ObjectID` of the created article by querying the event: ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -759,7 +759,7 @@ Since there are many output contents, you can add a pipeline operation (` | jq ' The command after adding `jp` processing looks like this: ```shell -curl --location --request POST 'http://localhost:50051' --header 'Content-Type: application/json' --data-raw '{ +curl --location --request POST 'http://localhost:6767' --header 'Content-Type: application/json' --data-raw '{ "id":101, "jsonrpc":"2.0", "method":"rooch_getEventsByEventHandle", @@ -854,7 +854,7 @@ rooch move run --function default::simple_blog::update_article --sender-account In addition to using the Rooch CLI, you can also query the state of objects by calling JSON RPC: ```shell -curl --location --request POST 'http://127.0.0.1:50051/' --header 'Content-Type: application/json' --data-raw '{ +curl --location --request POST 'http://127.0.0.1:6767/' --header 'Content-Type: application/json' --data-raw '{ "id":101, "jsonrpc":"2.0", "method":"rooch_getStates", diff --git a/docs/website/pages/build/tutorial/blog-demo.zh-CN.mdx b/docs/website/pages/build/tutorial/blog-demo.zh-CN.mdx index 02d0f6a37d..cf9f5b1157 100644 --- a/docs/website/pages/build/tutorial/blog-demo.zh-CN.mdx +++ b/docs/website/pages/build/tutorial/blog-demo.zh-CN.mdx @@ -334,7 +334,7 @@ rooch server start 当启动 Rooch 服务后,会在最后看到这两条信息,表明 Rooch 的服务已经正常启动。 ```shell -2023-07-03T15:44:33.315228Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:50051 +2023-07-03T15:44:33.315228Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:6767 2023-07-03T15:44:33.315256Z INFO rooch_rpc_server: Available JSON-RPC methods : ["wallet_accounts", "eth_blockNumber", "eth_getBalance", "eth_gasPrice", "net_version", "eth_getTransactionCount", "eth_sendTransaction", "rooch_sendRawTransaction", "rooch_getAnnotatedStates", "eth_sendRawTransaction", "rooch_getTransactions", "rooch_executeRawTransaction", "rooch_getEventsByEventHandle", "rooch_getTransactionByHash", "rooch_executeViewFunction", "eth_getBlockByNumber", "rooch_getEvents", "eth_feeHistory", "eth_getTransactionByHash", "eth_getBlockByHash", "eth_getTransactionReceipt", "rooch_getTransactionInfosByOrder", "eth_estimateGas", "eth_chainId", "rooch_getTransactionInfosByHash", "wallet_sign", "rooch_getStates"] ``` @@ -742,7 +742,7 @@ rooch move run --function default::simple_blog::create_article --sender-account 现在,你可以通过查询事件,得到已创建好的文章的 `ObjectID`: ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -759,7 +759,7 @@ curl --location --request POST 'http://localhost:50051' \ 添加 `jp` 处理后的命令像下面这样: ```shell -curl --location --request POST 'http://localhost:50051' --header 'Content-Type: application/json' --data-raw '{ +curl --location --request POST 'http://localhost:6767' --header 'Content-Type: application/json' --data-raw '{ "id":101, "jsonrpc":"2.0", "method":"rooch_getEventsByEventHandle", @@ -854,7 +854,7 @@ rooch move run --function default::simple_blog::update_article --sender-account 除了使用 Rooch CLI,你还可以通过调用 JSON RPC 来查询对象的状态: ```shell -curl --location --request POST 'http://127.0.0.1:50051/' --header 'Content-Type: application/json' --data-raw '{ +curl --location --request POST 'http://127.0.0.1:6767/' --header 'Content-Type: application/json' --data-raw '{ "id":101, "jsonrpc":"2.0", "method":"rooch_getStates", diff --git a/docs/website/pages/build/tutorial/counter.en-US.mdx b/docs/website/pages/build/tutorial/counter.en-US.mdx index 8ac14eec53..8b75a2c941 100644 --- a/docs/website/pages/build/tutorial/counter.en-US.mdx +++ b/docs/website/pages/build/tutorial/counter.en-US.mdx @@ -137,7 +137,7 @@ $ rooch env list Env Alias | RPC URL | Websocket URL | Active Env --------------------------------------------------------------------------------------------------------------------------------------------------------- - local | http://0.0.0.0:50051 | Null | + local | http://0.0.0.0:6767 | Null | dev | https://dev-seed.rooch.network:443/ | Null | True test | https://test-seed.rooch.network:443/ | Null | ``` diff --git a/docs/website/pages/build/tutorial/counter.zh-CN.mdx b/docs/website/pages/build/tutorial/counter.zh-CN.mdx index ef46dfef43..366b9a5a04 100644 --- a/docs/website/pages/build/tutorial/counter.zh-CN.mdx +++ b/docs/website/pages/build/tutorial/counter.zh-CN.mdx @@ -137,7 +137,7 @@ $ rooch env list Env Alias | RPC URL | Websocket URL | Active Env --------------------------------------------------------------------------------------------------------------------------------------------------------- - local | http://0.0.0.0:50051 | Null | + local | http://0.0.0.0:6767 | Null | dev | https://dev-seed.rooch.network:443/ | Null | True test | https://test-seed.rooch.network:443/ | Null | ``` diff --git a/examples/blog/README.md b/examples/blog/README.md index 3243caef21..dc92786341 100644 --- a/examples/blog/README.md +++ b/examples/blog/README.md @@ -255,7 +255,7 @@ Then you can change the content of the first parameter (title) and the second pa Now, you can query events and get the `ObjectID` of the created article: ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -274,7 +274,7 @@ You can add a pipe operation (` | jq '.result.data[0].parsed_event_data.value.id The command with `jp` processing looks like this: ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -301,7 +301,7 @@ rooch move run --function {ACCOUNT_ADDRESS}::article_aggregate::update --sender- In addition to using Rooch CLI, you can also query the object state by calling JSON RPC: ```shell -curl --location --request POST 'http://127.0.0.1:50051/' \ +curl --location --request POST 'http://127.0.0.1:6767/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -326,7 +326,7 @@ rooch move run --function {ACCOUNT_ADDRESS}::article_aggregate::delete --sender- Let's get the ObjectID of another article (note the path parameter `.result.data[1]` in the `jq` command below, we intend to get the information of the "second" ArticleCreated event): ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -355,7 +355,7 @@ In our contract code, when a comment is added to an article, a `CommentTableItem So, by querying events, we know which comments an article has: ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -372,7 +372,7 @@ We can query the specific information of a comment through JSON RPC. To get an i First, we need to get the handle of an article's comment table: ```shell -curl --location --request POST 'http://127.0.0.1:50051/' \ +curl --location --request POST 'http://127.0.0.1:6767/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -387,7 +387,7 @@ We already know that the `comment_seq_id` (i.e. the table item key) of the comme Then, we can get the specific information of the comment by the following way (note to replace the placeholder `{COMMENT_TABLE_HANDLE}` with the handle of the "comment table" obtained above): ```shell -curl --location --request POST 'http://127.0.0.1:50051/' \ +curl --location --request POST 'http://127.0.0.1:6767/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -412,7 +412,7 @@ rooch move run --function {ACCOUNT_ADDRESS}::article_aggregate::update_comment - Then we can query the comment state again to see if the comment content has been updated: ```shell -curl --location --request POST 'http://127.0.0.1:50051/' \ +curl --location --request POST 'http://127.0.0.1:6767/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -467,7 +467,7 @@ rooch: contract: address: "{ACCOUNT_ADDRESS}" jsonrpc: - url: "http://127.0.0.1:50051" + url: "http://127.0.0.1:6767" ``` This is the only place where the off-chain service needs to be configured, and it's that simple. diff --git a/examples/blog/README_CN.md b/examples/blog/README_CN.md index ac48fbd419..ad589b4a9a 100644 --- a/examples/blog/README_CN.md +++ b/examples/blog/README_CN.md @@ -255,7 +255,7 @@ rooch move run --function {ACCOUNT_ADDRESS}::article_aggregate::create --sender- 现在,你可以通过查询事件,得到已创建好的文章的 `ObjectID`: ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -274,7 +274,7 @@ curl --location --request POST 'http://localhost:50051' \ 添加 `jp` 处理后的命令像下面这样: ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -301,7 +301,7 @@ rooch move run --function {ACCOUNT_ADDRESS}::article_aggregate::update --sender- 除了使用 Rooch CLI,你还可以通过调用 JSON RPC 来查询对象的状态: ```shell -curl --location --request POST 'http://127.0.0.1:50051/' \ +curl --location --request POST 'http://127.0.0.1:6767/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -326,7 +326,7 @@ rooch move run --function {ACCOUNT_ADDRESS}::article_aggregate::delete --sender- 让我们再获取另一篇文章的 ObjectID(注意下面 `jq` 命令的路径参数 `.result.data[1]`,我们打算获取的是“第二个” `ArticleCreated` 事件的信息): ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -355,7 +355,7 @@ rooch move run --function {ACCOUNT_ADDRESS}::article_aggregate::add_comment --se 所以,通过查询事件,我们知道一篇文章有那些评论: ```shell -curl --location --request POST 'http://localhost:50051' \ +curl --location --request POST 'http://localhost:6767' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -372,7 +372,7 @@ curl --location --request POST 'http://localhost:50051' \ 首先,我们要取得一篇文章的评论表的 handle: ```shell -curl --location --request POST 'http://127.0.0.1:50051/' \ +curl --location --request POST 'http://127.0.0.1:6767/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -387,7 +387,7 @@ curl --location --request POST 'http://127.0.0.1:50051/' \ 那么,我们可以通过下面的方式获取的评论的具体信息(注意替换下面的占位符 `{COMMENT_TABLE_HANDLE}` 为上面获取到的“评论表”的 handle): ```shell -curl --location --request POST 'http://127.0.0.1:50051/' \ +curl --location --request POST 'http://127.0.0.1:6767/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -412,7 +412,7 @@ rooch move run --function {ACCOUNT_ADDRESS}::article_aggregate::update_comment - 然后我们可以再次查询评论的状态,看看评论内容是否已经更新: ```shell -curl --location --request POST 'http://127.0.0.1:50051/' \ +curl --location --request POST 'http://127.0.0.1:6767/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id":101, @@ -467,7 +467,7 @@ rooch: contract: address: "{ACCOUNT_ADDRESS}" jsonrpc: - url: "http://127.0.0.1:50051" + url: "http://127.0.0.1:6767" ``` 这是链下服务唯一必需配置的地方,就是这么简单。 diff --git a/infra/rooch-portal/script/env.sh b/infra/rooch-portal/script/env.sh index 418e3c50d5..cf99812cbf 100755 --- a/infra/rooch-portal/script/env.sh +++ b/infra/rooch-portal/script/env.sh @@ -9,7 +9,7 @@ rooch() { default_address=$(rooch account list | awk '/0x[0-9a-fA-F]+/{addr=$1} END{print addr}') reset () { - lsof -ti:50051 | xargs kill + lsof -ti:6767 | xargs kill rooch server clean -n local -f diff --git a/scripts/bitcoin/env.sh b/scripts/bitcoin/env.sh index 7bcf0853da..9de38b2897 100755 --- a/scripts/bitcoin/env.sh +++ b/scripts/bitcoin/env.sh @@ -112,7 +112,7 @@ clean() { # stop ord server lsof -ti:80 | xargs kill - lsof -ti:50051 | xargs kill + lsof -ti:6767 | xargs kill echo b # clean bitcoin docker diff --git a/sdk/typescript/rooch-sdk/src/constants/networks.ts b/sdk/typescript/rooch-sdk/src/constants/networks.ts index c6dd8e7310..bd0b84755b 100644 --- a/sdk/typescript/rooch-sdk/src/constants/networks.ts +++ b/sdk/typescript/rooch-sdk/src/constants/networks.ts @@ -1,7 +1,7 @@ // Copyright (c) RoochNetwork // SPDX-License-Identifier: Apache-2.0 -const LocalNetworkURL = 'http://127.0.0.1:50051' +const LocalNetworkURL = 'http://127.0.0.1:6767' const DevNetworkURL = 'https://dev-seed.rooch.network:443' const TestNetworkURL = 'https://test-seed.rooch.network' diff --git a/sdk/typescript/rooch-sdk/test/e2e/servers/rooch-server.ts b/sdk/typescript/rooch-sdk/test/e2e/servers/rooch-server.ts index 457c25820e..19444b0652 100644 --- a/sdk/typescript/rooch-sdk/test/e2e/servers/rooch-server.ts +++ b/sdk/typescript/rooch-sdk/test/e2e/servers/rooch-server.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { spawn, ChildProcess } from 'child_process' -export const DefaultPort = 50051 +export const DefaultPort = 6767 export class RoochServer { private child: ChildProcess | undefined