Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
documentation changes, disable subcommands --version
Browse files Browse the repository at this point in the history
  • Loading branch information
aemil145 committed Feb 10, 2022
1 parent 1f67c9d commit b8d9cfe
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ By using this tool you can also spin up a local [`Cudos node`](https://github.co

Make sure you have [Node.js](https://nodejs.org/en/download/package-manager/) installed. [Docker](https://docs.docker.com/engine/install) is also required.

Prerequisite | Minimum version | Recommended version |
| ----------- | ----------------| --------------------|
| Prerequisite | Minimum version | Recommended version |
| -------------- | --------------- | ------------------- |
| Node.js | 12.5.0 | 16.10.0 |
| npm | 6.9.0 | 7.24.0 |
| Docker engine | 19.03.13 | 20.10.12 |
Expand Down Expand Up @@ -59,9 +59,11 @@ Run `--help` on any `blast` command to show all available subcommands, parameter

```bash
blast --help
blast node --help
blast node start --help
```

Run `--version` on any `blast` command to show `cudos-blast` version number.
You can display `cudos-blast` version number using `--version`.

```bash
blast --version
Expand All @@ -77,7 +79,7 @@ To scaffold a sample project navigate to empty directory and run
blast init
```

You can also specify the directory of the project using optional parameter `--dir` or `-d`
You can also specify the full directory of the project using optional parameter `--dir` or `-d`

```bash
blast init --dir /Your/Location/Here
Expand Down Expand Up @@ -123,7 +125,7 @@ blast test
```

Integration tests have to be in the `{project_root}/integration_tests/` folder.
> Integration tests functionality is not working correctly. Only for demo purpose!
> Integration tests functionality is still under development.
---
## Interacting with a Cudos node
Expand Down Expand Up @@ -165,15 +167,15 @@ You can check the status of a non-local Cudos node by setting its URL in `blast.
---
## Deploying smart contracts, interacting with them and running custom script files

You can use supplied `{project_root}/scripts/deploy.js` to deploy smart contracts one by one. You can interact with them by using supplied `interact.js` as a template. You are free to use custom `.js` scripts.
You can run the supplied `{project_root}/scripts/deploy.js` to deploy a sample smart contract. When it is deployed, its address will be printed. Then you can edit `{project_root}/scripts/interact.js` with the new address and run the script to interact with the deployed smart contract. You are free to use these files as templates or create your own custom `.js` scripts.

```bash
blast run scripts/deploy.js
blast run scripts/interact.js
blast run scripts/myCustomScript.js
```

You can specify your own script file path. A custom network can be set with `--network` or `(-n)`. Also, signer account can be specified with `--account` or `(-a)`. Default values can be changed in `blast.config.js` under `network` or `defaultAccount`.
You can specify your own script file path. A custom network can be set with `--network` or `(-n)`. Also, the signer can be specified by its account name with `--account` or `(-a)`. Default values can be changed in `blast.config.js` under `network` or `defaultAccount`.

```bash
blast run newFolder/anotherScripts/myCustomScript.js
Expand Down
1 change: 0 additions & 1 deletion packages/blast-cmd/blast-cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const BlastError = require('../blast-utilities/blast-error')
async function main() {
await yargs(hideBin(process.argv))
.scriptName('blast')
.version()
.usage('Usage: $0 <command> [arguments] [command options]')
.command(commands.initInfo)
.command(commands.compileInfo)
Expand Down
10 changes: 9 additions & 1 deletion packages/blast-cmd/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const initInfo = {
default: '.',
description: 'Project directory'
})
.version(false)
},
handler: initCmd
}
Expand All @@ -33,14 +34,17 @@ const compileInfo = {
default: optimizerVer,
description: 'Version of the cargo optimizer'
})
.version(false)
},
handler: compileCmd
}

const testInfo = {
command: 'test',
describe: 'Run the integration tests',
builder: (yargs) => {},
builder: (yargs) => {
yargs.version(false)
},
handler: testCmd
}

Expand All @@ -54,6 +58,7 @@ const unitTestInfo = {
default: false,
description: 'Hide cargo log messages'
})
.version(false)
},
handler: unitTestCmd
}
Expand All @@ -76,6 +81,7 @@ const runInfo = {
type: 'string',
description: 'Set a custom signer account (account name is expected)'
})
yargs.version(false)
},
handler: runCmd
}
Expand Down Expand Up @@ -122,6 +128,7 @@ const keysInfo = {
})
}, keys.keysFundCmd)
.demandCommand(1, 'No command specified!') // user must specify atleast one command
.version(false)
}
}

Expand All @@ -140,6 +147,7 @@ const nodeInfo = {
.command('stop', 'Stop the running local node', () => {}, node.stopNodeCmd)
.command('status', 'Check if a local node is running', () => {}, node.nodeStatusCmd)
.demandCommand(1, 'No command specified!') // user must specify atleast one command
.version(false)
}
}

Expand Down
2 changes: 1 addition & 1 deletion template/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ async function main () {
count: 13
})
const contractAddress = await contract.deploy()
console.log(`${contractAddress}`)
console.log(`Contract is deployed at: ${contractAddress}`)
}

main()
Expand Down
1 change: 1 addition & 0 deletions template/scripts/interact.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
async function main () {
// use your deployed smart conotract's address
const alphaContract = await getContractFromAddress('cudos1uul3yzm2lgskp3dxpj0zg558hppxk6pt8t00qe')
const r = await alphaContract.execute({
increment: {}
Expand Down

0 comments on commit b8d9cfe

Please sign in to comment.