These are the web3 commands:
Starting with a project:
init Starts the setup
Development commands:
run Starts a node and the project
EthPM managment:
add Adds a contract package to the current project
remove Removes a contract package to the current project
Generating of code (generate:*):
generate:contract Generates a contract class based on the contract abi
Call a JSON-RPC method:
method calls an JSON-RPC method
- Which "runtimes" should it support (node.js, angular, react, vue.js, ...)
- Do we want to use yeoman for the setup?
- What are the setup steps?
- Which options will this command have?
- Should it have the possibility to select a node type (parity, geth, ganache, ...)
web3 run --watch --net="dev"
- Build on file change (wrapper of framework cli)
- Select the node to connect
web3 build --browser --node
- Creates a build with the browser config
- Creates a build with the node config
- Do we want a ethpm.json as truffle has or do we just extending the package.json of npm? (Sam: I would just extend the package.json)
- Which additional options should the command add have?
web3 add [email protected] --save
> Package [email protected] would be added to the package.json.
> Package [email protected] successfully added.
<package name>@<version>
web3 remove MYPackage
> Package with name MYPackage removed.
- The EthPM package name
web3 generate:contract <packageName|--abi|--address> --out --types
> Contract with name TestContract created in PATH.
- The EthPM package name
- The root of the path should be the project folder root (e.g. "./assets/ContractABI").
- Default path is "./"
- The root of the path should be the project folder root (e.g "./contracts/").
- The contract address or an ENS name to a contract
- Generates a TypeScript interface from the ABI.
web3 method <methodName: eth:*, shh:*, ...> <options: methodParameters>
> '0x0'
- All methods defined in namespaces (e.g. eth:call)
- How should the JSON-RPC method parameters are given to the method?
The post install hook of npm should be used to installing the contract dependencies.
//... package.json
{
"web3": {
"build": {
"browser": {
provider: ["metamask", "mist", "status", "brave"] // ["ws:168.111.0.1:8564"]
},
"node": {
provider: "ws:168.111.0.1:8564"// IPC_PATH | http://
}
},
"mainnet": {
provider: "ws:168.111.0.1:8564" // IPC_PATH | http://
},
"development": {
"net": "ganache", // ["geth", {protocol: 'HTTP', ...}]
"truffle": false, // If true truffle will be used for the deploying of the contracts
"rootDir": "./",
"packages": "./node_modules/"
},
"dependencies": {
"myContractPackage": "^0.1.0",
"myChainContractPackage: "0x0",
"myENSNameContractPackage: "contract.eth"
}
}
}