diff --git a/_quarto.yml b/_quarto.yml index d16aaeca7..c23842d69 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -38,7 +38,6 @@ website: contents: - "networks/mainnet/index.md" - "networks/testnet-bakerloo/index.md" - - "networks/testnet-piccadilly/index.md" - section: "Accounts" contents: - "account-holders/setup-aut/index.md" diff --git a/account-holders/make-calls-nodejsconsole/index.md b/account-holders/make-calls-nodejsconsole/index.md deleted file mode 100644 index 5e7dd53e8..000000000 --- a/account-holders/make-calls-nodejsconsole/index.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Make calls from Autonity NodeJS Console -description: How to submit calls to an Autonity network using the NodeJS interface to the RPC API's -draft: true ---- - - -## Prerequisites - -To submit calls to a client node from the Autonity NodeJS Console you need: - -- An [installed NodeJS Console](/reference/utility-tools/#installation-1). -- Configuration details for the Autonity network you are connecting your console to, i.e. a public or your own node on an Autonity testnet. - -## Setup - -Navigate to your Autonity NodeJS Console install directory and initialise a console session, specifying the IP address of the node you will connect to. The connection is made over WebSockets to port 8546: - - ```bash - ./console ws://:8546 - ``` - -::: {.callout-note title="Note" collapse="false"} -If the transport is over WebSockets or WebSockets Secure will depend on your node setup. For connecting to a public node WebSockets Secure (`wss`) is advised. -::: - -## Examples - -Here are some examples of making calls to the network using the Autonity Protocol Contract and Web3 namespaces. - -For parameter definitions and usage see the Reference [Autonity Interfaces](/reference/api/). - - -### Get consensus committee size: - - ```javascript - autonity.getMaxCommitteeSize().call() - ``` - -### Get the genesis config: - -To return the protocol parameterisation set at network genesis for: - -- operatorAccount -- treasuryAccount -- treasuryFee -- minBaseFee -- delegationRate -- epochPeriod -- unbondingPeriod -- committeeSize -- contractVersion -- blockPeriod - - ```javascript - autonity.config().call() - ``` - -### Get the current consensus committee: - - ```javascript - autonity.getCommittee().call() - ``` - -### Check the auton balance of an account: - - ```javascript - web3.eth.getBalance('
'); - ``` - -### Check the newton balance of an account: - - ```javascript - autonity.balanceOf('<_addr>').call() - ``` diff --git a/account-holders/setup-nodejsconsole/index.md b/account-holders/setup-nodejsconsole/index.md deleted file mode 100644 index 0ebbd0037..000000000 --- a/account-holders/setup-nodejsconsole/index.md +++ /dev/null @@ -1,745 +0,0 @@ ---- -title: "Setup the NodeJS Console" -description: How to install and launch the NodeJS Console. -draft: true ---- - - - -### Autonity NodeJS Console -#### Prerequisites -- AMD64 instruction set Linux OS -- To install and run the Autonity NodeJS Console you need current versions of [nodejs](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) - -#### Install -The Autonity NodeJS Console is distributed as part of the Autonity Go Client Release in the `nodejsconsole` sub directory. For users who only require a console, it is also available as a separate download from the Autonity [Releases](https://github.com/autonity/autonity/releases) Archive - `nodejsconsole-.tar.gz`. - -To install, get the _tarball_ and unpack. The tarball contains a folder with 2 artefacts, so you don't need to create a home directory for it. Simply unpack the tarball file from your Downloads folder to your working directory as described for the client in steps 1-3 above. - -To run the Console and connect to a node, specify WebSockets as the transport and the IP address and port `8546` of the Autonity client node you will connect to. Use WS for a local node and WSS for secure connection to a public node on an Autonity network. For example, to connect to a node running on local host: - -```bash -./console ws://127.0.0.1:8546 -``` - -On initial running, the console will install web3 and node modules, then initialise the console and display: - -```javascript -Welcome to the Autonity node console -modules: eth net rpc autonity -Type "module". to get started -> -``` - -### Install the Autonity NodeJS Console - -The Autonity NodeJS Console can be used to connect to the WebSocket endpoint on an Autonity Go Client node, and execute commands to interact with the Autonity client and Autonity Protocol smart contracts. Set up the NodeJS Console on your local machine using one of two methods: - -- If you have already cloned Autonity, create a directory and copy the console from the Autonity repo: - - ```bash - mkdir nodejsconsole - cd nodejsconsole - cp /autonity/nodejsconsole/console - cp /autonity/nodejsconsole/script.js - ``` - -- For users who only require a console, download the separate NodeJS Console release from the Autonity [Releases](https://github.com/autonity/autonity/releases) Archive - `nodejsconsole-.tar.gz`. - -- Unpack the _tarball_ file from your Downloads folder to your install directory: - - ```bash - tar -xzf nodejsconsole-amd64-.tar.gz --directory / - ``` - -### Run the Autonity NodeJS Console - -Run the console, specifying the IP address of the Autonity client node you will connect to using WebSocket. - -If the node you are connecting to has an encrypted WebSocket endpoint, then you need to connect to it via `wss` ("web socket secure"). For example, to connect to the Piccadilly Testnet public endpoint `rpc1.piccadilly.autonity.org`: - -``` bash -./console wss://rpc1.piccadilly.autonity.org:8546 -``` - -Here are some examples: - -#### Get the block number: - - ```javascript - web3.eth.getBlockNumber() - ``` - -#### Get maximum consensus committee size: - - ```javascript - autonity.getMaxCommitteeSize().call() - ``` - -#### Get all nodes in the consensus committee: - - ```javascript - autonity.getCommittee().call() - ``` - -#### Get the genesis config: - -To return the protocol parameterisation set at network genesis for: - -- operatorAccount -- treasuryAccount -- treasuryFee -- minBaseFee -- delegationRate -- epochPeriod -- unbondingPeriod -- committeeSize -- contractVersion -- blockPeriod - - ```javascript - autonity.config().call() - ``` - - -#### Check the auton balance of an account: - - ```javascript - eth.getBalance('<_addr>') - ``` - -#### Check the newton balance of an account: - - ```javascript - autonity.balanceOf('<_addr>').call() - ``` - -### Syntax when making calls - -- For functions that read information by calling Autonity protocol smart contract methods such as above, add `.call()`. - -- For functions that retrieve information from the node client itself, like many of the `web3.eth` functions, you do not need `.call()`. - -- Web3 commands can be accessed by typing `web3.` then pressing `` twice to list available functions. - -- The 'eth' command namespace can be found by typing `web3.eth.` then pressing `` twice. - -- Autonity specific commands can be found by typing `autonity.` then pressing `` twice. (e.g., as above, ` autonity.getCommittee().call()`). - -- You can leave the console by typing `.exit`. - -## JavaScript CLI: NodeJS Console - -The Autonity NodeJS console is a command-line interface for invoking an interactive JavaScript runtime environment to connect to an Autonity node. It gives access to `web3` and `autonity` interfaces, and access to Autonity Protocol method calls for which public JSON-RPC calls are not defined. - -The Autonity NodeJS console can be used in interactive or script mode as the Geth console can be. - -### Installation - -The Autonity NodeJS Console is provided as part of the Autonity Go Client binary and as a separate download package. - -To install, see the How to _Install Autonity_ and: - -- [Build from source code](/node-operators/install-aut/#build-from-source-code) to build and install from binary, and, -- [Autonity Node JS Console](/node-operators/install-aut/#autonity-nodejs-console) to install from the download package. - -CD to the Node JS Console directory. This will be `./nodejsconsole` if you have built from source, or if you are using the separate download then the directory location where you unzipped the _tar_ file to. - -To connect to a node on an Autonity network in an interactive session run the Autonity console, specifying the IP address of the node you will connect to. The connection is made over WebSockets to port 8546 by default: - -```bash -./console ws://:8546 -``` - -For example, to connect to a local node run: - -```bash -./console ws://127.0.0.1:8546 -``` - -The console installs, initialises with web3 and Autonity Go Client interface modules, then displays: - -```javascript -Welcome to the Autonity node console -modules: eth net rpc tendermint autonity -Type "module". to get started -> -``` - -An interactive session is now open with the connected node. - -Note that the NodeJS Console: - -- Provides `aut` (Autonity), `eth`, `net`, `rpc`, `tendermint` modules by default. Web3 method calls can be prefixed by `web3.`but this is not required. Additional Web3 modules may be available if the node you are connecting to has provided them in its `--ws.api` flag when starting Autonity (See How to [Run Autonity](/node-operators/run-aut/)). -- Will not timeout if idle. The console implements an automatic reconnect mechanism and will reconnect if left idle after 1000 ms. - -::: {.callout-important title="Warning" collapse="false"} -Public access to the `tendermint` namespace module is deprecated and will be removed in a future release. See [Known Issues](/issues/), [Tendermint Namespace Interface is accessible but not meant for use by external clients](/issues/#tendermint-namespace-interface-is-accessible-but-not-meant-for-use-by-external-clients). -::: - -### Usage - -The Autonity console is invoked as an interactive shell. Refer to the [Autonity Interfaces](/reference/api) Reference section 'console' entries for guidance on how to call the API from the console. - -::: {.callout-note title="Note" collapse="false"} Some functions provided by the NodeJS console are asynchronous and they return promises (https://www.w3schools.com/Js/js_promise.asp). For conveniency reasons promises are automatically resolved by the NodeJS console CLI when calling asynchronous functions; however this is not true when performing assigments or nested function calls, in this case the `await` keyword needs to be specified to resolve the promise. Examples: `wallet = await web3.personal.listWallets()`, `web3.eth.getBlock(await web3.eth.getBlockNumber())`::: - -#### `.call()` and `.send()` - -API interactions made using the console may have `.call()` or `.send()` appended depending on the method and module called. - -Use `.call()` for `Autonity` calls to read ledger state and retrieve [calldata](/glossary/), appending `.call()` to the method name: - -```bash -> autonity.totalSupply().call() -'80000' -``` - -Use `.send()` for `Autonity `and `web3` calls to submit state affecting transactions, appending `. send()` to the method name: - -```bash -> autonity.transfer('<_recipient>', <_amount>).send({from: myAddress, gas: gas}) -``` - -Console configuration for use of `.send()` is described in the How to Submit a transaction from Autonity NodeJS Console. - -#### JavaScript Object Prototype functions - -`Node.JS` automatically attaches the following prototype functions to a JavaScript object at runtime. These functions are displayed for both `web3` and `autonity` namespaces in the Autonity NodeJS Console but are **unused**. For the function definitions see the linked Mozilla Developer Network Reference documentation. - - -| Field | MDN Web Docs Reference | -|-------|-------------| -|`.__defineGetter__`|[`Object.prototype.__defineGetter__()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__)| -|`.__defineSetter__`|[`Object.prototype.__defineSetter__()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__)| -|`.__lookupGetter__`|[`Object.prototype.__lookupGetter__()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__)| -|`.__lookupSetter__`|[`Object.prototype.__lookupSetter__()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__)| -|`.__proto__`|[`Object.prototype.__proto__`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto)| -|`.hasOwnProperty`|[`Object.prototype.hasOwnProperty()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)| -|`.isPrototypeOf`|[`Object.prototype.isPrototypeOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf)| -|`.propertyIsEnumerable`|[`Object.prototype.propertyIsEnumerable()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable)| -|`.toLocaleString`|[`Object.prototype.toLocaleString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString)| -|`.toString`|[`Object.prototype.toString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString)| -|`.valueOf`|[`Object.prototype.valueOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)| -|`.constructor`|[`Object.prototype.constructor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor)| - -#### Exiting the console - -To exit the console press `^C` twice or type `.exit`. - - -### RPC Calls -#### Calling the Ethereum `web3` API - -Enter `web3.` to see a list of available function calls: - -```bash -> web3. -web3.__defineGetter__ web3.__defineSetter__ web3.__lookupGetter__ -web3.__lookupSetter__ web3.__proto__ web3.hasOwnProperty -web3.isPrototypeOf web3.propertyIsEnumerable web3.toLocaleString -web3.toString web3.valueOf - -web3.constructor - -web3.BatchRequest web3._provider web3._requestManager -web3.admin web3.bzz web3.currentProvider -web3.eth web3.extend web3.givenProvider -web3.net web3.personal web3.providers -web3.rpc web3.setProvider web3.setRequestManager -web3.shh web3.tendermint web3.txpool -web3.utils web3.version -``` - -##### Console functions - -###### JavaScript Object Prototype functions - -As noted [above](/reference/cli#javascript-object-prototype-functions), these prototype functions added by `Node.JS` are **unused**. - -###### Web3 method calls - -For the function definitions see the linked `web3.js` and upstream Geth JSON-RPC API Reference in the [Autonity Interfaces](/reference/api/) documentation. - -| Field | Reference - web3.js| Reference - JSON-RPC API | -|-------|-----------|-----------------| -| `web3.BatchRequest` | [`BatchRequest`](https://web3js.readthedocs.io/en/v1.2.11/web3.html?highlight=web3.BatchRequest#batchrequest) | -| `web3._provider` | | | -| `web3._requestManager` | | | -| `web3.admin` | | Geth [`admin`](https://geth.ethereum.org/docs/rpc/ns-admin) | -| `web3.bzz` | [`bzz`](https://web3js.readthedocs.io/en/v1.2.11/web3-bzz.html) | -| `web3.currentProvider` | [`currentProvider`](https://web3js.readthedocs.io/en/v1.2.11/web3.html#currentprovider) | -| `web3.eth` | [`eth`](https://web3js.readthedocs.io/en/v1.2.11/web3-eth.html) | Geth [`eth`](https://geth.ethereum.org/docs/rpc/ns-eth) | -| `web3.extend` | [`extend`](https://web3js.readthedocs.io/en/v1.2.11/web3.html#extend) | -| `web3.givenProvider` | [`givenProvider`](https://web3js.readthedocs.io/en/v1.2.11/web3.html#givenprovider) | -| `web3.net` | [`*.net`](https://web3js.readthedocs.io/en/v1.2.11/web3-net.html?highlight=web3.net#) | -| `web3.personal` | [`eth.personal`](https://web3js.readthedocs.io/en/v1.2.11/web3-eth-personal.html#eth-personal) | Geth [`personal`](https://geth.ethereum.org/docs/rpc/ns-personal) | -| `web3.providers` | [`providers`](https://web3js.readthedocs.io/en/v1.2.11/web3.html#providers) | -| `web3.rpc` | | Geth [`JSON-RPC Server`](https://geth.ethereum.org/docs/rpc/server) | -| `web3.setProvider` | [`setProvider`](https://web3js.readthedocs.io/en/v1.2.11/include_package-core.html?highlight=.setProvider) | -| `web3.setRequestManager` | | -| `web3.shh` | [`shh`](https://web3js.readthedocs.io/en/v1.2.11/web3-shh.html) | -| `web3.tendermint` | | | -| `web3.txpool` | | Geth [`txpool`](https://geth.ethereum.org/docs/rpc/ns-txpool) | -| `web3.utils` | [`utils`](https://web3js.readthedocs.io/en/v1.2.11/web3-utils.html) | -| `web3.version` | [`version`](https://web3js.readthedocs.io/en/v1.2.11/web3.html#version) | - -#### Calling the `autonity` Protocol Contract Interface - -Enter `autonity.` to see a list of available function calls. - -```bash -> autonity. -autonity.__defineGetter__ autonity.__defineSetter__ -autonity.__lookupGetter__ autonity.__lookupSetter__ -autonity.__proto__ autonity.constructor -autonity.hasOwnProperty autonity.isPrototypeOf -autonity.propertyIsEnumerable autonity.toLocaleString -autonity.toString autonity.valueOf - -autonity.allowance autonity.approve -autonity.balanceOf autonity.bond -autonity.burn autonity.computeCommittee -autonity.config autonity.deployer -autonity.epochID autonity.epochReward -autonity.epochTotalBondedStake autonity.finalize -autonity.getBondingReq autonity.getCommittee -autonity.getCommitteeEnodes autonity.getMaxCommitteeSize -autonity.getMinimumBaseFee autonity.getNewContract -autonity.getOperator autonity.getProposer -autonity.getUnbondingReq autonity.getValidator -autonity.getValidators autonity.getVersion -autonity.headBondingID autonity.headUnbondingID -autonity.lastEpochBlock autonity.mint -autonity.name autonity.registerValidator -autonity.setCommitteeSize autonity.setEpochPeriod -autonity.setMinimumBaseFee autonity.setOperatorAccount -autonity.setTreasuryAccount autonity.setTreasuryFee -autonity.setUnbondingPeriod autonity.symbol -autonity.tailBondingID autonity.tailUnbondingID -autonity.totalRedistributed autonity.totalSupply -autonity.transfer autonity.transferFrom -autonity.unbond autonity.upgradeContract - -``` - -##### Console functions - -###### JavaScript Object Prototype functions - -As noted [above](/reference/cli#javascript-object-prototype-functions), these prototype functions added by `Node.JS` are **unused**. - -###### Autonity method calls - -For the function definitions see the linked [Autonity Interfaces](/reference/api/) Reference documentation for the Autonity Protocol Contract functions. If accessing the method is constrained to the protocol or governance account is shown. - -| Field | Reference | Access constraint? | -|-------|-----------|-----------------| -| `autonity.allowance` | [`allowance`](/reference/api/aut/#allowance) | -| `autonity.approve` | [`approve`](/reference/api/aut/#approve) | -| `autonity.balanceOf` | [`balanceOf`](/reference/api/aut/#balanceof) | -| `autonity.bond` | [`bond`](/reference/api/aut/#bond) | -| `autonity.burn` | [`burn`](/reference/api/aut/op-prot/#burn) | onlyOperator | -| `autonity.computeCommittee` | [`computeCommittee`](/reference/api/aut/op-prot/#computecommittee) | onlyProtocol | -| `autonity.config` | [`config`](/reference/api/aut/#config) | -| `autonity.deployer` | [`deployer`](/reference/api/aut/#deployer) | -| `autonity.epochID` | [`epochID`](/reference/api/aut/#epochid) | -| `autonity.epochReward` | [`epochReward`](/reference/api/aut/#epochreward) | -| `autonity.epochTotalBondedStake` | [`epochTotalBondedStake`](/reference/api/aut/#epochtotalbondedstake) | -| `autonity.finalize` | [`finalize`](/reference/api/aut/op-prot/#finalize) | onlyProtocol -| `autonity.getBondingReq` | [`getBondingReq`](/reference/api/aut/#getbondingreq) | -| `autonity.getCommittee` | [`getCommittee`](/reference/api/aut/#getcommittee) | -| `autonity.getCommitteeEnodes` | [`getCommitteeEnodes`](/reference/api/aut/#getcommitteeenodes) | -| `autonity.getMaxCommitteeSize` | [`getMaxCommitteeSize`](/reference/api/aut/#getmaxcommitteesize) | -| `autonity.getMinimumBaseFee` | [`getMinimumBaseFee`](/reference/api/aut/#getminimumbasefee) | -| `autonity.getNewContract` | [`getNewContract`](/reference/api/aut/#getnewcontract) | -| `autonity.getOperator` | [`getOperator`](/reference/api/aut/#getoperator) | -| `autonity.getProposer` | [`getProposer`](/reference/api/aut/#getproposer) | -| `autonity.getUnbondingReq` | [`getUnbondingReq`](/reference/api/aut/#getunbondingreq) | -| `autonity.getValidator` | [`getValidator`](/reference/api/aut/#getvalidator) | -| `autonity.getValidators` | [`getValidators`](/reference/api/aut/#getvalidators) | -| `autonity.getVersion` | [`getVersion`](/reference/api/aut/#getversion) | -| `autonity.headBondingID` | [`headBondingID`](/reference/api/aut/#headbondingid) | -| `autonity.headUnbondingID` | [`headUnbondingID`](/reference/api/aut/#headunbondingid) | -| `autonity.lastEpochBlock` | [`lastEpochBlock`](/reference/api/aut/#lastepochblock) | -| `autonity.mint` |[`mint`](/reference/api/aut/op-prot/#mint) | onlyOperator | -| `autonity.name`| [`name`](/reference/api/aut/#name) | -| `autonity.registerValidator` | [`registerValidator`](/reference/api/aut/#registervalidator) | -| `autonity.setCommitteeSize` |[`setCommitteeSize`](/reference/api/aut/op-prot/#setcommitteesize) | onlyOperator | -| `autonity.setEpochPeriod` |[`setEpochPeriod`](/reference/api/aut/op-prot/#setepochperiod) | onlyOperator | -| `autonity.setMinimumBaseFee` |[`setMinimumBaseFee`](/reference/api/aut/op-prot/#setminimumbasefee) | onlyOperator | -| `autonity.setOperatorAccount` |[`setOperatorAccount`](/reference/api/aut/op-prot/#setoperatoraccount) | onlyOperator | -| `autonity.setTreasuryAccount` |[`setTreasuryAccount`](/reference/api/aut/op-prot/#settreasuryaccount) | onlyOperator | -| `autonity.setTreasuryFee` |[`setTreasuryFee`](/reference/api/aut/op-prot/#settreasuryfee) | onlyOperator | -| `autonity.setUnbondingPeriod` |[`setUnbondingPeriod`](/reference/api/aut/op-prot/#setunbondingperiod) | onlyOperator | -| `autonity.symbol` | [`symbol`](/reference/api/aut/#symbol) | -| `autonity.tailBondingID` | [`tailBondingID`](/reference/api/aut/#tailbondingid) | -| `autonity.tailUnbondingID` | [`tailUnbondingID`](/reference/api/aut/#tailunbondingid) | -| `autonity.totalRedistributed`| [`totalRedistributed`](/reference/api/aut/#totalredistributed) | -| `autonity.totalSupply` | [`totalSupply`](/reference/api/aut/#totalsupply) | -| `autonity.transfer` | [`transfer`](/reference/api/aut/#transfer) | -| `autonity.transferFrom` | [`transferFrom`](/reference/api/aut/#transferfrom) | -| `autonity.unbond` | [`unbond`](/reference/api/aut/#unbond) | -| `autonity.upgradeContract` | [`upgradeContract`](/reference/api/aut/op-prot/#upgradecontract) | onlyOperator | - - -#### Calling the `Liquid Newton Contract` interface `Staking Wallet` functions - -The Node JS Console provides `Staking Wallet` functions for a stake delegator to: - - - View information about registered validators on the network - - view stake delegations: the delegator's own Liquid Newton holding and claimable reward balances - - Claim rewards - - Send Liquid Newton to another account. - -The functions are accessible from the default context: a module namespace prefix is not required when calling. - -For the function definitions see the linked [Autonity Interfaces](/reference/api/liquid-newton) Reference documentation for the Autonity Liquid Newton Contract functions available from the NodeJS Console. - -| Function| Reference | -|-------|-----------| -| `vals()` Print validator information | [`vals`](/reference/api/liquid-newton/#vals-_print-validator-information_) | -| `wal()` Print Staking Wallet | [`wal`](/reference/api/liquid-newton/#wal-_print-staking-wallet_) | -| `rclm()` Claim staking rewards for single stake delegation | [`rclm`](/reference/api/liquid-newton/#rclm-_claim-staking-rewards_) | -| `rclm_a()` Claim staking rewards for all stake delegations | [`rclm_a`](/reference/api/liquid-newton/#rclm_a-_claim-all-staking-rewards_) | -| `lsend()` Send Liquid Newton| [`lsend`](/reference/api/liquid-newton/#lsend-_send-liquid-newton_) | - - -## Geth Javascript Console - -The Geth JavaScript Console provides a JavaScript runtime environment for executing RPC calls encoded as JSON objects. - -The console is deprecated in favour of the [Autonity NodeJS Console](/reference/utility-tools/#javascript-cli-nodejs-console) as an interactive JavaScript environment for Autonity. - - -::: {.callout-important title="Warning" collapse="false"} -The console remains in the codebase but is not officially supported. It may be used with this caveat. -::: - -### Usage - -For how to invoke and use the CLI see the Geth docs [JavaScript Console](https://geth.ethereum.org/docs/interface/javascript-console). - -# Built in functions - -TODO: old Node JS Console built-in functions content - -Interface for interacting with Autonity Liquid Newton Contract using wrapper functions implemented by the NodeJS Console. Function calls do not require the `.call()` or `.send()` suffix. - -Datatypes are [Solidity v0.8.3 Types](https://docs.soliditylang.org/en/v0.8.3/types.html#). - -::: {.callout-note title="Info" collapse="false"} -Examples use the setup described in the How to's: - -- [Submit a transaction from Autonity NodeJS Console](/account-holders/submit-trans-nodejsconsole/) -- [Claim Staking Rewards](/delegators/claim-rewards/) -- [Transfer Liquid Newton](/delegators/transfer-lntn/). -::: - -::: {.callout-note title="Info" collapse="false"} -- `unclaimedRewards()`: returns the total amount of rewards available and pending retrieval -- `claimRewards()`: claims the sender's pending rewards. -::: - -## `vals` _Print validator information_ - -Displays the list of current registered validators. - -### Parameters - -None. - -### Response - -Displays a formatted list of `Validator` object data for each registered validator, sorted by registration index in ascending order. I.E. the last processed registration request has the highest index identifier value and is always the last result returned. - - -`Validator` object information returned consists of: - -| Field | Datatype | Description | -| --| --| --| -| `treasury` | `address payable` | the address that will receive staking rewards the validator earns | -| `addr` | `address` | the validator identifier account address | -| `enode` | `string` | the enode url of the validator node | -| `delegationRate` | `uint256` | the percentage commission that the validator will charge on staking rewards from delegated stake | -| `bondedStake` | `uint256` | the total amount of delegated and self-bonded stake that has been bonded to the validator | -| `totalSlashed` | `uint256` | a counter of the number of times that a validator has been penalised for accountability and omission faults since registration | -| `liquidContract` | `Liquid` | the address of the validator's Liquid Newton contract | -| `liquidSupply` | `uint256` | the total amount of the validator's Liquid Newton in circulation | -| `registrationBlock` | `uint256` | the block number in which the registration of the validator was committed to state| -| `state` | `ValidatorState` | the state of the validator. `ValidatorState` is an enumerated type with enumerations: `active`, `paused` | - - -### Usage - - -::: {.panel-tabset} -## bash -vals() -::: - - - -### Example - - -::: {.panel-tabset} -## bash -> vals() - -__________________________Validator 0__________________________ -treasury: 0x11A87b260Dd85ff7189d848Fd44b28Cc8505fa9C -addr: 0x07d872935972Aa0848d0cec9c67b270E5291D7e8 -enode: enode://bb9bb2bcd75a5cde083a6a9be2c28f31d9fd6e8de38baa594ffffab0efc5d26524b91baf002fed32f098db71acf0d7646a7c32a7d05ed89fdbbb78c74db13a1a@51.89.151.55:30303 -commissionRate: 1000 -bondedStake: 10000 -totalSlashed: 0 -liquidContract: 0xf4D9599aFd90B5038b18e3B551Bc21a97ed21c37 -liquidSupply: 10000 -registrationBlock: 0 -state: 0 - -__________________________Validator 1__________________________ -treasury: 0xd4EdDdE5D1D0d7129a7f9C35Ec55254f43b8E6d4 -addr: 0x45998C7d6341CD32256E9eeEdd9865450d4aCB18 -enode: enode://e89196cae37e8041e14d7a063cc82dec3bb351f79f46ab10a059220403932c1337f144ddbf1fd830bf1221fbf539a4e986c924600b060c0a36337256aa70ee2c@51.89.151.55:40303 -commissionRate: 1000 -bondedStake: 11360 -totalSlashed: 0 -liquidContract: 0x109F93893aF4C4b0afC7A9e97B59991260F98313 -liquidSupply: 11360 -registrationBlock: 0 -state: 0 - -__________________________Validator 2__________________________ -... -::: - - - - -## `wal` _Print Staking Wallet_ -Display holding in LNTN and claimable rewards for the specified account. - - -### Parameters - -| Field | Datatype | Description | -| --| --| --| -| `account` | `address` | account address of the stake delegator | - -### Response - -Displays an index-sorted list of all the stake delegations from the specified (i.e. _Staking Wallet_) account, showing: - -- `Account`: the _staking Wallet_ account address - -Then, a table showing stake delegations sorted by validator index: - -- `(index)`: the validator index, i.e. if the 1st or nth validator registered in the network. -- `validator`: the unique [validator identifier](/concepts/validator/#validator-identifier). -- `lntn`: the amount of Liquid Newton the staker owns for that validator. -- `claimableRewards`: the amount of rewards the staker can claim from the stake delegation, denominated in [ton](/glossary/#ton), auton's wei equivalent. - - -### Usage - - -::: {.panel-tabset} -## bash -wal('account') -::: - - - -### Example - - -::: {.panel-tabset} -## bash -> wal('0x11A87b260Dd85ff7189d848Fd44b28Cc8505fa9C') - - __________________________Staking Wallet__________________________ - - Account: 0x11A87b260Dd85ff7189d848Fd44b28Cc8505fa9C - - ________________________________________________________________________________________ - | (index) │ validator │ lntn │ claimableRewards | - |---------|----------------------------------------------|---------|--------------------| - | 0 │ '0x07d872935972Aa0848d0cec9c67b270E5291D7e8' │ '10000' │ '1436124008436346' │ - │ 1 │ '0x45998C7d6341CD32256E9eeEdd9865450d4aCB18' │ '150' │ '29094266920200' │ - │ 2 │ '0xe32d53E4d077F7ADE8CDB6Ff3Cf857Be40Ab1516' │ '0' │ '0' │ - │ 3 │ '0xAbbA1C48341755558E85A01e293Db94179dF9bcd' │ '0' │ '0' │ -::: - - -## `rclm` _Claim staking rewards_ -Claims staking rewards for a specified staking delegation. - -Calls the `claimRewards()` function for the specified validator. The sender's account must be unlocked to call. - -### Parameters - -| Field | Datatype | Description | -| --| --| --| -| `account` | `address` | the account address of the sender. This is the sender's _Staking Wallet_ account: the staker address that owns the liquid newton being sent | -| `validator` | `address` | the unique [validator identifier](/concepts/validator/#validator-identifier) of the validator stake delegation from which liquid newton is being sent | - - -### Response - -Displays the validator and staker addresses, the amount of claimable rewards from that validator, and the transaction receipt. - -### Usage - - -::: {.panel-tabset} -## bash -rclm('account','validator') -::: - - -### Example - - -::: {.panel-tabset} -## bash -> rclm('0x11a87b260dd85ff7189d848fd44b28cc8505fa9c','0x07d872935972Aa0848d0cec9c67b270E5291D7e8') - validator: 0x07d872935972Aa0848d0cec9c67b270E5291D7e8 - staker: 0x11a87b260dd85ff7189d848fd44b28cc8505fa9c - claimable rewards: 1436124008436346 - { - blockHash: '0xb99026335707e71d8663f5918386f7b8039ae706ec1e104e3a601080191747ff', - blockNumber: 33594, - contractAddress: null, - cumulativeGasUsed: 49156, - effectiveGasPrice: 12500000000, - from: '0x11a87b260dd85ff7189d848fd44b28cc8505fa9c', - gasUsed: 49156, - logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - status: true, - to: '0xf4d9599afd90b5038b18e3b551bc21a97ed21c37', - transactionHash: '0x6abe00db9b3beef9c40fe0b03e0f64dc6370c4b282f9136468b1259a1f6c77e8', - transactionIndex: 0, - type: '0x2', - events: {} - } -::: - - -## `rclm_a` _Claim all staking rewards_ -Claims staking rewards for all of the sender's stake delegations. - -Calls the `claimRewards()` function for every validator stake delegation with a non 0 `unclaimedRewards()` balance. The sender's account must be unlocked to call. - - -### Parameters - -| Field | Datatype | Description | -| --| --| --| -| `account` | `address` | the account address of the sender. This is the sender's _Staking Wallet_ account: the staker address that owns the liquid newton being sent | - -### Response - -Displays a listing of each validator you have delegated to, your claimable reward for each validator stake delegation, and the total amount of rewards claimed. - - -### Usage - - -::: {.panel-tabset} -## bash -rclm_a('account') -::: - - -### Example - - -::: {.panel-tabset} -## bash -> rclm_a('0x11A87b260Dd85ff7189d848Fd44b28Cc8505fa9C') - validator: 0x07d872935972Aa0848d0cec9c67b270E5291D7e8 - claimable reward: 213928433236770 - - validator: 0x45998C7d6341CD32256E9eeEdd9865450d4aCB18 - claimable reward: 29094266920200 - - - total claimed: 243022700156970 -::: - - - - -## `lsend` _Send Liquid Newton_ -Transfers an amount of Liquid Newton from a stake delegation to another account. - -Calls the `transfer()` function for the specified validator. The sender's account must be unlocked to call. - -### Parameters - -| Field | Datatype | Description | -| --| --| --| -| `val` | `address` | the unique [validator identifier](/concepts/validator/#validator-identifier) of the validator stake delegation from which liquid newton is being sent | -| `from` | `address` | the account address of the sender. This is the sender's _Staking Wallet_ account: the staker address that owns the liquid newton being sent | -| `to` | `address` | the account address of the recipient. | -| `value` | `uint256 ` | the amount of liquid newton being sent | - -### Response - -None. - -### Event - -On a successful call the function emits a Transfer event, logging: `msg.sender`, `to`, `amount`. - -### Usage - - -::: {.panel-tabset} -## bash -lsend({'from','to','val',value}) -::: - - -### Example - - -::: {.panel-tabset} -## bash -> lsend({from: '0x11a87b260dd85ff7189d848fd44b28cc8505fa9c', to: '0xd4eddde5d1d0d7129a7f9c35ec55254f43b8e6d4', val: '0x45998C7d6341CD32256E9eeEdd9865450d4aCB18', value: 100}) -Sending 100 LNTN - Validator 0x45998C7d6341CD32256E9eeEdd9865450d4aCB18 -{ - blockHash: '0xa883dc4beffebc5a903ecc3d0f1fbc7dad97d7ccaeea0bd580ac124ea8b7ddf4', - blockNumber: 36016, - contractAddress: null, - cumulativeGasUsed: 63512, - effectiveGasPrice: 12500000000, - from: '0x11a87b260dd85ff7189d848fd44b28cc8505fa9c', - gasUsed: 63512, - logsBloom: '0x00000000000000000000000000000400000000010000000000000000000000000000000000000000000000000000000004000000000000000000000001000000000000000000000000040008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000002000000000000000000000000000000000000000000000002000000000000000000000000000000000000000080000000000000000000001000000000', - status: true, - to: '0x109f93893af4c4b0afc7a9e97b59991260f98313', - transactionHash: '0x844b8bf3c165a20a93b15586acdfe263a55445519f3b01d98324bea2300ab32d', - transactionIndex: 0, - type: '0x2', - events: { - Transfer: { - address: '0x109F93893aF4C4b0afC7A9e97B59991260F98313', - blockNumber: 36016, - transactionHash: '0x844b8bf3c165a20a93b15586acdfe263a55445519f3b01d98324bea2300ab32d', - transactionIndex: 0, - blockHash: '0xa883dc4beffebc5a903ecc3d0f1fbc7dad97d7ccaeea0bd580ac124ea8b7ddf4', - logIndex: 0, - removed: false, - id: 'log_67107f69', - returnValues: [Result], - event: 'Transfer', - signature: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', - raw: [Object] - } - } -} -::: - diff --git a/account-holders/submit-trans-nodejsconsole/index.md b/account-holders/submit-trans-nodejsconsole/index.md deleted file mode 100644 index 5f6a30385..000000000 --- a/account-holders/submit-trans-nodejsconsole/index.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: "Submit a transaction from Autonity NodeJS Console" -description: > - How to submit transactions to an Autonity network using the NodeJS interface to the RPC API's -draft: true ---- - -## Prerequisites - -To submit transactions to a client node from the Autonity NodeJS Console you need: - -- An [installed NodeJS Console](/reference/utility-tools/#installation-1). -- An [unlocked account](/account-holders/unlock-acct) on an Autonity network funded with auton to pay for transaction gas costs. -- Configuration details for the Autonity network you are deploying to, i.e. a public or your own node on a public [Autonity network](/networks/). - -Navigate to your Autonity NodeJS Console install directory and initialise a console session, specifying the IP address of the node you will connect to. The connection is made over WebSockets to port 8546: -```bash -./console ws://:8546 -``` - -::: {.callout-note title="Note" collapse="false"} -If the transport is over WebSockets or WebSockets Secure will depend on your node setup. For connecting to a public node WebSockets Secure (`wss`) is advised. -::: - -## Examples - -Here are some examples of using `web3` and `autonity` namespaces to transfer value between accounts and call Autonity Protocol Contract ERC20 functionality from the console. In the following examples we will specify the gas parameter, but it can be superfluous depending on how you [unlocked your account](/account-holders/unlock-acct). - -::: {.callout-note title="Info" collapse="false"} -The current block base fee can be obtained by querying the latest block header: -```javascript -web3.eth.getBlock(await web3.eth.getBlockNumber()) -{ - baseFeePerGas: 5000, -... -} -``` -::: - -For parameter definitions and usage see the Reference [Autonity Interfaces](/reference/api/). - -To see your addresses you can use the command: -```javascript -web3.eth.getAccounts() -``` - -### Transfer Auton: - -Transferring Autonity's native account coin using the `web3.eth` namespace. Note `.send()` is not necessary: - -```javascript -web3.eth.sendTransaction({to:myAddress, from:myAddress, value:100, gas: gas}) -``` - -### Transfer Newton: - -Transferring Autonity's native stake token using the `autonity` namespace. Note use of `.send()`: - -```javascript -autonity.transfer('<_recipient>', <_amount>).send({from: myAddress, gas: gas}) -``` - -### Approve another account to transfer your Newton stake tokens: - -```javascript -autonity.approve('', ).send({from: myAddress, gas: gas}) -``` - -### Check approved account's allowance for transferring Newton stake tokens: - -```javascript -autonity.allowance('','').call() -``` - -### Transfer Newton stake tokens as an approved account: - -```javascript -autonity.transferFrom('', '', ).send({from: myAddress, gas: gas}) -``` diff --git a/concepts/oracle-server/index.md b/concepts/oracle-server/index.md index 9aa34918a..6047fbcf1 100644 --- a/concepts/oracle-server/index.md +++ b/concepts/oracle-server/index.md @@ -53,10 +53,6 @@ ATN and NTN symbols are preview listed but untraded: - https://www.coingecko.com/en/coins/auton - https://www.coingecko.com/en/coins/newton -Plugins for retrieving ATN-NTN price data are to be developed for Mainnet launch. - -ATN-NTN price data for [Piccadilly Testnet](/networks/testnet-piccadilly/) is computed using mock 'USDCx'. Piccadilly Testnet validators can retrieve ATN-USDCx and NTN-USDCx price data from a Uniswap V2 AMM clone deployed on the testnet using the `crypto_uniswap` plugin. For how to configure this see the Guide _Running an Oracle Server_ and [Setup crypto plugin config](/oracle/run-oracle/#setup-crypto-plugin-config). - ::: #### Developing data plugins diff --git a/concepts/protocol-assets/newton/index.md b/concepts/protocol-assets/newton/index.md index adcd910ec..e6401a9cb 100644 --- a/concepts/protocol-assets/newton/index.md +++ b/concepts/protocol-assets/newton/index.md @@ -43,7 +43,3 @@ The exact parameters of the Mainnet inflation mechanism will be determined throu ![Figure 1, example inflation curve. Note that parameters are purely illustrative and the Mainnet curve will likely change.](./images/example-inflation-curve.png) Please note that in the graph above, the y-axis percentage returns assume a 100% [participation rate](/glossary/#participation-rate) (i.e. all tokens are staked). To model for yourself the expected inflation yield, divide the value on the y-axis by an estimated participation rate (e.g. 0.7 for an expected participation rate of 70%, resulting in an inflation yield of 14.3% at genesis for an inflation rate of 10%). - -For the [Piccadilly Circus Games Competition ](https://game.autonity.org/) and the [Autonity Piccadilly Tiber Challenge](https://github.com/autonity/tiber-challenge) on the [Piccadilly Testnet](/networks/testnet-piccadilly/), a slightly different inflation schedule has been used to aid in testing. The PCGC Round 6 emission schedule can be seen below: - -![Figure 2, inflation curve for Round 6 of the Piccadilly Circus Games Competition.](./images/r6-inflation.png) diff --git a/developer/custom-networks/index.md b/developer/custom-networks/index.md index cbb88ae09..cc32445d2 100644 --- a/developer/custom-networks/index.md +++ b/developer/custom-networks/index.md @@ -12,7 +12,7 @@ To connect your node to a custom Autonity network, you will need the network's: See [Local Autonity Network configuration](/reference/genesis/#local-autonity-network-configuration) in the [Genesis](/reference/genesis/) reference for how to create these files. ::: {.callout-note title="Note" collapse="false"} -Note that the client provides command-line flag options for connecting to public Autonity testnets: `--bakerloo` and `--piccadilly`. The node will not run if you specify both genesis and bootnodes for a custom network **and** a testnet flag. The client will create a genesis block for the custom network's genesis configuration and the node's local store will then have an incompatible genesis with the testnet. +Note that the client provides a [command-line option](/reference/cli/agc/#command-line-options) for connecting to the Autonity Bakerloo Testnet `--bakerloo`. The node will not run if you specify both genesis and bootnodes for a custom network **and** a testnet flag. The client will create a genesis block for the custom network's genesis configuration and the node's local store will then have an incompatible genesis with the testnet. ::: 1. Install Autonity in a working directory and create an `autonity-chaindata` sub-directory as described in [Running a node, Install Autonity](/node-operators/install-aut/). @@ -29,7 +29,7 @@ cp .//static-nodes.json ./autonity-chaindata/ cp .//genesis.json ./ ``` -4. Run the node as described in [Running a node, Run Autonity](/node-operators/run-aut/), replacing the network specifier flag (e.g. `--piccadilly`) with the options: +4. Run the node as described in [Running a node, Run Autonity](/node-operators/run-aut/), specifying your custom network by the options: - `--genesis`: to provide the genesis file. - `--networkid`: to provide the network identifier. This is typically the same value as the `chainId` file in the genesis configuration file, but may be different. diff --git a/developer/deploy-brownie/index.md b/developer/deploy-brownie/index.md index 1be7ee8e9..bf13273f9 100644 --- a/developer/deploy-brownie/index.md +++ b/developer/deploy-brownie/index.md @@ -16,9 +16,9 @@ pipx install eth-brownie Add the testnet you would like to deploy the contract to, given an `RPC_URL` from : ```bash -brownie networks add Ethereum piccadilly host=$RPC_URL chainid=65100003 +brownie networks add Ethereum bakerloo host=$RPC_URL chainid=65100003 ``` -Here we have used the [Piccadilly testnet](/networks/testnet-piccadilly/) as an example. See [here](/networks/) for other possible networks. +Here we have used the [Bakerloo Testnet](/networks/testnet-bakerloo/) as an example. Install the OpenZeppelin package, which contains a base ERC20 token implementation: ```bash @@ -99,7 +99,7 @@ brownie accounts generate deployer Run the deploy script on the testnet: ```bash -brownie run --network piccadilly deploy main +brownie run --network bakerloo deploy main ``` Take note of the address of the deployed contract. This can be used with the `--token` option of the `aut token` commands in order to interact with the deployed token. diff --git a/developer/deploy-truffle/index.md b/developer/deploy-truffle/index.md deleted file mode 100644 index 145fbc4a4..000000000 --- a/developer/deploy-truffle/index.md +++ /dev/null @@ -1,290 +0,0 @@ ---- -title: "Deploy smart contracts to an Autonity network with Truffle" -description: > - How to deploy smart contracts to an Autonity network using Truffle, with an ERC20 token contract as an example -draft: true ---- - -This guide uses the Truffle development environment and JavaScript framework to compile and deploy smart contracts. It deploys as example an ERC20 token contract from the OpenZeppelin open source library of smart contracts. - -## Prerequisites - -- An up-to-date installation of [Truffle ](https://trufflesuite.com/docs/truffle/) and `npm`. See the Truffle Suite docs for the [Installation](https://trufflesuite.com/docs/truffle/how-to/install/) how to. - -- An [account](/account-holders/create-acct/) that has been [funded](/account-holders/fund-acct/) with auton, to pay for transaction gas costs. The guide will use the encrypted ethereum keyfile of the account. - -- Configuration details for the Autonity network you are deploying to: a [public Autonity network](/networks/) or a [custom network](/developer/custom-networks/) if you are deploying to a local testnet. - - -### Setup your working environment - -1. Install truffle: - -```bash -npm i truffle -``` - -::: {.callout-note title="Note" collapse="false"} -Specifying the `-g ` flag to install Truffle globally will let you use it for future projects without installing in multiple places. -::: - -2. Create a working directory and initialise the project with `npm`: - -```bash -mkdir ERC20Token && cd ERC20Token -mkdir contracts && mkdir migrations && mkdir keystore -touch truffle-config.js && touch migrations/2_deploy_contracts.js -npm init -y -``` - -3. Install OpenZeppelin Contracts and Truffle `hd-wallet-provider` modules: - -```bash -npm i --save-dev @openzeppelin/contracts -npm install --save truffle-keystore-provider -``` - -The `truffle-keystore-provider` module is used to unlock the encrypted ethereum keystore file and sign the contract deployment transaction. You will be prompted to enter the key's password to unlock the account when compiling and deploying the contract. - -In this guide the `truffle-keystore-provider` dependency is installed locally into a sub-directory: `node_modules/truffle-keystore-provider`. - -4. Add your encrypted ethereum keystore file into the `keystore` directory: - -```bash -cp / ./keystore/ -``` - -### Write the contract - -5. In your working directory (`ERC20token`), create a Solidity file for your ERC20 token contract: - -```bash -nano contracts/myToken.sol -``` - -Solidity allows you to build your contract on top of another contract, through inheritance. This guide uses OpenZeppelin's `ERC20PresetFixedSupply` contract, which is an ERC20 contract with a preset token supply that allows the owner to mint and burn tokens. You can view the code for the preset contract code in the OpenZeppelin GitHub [here ](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol). - -For this contract, the guide imports and inherits from the OpenZeppelin preset. If you want to define new contract methods and build on top of the inherited contract you can do so: - -```javascript -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; - -contract myToken is ERC20PresetFixedSupply { - - constructor( - string memory name, - string memory symbol, - uint256 initialSupply - ) ERC20PresetFixedSupply(name, symbol, initialSupply, msg.sender){} - - // Enter additional code here to build on top of the smart contract - -} -``` - -### Configure Truffle - -6. Edit the `truffle-config.js` file to specify the deployment network information and your account information. Specify in `networks` a configuration for each of the network(s) you may deploy to, where: - - `` is the name identifier used by Truffle to identify the required network configuration. - - `` is the name of your encrypted ethereum keystore file. This is the private key of the account you are using to submit the transaction. - - `` is the path to the data directory location of your keystore file. - - `` is the rpc endpoint URL of the network node you are connecting to. - - `` is the network identifier of the network you are connecting to. - - `` is the gas price used for contract deploys. - - -```bash -nano truffle-config.js -``` -```javascript -const KeystoreProvider = require("truffle-keystore-provider") - -const memoizeKeystoreProviderCreator = () => { - let providers = {} - - return (account, dataDir, providerUrl) => { - if (providerUrl in providers) { - return providers[providerUrl] - } else { - const provider = new KeystoreProvider(account, dataDir, providerUrl) - providers[providerUrl] = provider - return provider - } - } -} - -const createKeystoreProvider = memoizeKeystoreProviderCreator() - -module.exports = { - - networks: { - NETWORK_NAME: { - provider: createKeystoreProvider(ACCOUNT,DATA_DIR,PROVIDER_URL), - network_id: NETWORK_ID, - gasPrice: GAS_PRICE - } - }, - - compilers: { - solc: { - version: "0.8.0", - optimizer: { - enabled: false, // test coverage won't work otherwise - runs: 200 - }, - }, - }, - plugins: ["solidity-coverage"] -}; -``` - -In the example beneath, values for deploying to the Piccadilly Testnet are set, `` is explicitly set to Truffle's default of 20000000000 (20 Gwei), and `ACCOUNT` is set to `alice.key`. Note that the `DATA_DIR` is set to `../../` only: the `truffle-keystore-provider` will look by default for keystore files in `/node_modules/truffle-keystore-provider/keystore`. Setting `DATA_DIR` to `../../keystore` results in the module looking for the key in `/keystore/keystore`. - -```javascript -const KeystoreProvider = require("truffle-keystore-provider") - -var ACCOUNT = 'alice.key'; -var DATA_DIR = '../../'; -var PROVIDER_URL = ''; -var NETWORK_ID = 65100000 ; -var GAS_PRICE = 20000000000 ; - -const memoizeKeystoreProviderCreator = () => { - let providers = {} - - return (account, dataDir, providerUrl) => { - if (providerUrl in providers) { - return providers[providerUrl] - } else { - const provider = new KeystoreProvider(account, dataDir, providerUrl) - providers[providerUrl] = provider - return provider - } - } -} - -const createKeystoreProvider = memoizeKeystoreProviderCreator() - -module.exports = { - - networks: { - piccadilly: { - provider: createKeystoreProvider(ACCOUNT,DATA_DIR,PROVIDER_URL), - network_id: NETWORK_ID, - gasPrice: GAS_PRICE - } - }, - - compilers: { - solc: { - version: "0.8.0", - optimizer: { - enabled: false, // test coverage won't work otherwise - runs: 200 - }, - }, - }, - plugins: ["solidity-coverage"] -}; -``` - -### Write deploy script - -7. Add the following script `2_deploy_contracts.js` to the `migrations/` directory, where: - - `` is the text label name for your token. - - `` is the text symbol acronym for your token. - - `` is the amount of token to premint on deployment. For example, `9999999999999999999` - -```bash -nano migrations/2_deploy_contracts.js -``` - -```javascript -module.exports = function(deployer) { - deployer.deploy(artifacts.require("myToken.sol"), '', '', ""); - // Additional contracts can be deployed here -}; -``` - -### Compile the contract - -8. Compile the contract with truffle: - -```bash -truffle compile -``` - -You will be prompted for the password to unlock your account. After compilation you should see something like this: - -```bash -Compiling your contracts... -=========================== -> Compiling ./contracts/myToken.sol -> Compiling @openzeppelin/contracts/token/ERC20/ERC20.sol -> Compiling @openzeppelin/contracts/token/ERC20/IERC20.sol -> Compiling @openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol -> Compiling @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol -> Compiling @openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol -> Compiling @openzeppelin/contracts/utils/Context.sol -> Artifacts written to /home/ubuntu/TEST/contract-deploy/truffle/ERC20Token/build/contracts -> Compiled successfully using: - - solc: 0.8.0+commit.c7dfd78e.Emscripten.clang -``` -### Deploy the contract - -9. Deploy the contract to the block chain, specifying the name of the target `` from a network configured in `truffle-config.js` in Step 5 of [Configure Truffle](/developer/deploy-truffle/#configure-truffle) above: - -```bash -truffle deploy --network -``` - -For example, to deploy to Piccadilly Testnet: - -```bash -truffle deploy --network piccadilly -``` - -After migration you should see something like this: - -```bash -Compiling your contracts... -=========================== -> Everything is up to date, there is nothing to compile. - - -Starting migrations... -====================== -> Network name: 'piccadilly' -> Network id: 65100000 -> Block gas limit: 30000000 (0x1c9c380) - - -2_deploy_contracts.js -===================== - - Deploying 'myToken' - ------------------- - > transaction hash: 0x529c74d4f5f84726415430638ab9050c53069d8bf6c7cb5f2e3b71403aeebaf7 - > Blocks: 0 Seconds: 0 - > contract address: 0xDfe20520f6402bDA7e4b6d718a13bCeBd62383Bc - > block number: 262243 - > block timestamp: 1674757194 - > account: 0x11A87b260Dd85ff7189d848Fd44b28Cc8505fa9C - > balance: 97.714750017 - > gas used: 1384235 (0x151f2b) - > gas price: 20 gwei - > value sent: 0 ETH - > total cost: 0.0276847 ETH - - > Saving artifacts - ------------------------------------- - > Total cost: 0.0276847 ETH - -Summary -======= -> Total deployments: 1 -> Final cost: 0.0276847 ETH -``` diff --git a/networks/index.md b/networks/index.md index 304621cd6..3eae7edb6 100644 --- a/networks/index.md +++ b/networks/index.md @@ -11,16 +11,3 @@ listing: --- -In the run-up to mainnet launch Autonity provides Piccadilly Testnet as an open testnet for node operators, validators and developers. - -## Get Auton test funds - -Take part in the [Piccadilly Tiber Challenge](https://autonity.org/tiber) to get free [auton](/concepts/protocol-assets/auton) to fund your account for testing. - -An alternative way to get auton is by requesting some from the Autonity [Discord Server](https://discord.gg/autonity). Please note this will take much longer. - - diff --git a/networks/mainnet/dax.md b/networks/mainnet/dax.md index d89f2ff16..1432ac04a 100644 --- a/networks/mainnet/dax.md +++ b/networks/mainnet/dax.md @@ -24,7 +24,7 @@ This page details: ### DAX Uniswap Contract Addresses -Decentralized Auton Exchange (DAX) Contract Addresses deployed on the Autonity Network Piccadilly: +Decentralized Auton Exchange (DAX) Contract Addresses deployed on the Autonity Network Bakerloo: | Contract | Address | | :-- | :--: | @@ -55,14 +55,14 @@ Alternatively, you can manually generate the ABI yourself using tooling. For exa You will need to setup your tooling to submit transactions to the DAX from your [account](/account-holders/create-acct/). -This guide assumes you will use the `aut` command line tool (see [Setup Autonity CLI](/account-holders/setup-aut/)) and the `aut contract` command group. To use `aut contract` for this you will need to get the ABI for the DAX Uniswap contract functions. See [Exchange resource links](/networks/testnet-piccadilly/dax.html#exchange-resource-links) for how to get (or generate) the [Uniswap Contract ABI](/getting-started/exchange-dax.html#uniswap-contract-abi). +This guide assumes you will use the `aut` command line tool (see [Setup Autonity CLI](/account-holders/setup-aut/)) and the `aut contract` command group. To use `aut contract` for this you will need to get the ABI for the DAX Uniswap contract functions. See [Exchange resource links](/networks/testnet-bakerloo/dax.html#exchange-resource-links) for how to get (or generate) the [Uniswap Contract ABI](/getting-started/exchange-dax.html#uniswap-contract-abi). Alternatively, develop your own custom scripting for interacting with the DAX Uniswap contracts! For example, using: `web3.py` ([docs ](https://web3py.readthedocs.io/en/stable/), [GitHub ](https://github.com/ethereum/web3.py)) or use the [uniswap-python library ](https://uniswap-python.com/index.html) [command line interface ](https://uniswap-python.com/cli.html). ## Getting DAX pair information -There is currently one pair created on the DAX for an ATN-USDC liquidity pool, the `WATN-USDC` token pair. The contract address for this pair is listed in the [Exchange resource links above](/networks/testnet-piccadilly/dax.html#exchange-resource-links). +There is currently one pair created on the DAX for an ATN-USDC liquidity pool, the `WATN-USDC` token pair. The contract address for this pair is listed in the [Exchange resource links above](/networks/testnet-bakerloo/dax.html#exchange-resource-links). To check if additional pairs have been created, you can query using the Uniswap `Factory` smart contract's `getPair`, `allPairs`, and `allPairsLength` functions, see docs [Factory ](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/factory). You can use the ABI for the Factory interface `IUniswapV2Factory` to do this. diff --git a/networks/mainnet/index.md b/networks/mainnet/index.md index f6d72f0ad..7608e5211 100644 --- a/networks/mainnet/index.md +++ b/networks/mainnet/index.md @@ -9,7 +9,7 @@ Autonity Mainnet is the live Autonity blockchain network for transactions and de Mainnet is for participants interested in: -- The Autonity Futures Protocol +- The [Autonity Futures Protocol](https://afp.autonity.org/) - Decentralized application (dApp) use cases - Providing live validator and public RPC endpoint node infrastructure - The Autonity community! @@ -27,7 +27,7 @@ Mainnet is for participants interested in: ::: {.callout-tip title="Adding Autonity as a custom network to your wallet" collapse="false"} -The above information can be used to add Autonity as a custom network to to an existing client such as [MetaMask](https://support.metamask.io/configure/networks/how-to-add-a-custom-network-rpc/)). +The above information can be used to add Autonity as a custom network to to an existing client such as [MetaMask](https://support.metamask.io/configure/networks/how-to-add-a-custom-network-rpc/). ::: diff --git a/networks/testnet-bakerloo/index.md b/networks/testnet-bakerloo/index.md index 7e564eeb6..1825fd462 100644 --- a/networks/testnet-bakerloo/index.md +++ b/networks/testnet-bakerloo/index.md @@ -1,17 +1,18 @@ --- title: "Bakerloo Testnet" description: > - Public Autonity Testnet running the stable version of the Autonity protocol + Public Autonity Testnet for test and development draft: false --- -Bakerloo is a general purpose public Testnet providing a stable testing environment for those developing a project on top of Autonity. +Bakerloo is a general purpose public testnet that simulates the mainnet protocol configuration. -Bakerloo provides a reliable test network for community developers, node operators, and infrastructure providers to: +Testnet provides a stable environment for community developers, node operators, and infrastructure providers to: -- test their tooling, software and operational practices +- test protocol upgrades before rollout to Mainnet +- test tooling, software and operational practices - work in a safe sandbox environment to build, test, and debug before deployment to mainnet without transaction cost -- innovate new protocols, ideas, and projects. +- innovate and develop new protocols, ideas, and projects for Autonity. ## Bakerloo Testnet details @@ -25,7 +26,7 @@ Bakerloo provides a reliable test network for community developers, node operato ::: {.callout-tip title="Adding Autonity as a custom network to your wallet" collapse="false"} -The above information can be used to add Autonity as a custom network to to an existing client such as [MetaMask](https://support.metamask.io/configure/networks/how-to-add-a-custom-network-rpc/)). +The above information can be used to add Autonity as a custom network to to an existing client such as [MetaMask](https://support.metamask.io/configure/networks/how-to-add-a-custom-network-rpc/). ::: diff --git a/networks/testnet-piccadilly/index.md b/networks/testnet-piccadilly/index.md deleted file mode 100644 index b23fd735c..000000000 --- a/networks/testnet-piccadilly/index.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: "Piccadilly Testnet" -description: > - The _legacy_ public Testnet that hosted the Autonity Piccadilly Tiber Challenge ---- - -::: {.callout-caution title="Legacy - Bakerloo is Autonity's current public testnet" collapse="false"} - -[Bakerloo Testnet](/networks/testnet-bakerloo) is the current Autonity Testnet. - -Piccadilly Testnet is deprecated and will be decommissioned. - -::: - -Piccadilly was a special purpose public testnet running the pre-mainnet deployable version of the Autonity protocol. It was the testing environment used for the pre-mainnet [Piccadilly Tiber Challenge](https://autonity.org/news/2024-09-12-tiber-update). - -Piccadilly was for participants interested in: - -- Taking part in the [Piccadilly Tiber Challenge](https://autonity.org/news/2024-09-12-tiber-update) and helping to develop the Autonity project. -- Helping find bugs in Autonity software. -- Operating node infrastructure. -- Operating as a validator. -- Stake delegation. -- Developing and deploying dApp use cases. - -## Piccadilly Testnet details - -|**Field**|**Input**| -|------|----------| -|Network Name|`Autonity Piccadilly (Tiber) Testnet`| -|New RPC URL|Please select one from [Chainlist](https://chainlist.org/?testnets=true&search=piccadilly)| -|ChainID |`65100004`| -|Symbol|`ATN`| -|Block Explorer URL (optional)|`https://piccadilly.autonity.org/`| - -::: {.callout-tip title="Adding Autonity as a custom network to your wallet" collapse="false"} - -The above information can be used to add Autonity as a custom network to to an existing client such as [MetaMask](https://support.metamask.io/configure/networks/how-to-add-a-custom-network-rpc/)). - -::: - -## Genesis configuration - -| Name | Piccadilly | -| ---------------------------------- | ----------------------------- | -| `chainId` | `65100004` | -| `gasLimit` | `20000000`(20M) | -| `config.autonity.blockPeriod` | `1` second | -| `config.autonity.epochPeriod` | `1800`(30 min) | -| `config.autonity.unbondingPeriod` | `21600`(6 hours) | -| `config.autonity.maxCommitteeSize` | `30` (increases to `100` after genesis) | -| `config.autonity.delegationRate` | `1000` (10%) | -| `config.autonity.treasuryFee` | `10000000000000000` (1%) | -| `config.autonity.minBaseFee` | `500000000` (0.5 [gton](/concepts/protocol-assets/auton/#unit-measures-of-auton)) | -| `config.autonity.operator` | `0xd32C0812Fa1296F082671D5Be4CbB6bEeedC2397` | -| `config.autonity.treasury` | `0xF74c34Fed10cD9518293634C6f7C12638a808Ad5` | -| `config.autonity.validators` | See [`PiccadillyGenesisValidators`](https://github.com/autonity/autonity/blob/release/v1.0.2-alpha/params/gen_piccadilly_config.go#L227-L505) in the AGC configuration code for details. | -| `config.oracle.symbols` | `["AUD-USD", "CAD-USD", "EUR-USD", "GBP-USD", "JPY-USD", "SEK-USD", "ATN-USD", "NTN-USD", "ATN-NTN"]` | -| `config.oracle.votePeriod` | `30` (30 blocks) | - - -## Bootnodes - -The network bootnode addresses are: - -| enode | -| :-- | -| `enode://48a10db920251436ee1d7989db6cbab734157d5bd3ec9d534021e4903fdab51407ba4fd936bd6af1d188e3f464374c437accefa40f0312eac9bc9ae6fc0a2782@34.105.239.129:30303` | -| `enode://9379179c8c0f7fec28dd3cca64da5d85f843e3b05ba24f6ae4f8d1bb688b4581f92c10e84e166328499987cf2da18668446dd7353724cf691ad2a931a0cbd88d@34.93.237.13:30303` | -| `enode://c7e8619c09c85c47a2bbda720ecec449ab1207574cc60d8ec451b109b407d7542cabc2683eedcf326009532e3aea2b748256bac1d50bf877c73eea4d633e8913@54.241.251.216:30303` | - -## Release - -The current iteration of the Piccadilly network is built using: - -- Autonity Go Client (AGC) Release: [v1.0.2-alpha](https://github.com/autonity/autonity/releases/tag/v1.0.2-alpha). The docker image release is: [`ghcr.io/autonity/autonity:v1.0.2-alpha`](https://github.com/autonity/autonity/pkgs/container/autonity) - -- Autonity Oracle Server (AOS) Release: [v0.2.3](https://github.com/autonity/autonity-oracle/releases/tag/v0.2.3). The docker image release is: [`ghcr.io/autonity/autonity-oracle:v0.2.3`](https://github.com/orgs/autonity/packages/container/package/autonity-oracle) - -## Faucet - -- There is currently no faucet for [auton](/concepts/protocol-assets/auton) or [newton](/concepts/protocol-assets/newton) on Piccadilly. Network participants access testnet auton and newton by participating in the [Piccadilly Tiber Challenge](https://autonity.org/tiber). - -## Public endpoints - -Please select one from [Chainlist](https://chainlist.org/?testnets=true&search=piccadilly). For questions related to rate limits or other usage questions, please speak to the owner of the RPC endpoint directly. - - -## Block explorer - -- BlockScout explorer for searching and viewing ledger data: [https://piccadilly.autonity.org/](https://piccadilly.autonity.org/) diff --git a/node-operators/run-aut/index.md b/node-operators/run-aut/index.md index ad97c53eb..b4f055daa 100644 --- a/node-operators/run-aut/index.md +++ b/node-operators/run-aut/index.md @@ -8,6 +8,17 @@ description: > - Ensure that the host machine meets the [minimum requirements](/node-operators/install-aut/#requirements) ::: + +## Running the Autonity Go Client + +When initialised Autonity Go Client will connect to the specified Autonity network, find peer nodes, and begin to sync. AGC's default setting is to connect to Mainnet. + +If connecting to the [Bakerloo Testnet](/networks/testnet-bakerloo/), then the `--bakerloo` command-line option is specified when running the node. The Mainnet and Bakerloo genesis configuration are specified along with bootnodes in the AGC configuration and do not need to be specified. + +If connecting to a custom network genesis configuration and bootnode addresses will need to be specified. For how to do this see the Development guide page [Setting up custom networks](https://docs.autonity.org/developer/custom-networks/). + +This guide exemplifies connecting to Bakerloo. If connecting to Mainnet simply remove the `--bakerloo` flag. + ## Run Autonity (binary or source code install) {#run-binary} - Ensure that the Autonity Go Client has been installed from a [pre-compiled binary](/node-operators/install-aut#install-binary) or from [source code](/node-operators/install-aut#install-source) diff --git a/node-operators/setup-node-monitoring/index.md b/node-operators/setup-node-monitoring/index.md index 421644dfe..9afb0b8fd 100644 --- a/node-operators/setup-node-monitoring/index.md +++ b/node-operators/setup-node-monitoring/index.md @@ -131,11 +131,11 @@ You are now ready to run telegraf in your working directory. To configure Autonity for exporting metrics set [command line options](/reference/cli/#command-line-options) when starting the node for: -- the Autonity testnet being connected to: `--piccadilly` or `--bakerloo`. +- the Autonity Bakerloo Testnet if connecting to Testnet not Mainnet: `--bakerloo`. - enabling metrics collection and reporting: `--metrics`. - enabling the pprof HTTP server: `--pprof`. -The [Piccadilly Testnet](https://docs.autonity.org/networks/testnet-piccadilly/) is connected to in the example configuration here. For a minimal command line start configuration see the how to [Run Autonity](/node-operators/run-aut/). +The [Bakerloo Testnet](https://docs.autonity.org/networks/testnet-bakerloo/) is connected to in the example configuration here. Omit the `--bakerloo` option when connecting to Mainnet. For a minimal command line start configuration see the how to [Run Autonity](/node-operators/run-aut/). Autonity will serve an http feed that provides metrics at `http://localhost:6060/debug/metrics/prometheus`, which you can view in a browser. Notice this is the input specified in `telegraf.conf` above. If you are using Docker, make sure you run the container as host, as shown below: @@ -148,7 +148,7 @@ docker run \ --rm \ ghcr.io/autonity/autonity/autonity:latest \ --datadir ./autonity-chaindata \ - --piccadilly \ + --bakerloo \ --http \ --http.api aut,eth,net,txpool,web3,admin \ --ws \ diff --git a/oracle/install-oracle/index.md b/oracle/install-oracle/index.md index ce29a5ef6..bc0739984 100644 --- a/oracle/install-oracle/index.md +++ b/oracle/install-oracle/index.md @@ -249,9 +249,9 @@ A basic set of data adaptor plugins for sourcing this data is provided out the b - Built by the `make` process when building from source. Run the make command appropriate for the Testnet you are connecting to as described in [Build from source code](/oracle/install-oracle/#install-source). You can view the built plugins in the directory `./build/bin/plugins`. -- Included pre-built as part of the pre-built executable. You can view the built plugins in the directory `/plugins`. The executable is built for Piccadilly Testnet only. +- Included pre-built as part of the pre-built executable. You can view the built plugins in the directory `/plugins`. The executable is built for Mainnet only. -- Included pre-built as part of oracle server Docker image and the pre-built executable. Install the Docker image for the Testnet you are connecting to as described in [Installing the Docker image](/oracle/install-oracle/#install-docker). The built plugins are included in the Docker container at the path `/usr/local/bin/plugins`. +- Included pre-built as part of oracle server Docker image and the pre-built executable. Install the Docker image for the network you are connecting to as described in [Installing the Docker image](/oracle/install-oracle/#install-docker). The built plugins are included in the Docker container at the path `/usr/local/bin/plugins`. ::: {.callout-note title="Note" collapse="false"} You can build the Simulator plugin independently by running the command `make simulator`. This will build the `simulator_plugin` in the `/plugins` directory. A local testnet could be a scenario for setting up and using a simulator. diff --git a/reference/cli/agc/index.md b/reference/cli/agc/index.md index 33c4df90f..9414307cc 100644 --- a/reference/cli/agc/index.md +++ b/reference/cli/agc/index.md @@ -18,7 +18,7 @@ Autonity supports all Geth command-line options with the following _exceptions_: | `attach` and `console` | The Geth JavaScript console is deprecated in favour of Autonity CLI | | `makecache` and `makedag`| The commands are removed. They are specific to ethash Proof of Work consensus and not required by Autonity's Tendermint consensus | | ETHEREUM OPTIONS: || -| `piccadilly` and `bakerloo` | Options for connecting to the Autonity test networks 'Piccadilly' and `Bakerloo` are added (Options for connecting to the Ethereum test networks are removed) | +| `bakerloo` | An option for connecting to the Autonity test network 'Bakerloo' is added (Options for connecting to the Ethereum test networks are removed) | | `genOwnershipProof` | An option to generate an enode proof required for validator registration is added | | `genAutonityKeys` | Autonity implements separate channels for transaction and consensus gossiping and so has two keys at the P2P layer. An option to generate an Autonity keys file containing the transaction and consensus gossiping private keys is added | | NETWORKING OPTIONS: || @@ -108,11 +108,10 @@ ETHEREUM OPTIONS: --keystore value Directory for the keystore (default = inside the datadir) --usb Enable monitoring and management of USB hardware wallets --pcscdpath value Path to the smartcard daemon (pcscd) socket file (default: "/run/pcscd/pcscd.comm") - --networkid value Explicitly set network id (integer)(For testnets: use --piccadilly instead) (default: 65000000) + --networkid value Explicitly set network id (integer)(For testnets: use --bakerloo instead) (default: 65000000) --syncmode value Blockchain sync mode ("snap", "full" or "light") (default: snap) --exitwhensynced Exits after block synchronisation completes --gcmode value Blockchain garbage collection mode ("full", "archive") (default: "full") - --piccadilly Piccadilly network: pre-configured Autonity test network --bakerloo Bakerloo network: pre-configured Autonity test network --txlookuplimit value Number of recent blocks to maintain transactions index for (default = about one year, 0 = entire chain) (default: 2350000) --ethstats value Reporting URL of a ethstats service (nodename:secret@host:port) diff --git a/reference/utility-tools/index.md b/reference/utility-tools/index.md deleted file mode 100644 index 2e80fa7e4..000000000 --- a/reference/utility-tools/index.md +++ /dev/null @@ -1,227 +0,0 @@ ---- -title: "Utility tools " -description: > - Tools for interacting with the Autonity Go Client and an Autonity Network -draft: true ---- - - -Reference and command line options for tooling and utilities provided for submitting transactions and calls to an Autonity Go Client node, and interacting with an Autonity Network. - -Details on: - -- Installation and connecting to a node on an Autonity network, usage, and RPC calls available. - -## Python CLI: `aut` - -The Autonity CLI is a command-line RPC client for Autonity written in Python. - -### Installation - -For how to install, configure, and connect `aut` to a node on an Autonity network see the instructions in the GitHub `autonity/aut` repo [README.md](https://github.com/autonity/aut#readme). - -### Usage - -Run `aut --help` to view the options. - -``` -Usage: aut [OPTIONS] COMMAND [ARGS]... - - Command line interface to Autonity functionality. - -Options: - -v, --verbose Enable additional output (to stderr) - --version Show the version and exit. - --help Show this message and exit. - -Commands: - account Commands related to specific accounts. - block Commands for querying block information. - node Commands related to querying specific Autonity nodes. - protocol Commands related to Autonity-specific protocol operations. - token Commands for working with ERC20 tokens. - tx Commands for transaction creation and processing. - validator Commands related to the validators. -``` -For how to execute RPC calls using `aut` commands, see the instructions in the GitHub `autonity/aut`repo [README.md](https://github.com/autonity/aut#readme). - - -### RPC Calls -#### Calling the `account` commands - -Run `aut account --help` to view the options. - -``` -Usage: aut account [OPTIONS] COMMAND [ARGS]... - - Commands related to specific accounts. - -Options: - --help Show this message and exit. - -Commands: - balance Print the current balance of the given account. - import-private-key Read a plaintext private key file (as hex), and... - info Print some information about the given account... - list List the accounts for files in the keystore directory. - lntn-balances Print the current balance of the given account. - new Create a new key and write it to a keyfile. - sign-message Use the private key in the given keyfile to sign... - signtx Sign a transaction using the given keyfile. - verify-signature Verify that the signature in SIGNATURE_FILE` is... -``` -#### Calling the `block` commands - -Run `aut block --help` to view the options. - -``` -Usage: aut block [OPTIONS] COMMAND [ARGS]... - - Commands for querying block information. - -Options: - --help Show this message and exit. - -Commands: - get Print information for block, where is a block number... -``` -#### Calling the `node` commands - -Run `aut node --help` to view the options. - -``` -Usage: aut node [OPTIONS] COMMAND [ARGS]... - - Commands related to querying specific Autonity nodes. - -Options: - --help Show this message and exit. - -Commands: - info Print general information about the RPC node configuration and... -``` -#### Calling the `protocol` commands - -Run `aut protocol --help` to view the options. - -``` -Usage: aut protocol [OPTIONS] COMMAND [ARGS]... - - Commands related to Autonity-specific protocol operations. See the Autonity - contract reference for details. - -Options: - --help Show this message and exit. - -Commands: - burn Burn the specified amount of NTN stake token... - commission-rate-precision Precision of validator commission rate values - config Print the Autonity contract config - deployer Contract deployer - epoch-id ID of current epoch - epoch-reward Reward for this epoch - epoch-total-bonded-stake Total stake bonded this epoch - get-bonding-req Get queued bonding information between start... - get-committee Get current committee" - get-committee-enodes Enodes in current committee - get-last-epoch-block Block of last epoch - get-max-committee-size Maximum committee size - get-minimum-base-fee Minimum base fee - get-operator Contract operator - get-proposer Proposer at the given height and round - get-unbonding-req Get queued unbonding information between... - get-validators Get current validators - get-version Contract version - head-bonding-id Head ID of bonding queue - head-unbonding-id Head ID of unbonding queue - last-epoch-block Block number of the last epoch - mint Mint new stake token (NTN) and add it to the... - set-committee-size Set the maximum size of the consensus... - set-epoch-period Set the epoch period. - set-minimum-base-fee Set the minimum gas price. - set-operator-account Set the Operator account. - set-treasury-account Set the global treasury account. - set-treasury-fee Set the treasury fee. - set-unbonding-period Set the unbonding period. - tail-bonding-id Tail ID of bonding queue - tail-unbonding-id Tail ID of unbonding queue - total-redistributed Total fees redistributed - ``` - -#### Calling the `token` commands - -Run `aut token --help` to view the options. - -``` -Usage: aut token [OPTIONS] COMMAND [ARGS]... - - Commands for working with ERC20 tokens. - -Options: - --help Show this message and exit. - -Commands: - allowance Returns the quantity in tokens that OWNER has granted... - approve Create a transaction granting SPENDER permission to... - balance-of Returns the balance in tokens of ACCOUNT. - decimals Returns the number of decimals used in the token balances. - name Returns the token name (if available). - symbol Returns the token symbol (if available). - total-supply Total supply (in units of whole Tokens). - transfer Create a transaction transferring AMOUNT of tokens to... - transfer-from Create a transaction transferring AMOUNT of tokens held... -``` - -#### Calling the `tx` commands - -Run `aut tx --help` to view the options. - -``` -Usage: aut tx [OPTIONS] COMMAND [ARGS]... - - Commands for transaction creation and processing. - -Options: - --help Show this message and exit. - -Commands: - make Create a transaction given the parameters passed in. - send Send raw transaction (as generated by signtx) contained in the... - sign Sign a transaction using the given keyfile. - wait Wait for a transaction with a specific hash, and dump the receipt. -``` -#### Calling the `validator` commands - -Run `aut validator --help` to view the options. - -``` -Usage: aut validator [OPTIONS] COMMAND [ARGS]... - - Commands related to the validators. - -Options: - --help Show this message and exit. - -Commands: - activate Create transaction to activate a paused validator. - bond Create transaction to bond Newton to a validator. - claim-rewards Create transaction to claim rewards from a Validator. - info Get information about a validator. - list Get current validators - pause Create transaction to pause the given validator. - register Create transaction to register a validator - unbond Create transaction to unbond Newton from a validator. - unclaimed-rewards Check the given validator for unclaimed-fees. -``` - -## BlockScout block explorer - -You can interact with the Autonity Network using the explorer utility https://piccadilly.autonity.org/. This is a fork of BlockScout and provides GraphQL and RPC APIs to inspect and analyse chain data. - -BlockScout provides query API's: - -- RPC API. This API is provided for developers transitioning their applications from Etherscan to BlockScout. It supports GET and POST requests. [Documentation](https://piccadilly.autonity.org//api-docs). - -- Eth RPC API. This API is provided to support some rpc methods in the exact format specified for ethereum nodes. This is useful to allow sending requests to BlockScout without having to change anything about the request. However, in general, the custom RPC is recommended. [Documentation](https://piccadilly.autonity.org/eth-rpc-api-docs). - -- GraphQL API. This API is provided for developers to write custom GraphQL queries using a [graphiql](https://piccadilly.autonity.org/graphiql) interface. For usage see the BlockScout docs API page [GraphQL in BlockScout](https://docs.blockscout.com/for-users/api/graphql).