{"id":21302241,"url":"https://github.com/newtonproject/newcommander","last_synced_at":"2025-07-11T20:31:39.374Z","repository":{"id":45341170,"uuid":"272762629","full_name":"newtonproject/newcommander","owner":"newtonproject","description":"A commandline client for the NewChain.","archived":false,"fork":false,"pushed_at":"2024-12-25T12:44:46.000Z","size":312,"stargazers_count":4,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T08:41:56.997Z","etag":null,"topics":["ethereum","go","newchain","newton","tool","wallet"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newtonproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-16T16:47:32.000Z","updated_at":"2024-12-25T12:44:49.000Z","dependencies_parsed_at":"2024-06-20T05:42:21.461Z","dependency_job_id":"e01da8e7-20fc-41d7-8e2a-a8c67229c01d","html_url":"https://github.com/newtonproject/newcommander","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/newtonproject/newcommander","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtonproject%2Fnewcommander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtonproject%2Fnewcommander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtonproject%2Fnewcommander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtonproject%2Fnewcommander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newtonproject","download_url":"https://codeload.github.com/newtonproject/newcommander/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtonproject%2Fnewcommander/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264892307,"owners_count":23679268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","go","newchain","newton","tool","wallet"],"created_at":"2024-11-21T15:55:27.560Z","updated_at":"2025-07-11T20:31:39.165Z","avatar_url":"https://github.com/newtonproject.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## newcommander\n\nThis is a commandline client for the NewChain blockchain.\nIt's designed to be easy-to-use. It contains the following:\n* Create a new account\n* Get the balance\n* Send transactions to the NewChain system\n* Off-line sign transaction from file or guide\n* Online send signed transaction\n* RPC method support\n* Batch pay\n\n## QuickStart\n\n### Download from releases\n\nBinary archives are published at:\n* [NewChain](https://release.cloud.diynova.com/newton/NewCommander/)\n* [Ethereum](https://release.cloud.diynova.com/newton/NewCommander/ethereum/)\n\n### Building the source\n\nTo get from gitlab via `go get`, this will get source and install dependens(cobra, viper, logrus).\n\n#### Windows\n\ninstall command\n\n```bash\ngit clone https://github.com/newtonproject/newcommander.git \u0026\u0026 cd newcommander \u0026\u0026 make install\n```\n\nrun newcommander\n\n```bash\n%GOPATH%/bin/newcommander.exe\n```\n\n#### Linux or Mac\n\ninstall:\n\n```bash\ngit clone https://github.com/newtonproject/newcommander.git \u0026\u0026 cd newcommander \u0026\u0026 make install\n```\nrun newcommander\n\n```bash\n$GOPATH/bin/newcommander\n```\n\n### Usage\n\n#### Help\n\nUse command `newcommander help` to display the usage.\n\n```bash\nUsage:\n  newcommander [flags]\n  newcommander [command]\n\nAvailable Commands:\n  account     Manage NewChain accounts\n  balance     Get balance of address\n  batchpay    Batch pay base on file \u003cbatch.txt\u003e\n  broadcast   Broadcast sign transacion hex in the signTxFilePath to blockchain\n  build       Build transaction\n  decode      Decode hex raw transaction to json\n  faucet      Get free money for address on NewChain TestNet\n  help        Help about any command\n  init        Initialize config file\n  pay         Send [amount] [unit] from [source] to [target] with message [text]\n  rpc         NewChain RPC method\n  sign        Sign the transaction in the file\n  version     Get version of newcommander CLI\n\nFlags:\n  -c, --config path            The path to config file (default \"./config.toml\")\n  -h, --help                   help for newcommander\n  -i, --rpcURL url             NewChain json rpc or ipc url (default \"https://rpc1.newchain.newtonproject.org\")\n  -w, --walletPath directory   Wallet storage directory (default \"./wallet/\")\n\nUse \"newcommander [command] --help\" for more information about a command.\n```\n\n#### Use config.toml\n\nYou can use a configuration file to simplify the command line parameters.\n\nOne available configuration file `config.toml` is as follows:\n\n\n```conf\nrpcurl = \"https://rpc1.newchain.newtonproject.org\"\nwalletpath = \"./wallet/\"\n\n[pay]\n  from = \"0xDB2C9C06E186D58EFe19f213b3d5FaF8B8c99481\"\n  unit = \"NEW\"\n  password = \"newton\"\n```\n\n#### Initialize config file\n\n```bash\n# Initialize config file\nnewcommander init\n```\n\nJust press Enter to use the default configuration, and it's best to create a new user.\n\n```bash\n$ newcommander init\nInitialize config file\nEnter file in which to save (./config.toml):\nEnter the wallet storage directory (./wallet/):\nEnter NewChain json rpc or ipc url (https://rpc1.newchain.newtonproject.org):\nCreate a new account or not: [Y/n]\nYour new account is locked with a password. Please give a password. Do not forget this password.\nEnter passphrase (empty for no passphrase):\nEnter same passphrase again:\n0xDB2C9C06E186D58EFe19f213b3d5FaF8B8c99481\nYour configuration has been saved in  ./config.toml\n```\n\n#### Create account\n\n```bash\n# Create an account\nnewcommander account new\n\n# Create 10 accounts\nnewcommander account new -n 10\n\n# Create an account with the standard scrypt for keystore\nnewcommander account new -s\n```\n\n### List all accounts\n\n```bash\n# list all accounts of the walletPath\nnewcommander account list\n```\n\n### Update an account\n\n```bash\n# update an account password\nnewcommander account update 0x0e0D78D2089F577d8b8156Eab564f08Ec2249b30\n\n# update account with the standard scrypt for keystore\nnewcommander account update 0x0e0D78D2089F577d8b8156Eab564f08Ec2249b30 -s\n```\n\n### Get faucet\n\n```bash\n# Get free money for address\nnewcommander faucet 0xDB2C9C06E186D58EFe19f213b3d5FaF8B8c99481\n```\n\n### Get Balance\n\n```bash\n# Get the balance of an account\nnewcommander balance 0xDB2C9C06E186D58EFe19f213b3d5FaF8B8c99481\n\n# Get the balance of multiple accounts\nnewcommander balance 0xDB2C9C06E186D58EFe19f213b3d5FaF8B8c99481 0x25a03e72bcca5ddcda45a7aabbe9b41b0e8ff828\n\n# Get the balance of all accounts in the default walletPath directory\nnewcommander balance\n\n# Get the balance in the specified unit\nnewcommander balance -u NEW\n\n# Get the balance at safe mode (3 block less than the latest)\nnewcommander balance -s\n\n# Get the balance at specified height\nnewcommander balance -n 1024\n\n# Get the pending balance\nnewcommander balance -n pending\n```\n\n### Pay to an account\n```bash\n# Pay 1 NEW to an account\nnewcommander pay 1 --to 0x25a03e72bcca5ddcda45a7aabbe9b41b0e8ff828\n\n# Pay 1 WEI to an account\nnewcommander pay 1 -u WEI --to 0x25a03e72bcca5ddcda45a7aabbe9b41b0e8ff828\n\n# Pay 1 NEW to an account with custom gasPrice 1000 WEI\nnewcommander pay 1 --to 0x25a03e72bcca5ddcda45a7aabbe9b41b0e8ff828 -p 1000\n\n# Pay 1 NEW to an account with custom gasLimit 100000\nnewcommander pay 1 --to 0x25a03e72bcca5ddcda45a7aabbe9b41b0e8ff828 -g 100000\n\n# Pay 1 NEW to an account with custom nonce 1\nnewcommander pay 1 --to 0x25a03e72bcca5ddcda45a7aabbe9b41b0e8ff828 -n 1\n\n# Pay entire balance to an account\nnewcommander pay all --to 0x25a03e72bcca5ddcda45a7aabbe9b41b0e8ff828\n\n# Pay to an account with txs confusion\nnewcommander pay 1 --to 0x25a03e72bcca5ddcda45a7aabbe9b41b0e8ff828 -N 2 -X 20\n```\n\n### Build transaction\n```bash\n# Build transaction\nnewcommander build\n```\n\n### Sign transaction\n```bash\n# Sign transaction from file and save sign transaction hex to file\nnewcommander sign tx.txt\n\n# Sign transaction save to the specified file\nnewcommander sign tx.txt --out tx.sign\n```\n\n### Submit signed transaction\n```bash\n# Submit signed transaction hex to NewChain system\nnewcommander submit tx.sign\n```\n\n### Decode transaction\n```bash\n# Decode signed transaction hex string to json\nnewcommander decode 0xf863820258648252089497549e368acafdcae786bb93d98379f1d1561a298080820802a0768ff39803904e993df858e0d4bbc2d56adf37e804e6804e9e2532d6726c70a4a02e9d8a4cdaf1a8d1b7d99f783162bcd8f0a80084b069f6c69c77f4345c4392f8\n\n# Decode signed transaction hex string to compress json\nnewcommander decode 0xf863820258648252089497549e368acafdcae786bb93d98379f1d1561a298080820802a0768ff39803904e993df858e0d4bbc2d56adf37e804e6804e9e2532d6726c70a4a02e9d8a4cdaf1a8d1b7d99f783162bcd8f0a80084b069f6c69c77f4345c4392f8 --compress\n\n# Decode unsigned transaction hex string to json\nnewcommander decode 0xe3820258648252089497549e368acafdcae786bb93d98379f1d1561a2980808203ef8080 --rlp\n```\n\n### Batch pay\n```bash\n# Batch pay base on batch.txt\nnewcommander batch batch.txt\nnewcommander batchpay batch.txt\n```\n\n### RPC\n```bash\n# Get chainID/NewworkID\nnewcommander rpc net_version\n\n# Get block by number\nnewcommander rpc eth_getBlockByNumber 1024 true\n\n# Get latest block\nnewcommander rpc eth_getBlockByNumber latest true\n\n# Get transaction by hash\nnewcommander rpc eth_getTransactionByHash 0xcad4299fd6516c7f66cbb5ae70114d9c06d73908a66c9165dbfc1e36fb67d892\n\n# Get transaction receipt\nnewcommander rpc eth_getTransactionReceipt 0xd9f1a3a4c54b6218c848e9a246faa570ea592a9f28d8b14e3ad4035398875de7\n\n# Get account nonce\nnewcommander rpc eth_getTransactionCount 0xc94770007dda54cF92009BFF0dE90c06F603a09f latest\n\n# Get balance\nnewcommander rpc eth_getBalance 0xc94770007dda54cF92009BFF0dE90c06F603a09f latest\n\n# Get gas limit\nnewcommander rpc eth_estimateGas {}\n\n# Get tranfer gas limit\nnewcommander rpc eth_estimateGas '{\"from\":\"0xdf9106238879143e914ad78d4ff4b4fa6b3b1648\",\"gasPrice\":\"0x64\",\"to\":\"0xdf9106238879143e914ad78d4ff4b4fa6b3b1648\",\"value\":\"0xde0b6b3a7640000\"}'\n\n# Get contract gas limit\nnewcommander rpc eth_estimateGas '{\"data\":\"0xa9059cbb00000000000000000000000082a3a88bc9d6a70c4f3c66534566892eae0cad810000000000000000000000000000000000000000000000000000000000000001\",\"from\":\"0x82a3a88bc9d6a70c4f3c66534566892eae0cad89\",\"to\":\"0x0b7789b5f69678f4f2d237cd0e1c815e1cd39ccf\",\"value\":\"0x0\"}'\n\n# Get gas price\nnewcommander rpc eth_gasPrice\n\n# Send raw transaction\nnewcommander rpc eth_sendRawTransaction 0xf869206482520894e78a7560107831726517f0a7c64600b01572967d880de0b6b3a764000080828414a0d8c63158d7c2f4acc556b06d0b3f90e36cf57ef3ab1915a70b5bcf9e56978b63a0435430e53af79a76de3bd50d0f740f28fe983aa2ac494feb6529dc08c0fdc4ed\n\n# Send transactions\nnewcommander rpc eth_sendTransaction '{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewtonproject%2Fnewcommander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewtonproject%2Fnewcommander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewtonproject%2Fnewcommander/lists"}