diff --git a/GUIDELINES.md b/GUIDELINES.md index e40ca7c..abf5773 100644 --- a/GUIDELINES.md +++ b/GUIDELINES.md @@ -2,13 +2,6 @@ ## Format -### Weekly calls on Mondays - -* We will reset genesis roughly every three weeks. -* Time will alternate each week to accommodate different hemispheres -* We assign points at the end of the week and reveal the leaderboard each Monday -* At the end of the competition, we will convert the points to tokens and perform KYC required by your country of residence to assign them to you. - ## Rules This program is hard to create rules for, so we’re giving you guidelines and examples. Judges on our side will rate your submissions and assign points. diff --git a/LEADERBOARD.md b/LEADERBOARD.md index 937d107..a7537df 100644 --- a/LEADERBOARD.md +++ b/LEADERBOARD.md @@ -1,4 +1,5 @@ # LEADERBOARD +*From previous Stake Wars* | name | total points | |---------------|--------------| diff --git a/README.md b/README.md index 2c64278..2f0482d 100644 --- a/README.md +++ b/README.md @@ -1,155 +1,566 @@ -# **January 13th 2020 update: Stake Wars is on hold** +# **April 27th 2020 update: Stake Wars is back** +NEAR Protocol is ready for the next step: launch Stake Wars 2.0! We learned a lot from running together the first Stake Wars, and we worked hard to release a NEAR node that is stable and production-ready. -Stake Wars will be on hold until the implementation of [Doomslug](https://near.ai/doomslug) is fully finalized and our internal testing becomes all green, meaning we hit what we call a “Release Candidate” (code named Sky Breaker). +We are now ready to get into the next step: open Stake Wars to anyone! -We will restart the Stake Wars after that, discontinuing Tatooine and inviting participants to validate official TestNet (continues state since last April 2019). +Stake Wars 2.0 will test the *delegation* of tokens from users to validators. Therefore, we want you validators to be ready for the action and involve you with NEAR Protocol community as a whole. -You can read the full blog post "We’re pausing Stake Wars" [here](https://nearprotocol.com/blog/were-pausing-stake-wars/). -If you want to be the first to know when Stake Wars is back, join our Telegram validator channel [here](https://t.me/joinchat/Msj7FBRzcys3zb6J79u5bw). +The goals are: +- for end-users, learn the principles of proof of stake, and build confidence with the concepts of delegation +- for validators, integrate their platforms with NEAR's delegation smart contract, and build customer relationships early on +- for NEAR Protocol, iterate on the reference smart contract, and kickstart the community efforts to transform delegation into a new class of DeFi products -## The basics -The first leg of Stake Wars led to us learning a ton. We made some mistakes, and we iterated based on your feedback. For that reason, we changed how points work. If you earned points for reporting bugs, you keep the points that you earned. +If you haven't already: +1. Join our Telegram validator channel [here](https://t.me/joinchat/Msj7FBRzcys3zb6J79u5bw) for general discussion +2. Join our Discord channel [here](https://discord.gg/zmwQd5) for troubleshooting and technical discussion -Moving forward, the way to earn points is to: +## The basics +If you are just curious, follow the quickstart guides below, and you'll be ready in a few minutes. However, this is just a shortcut to becoming familiar with high-level concepts of the protocol, not the most secure and efficient way to do it! -1. run test scenarios found in [scenarios.md](scenarios.md) -2. submit the scenario that you ran as an issue -3. participate by running a validating node each week +### Quickstart For Validators +- Use [this form](https://forms.gle/5KabPsD4BefR6nv68) to enroll in the Stake Wars 2.0 and receive a few tokens to stake +- If you don't already have one, create a betanet account using our [hosted betanet wallet](https://wallet.betanet.nearprotocol.com) +- Spin up an Ubuntu/Debian VPS and follow the [nearup](https://github.com/near/nearup) tutorial +- Add your validator info to [this file](./VALIDATORS.md) - just fork and pull request, we'll merge ASAP -Soon, we will merge the Stake Wars network into TestNet. At that point, you can run all of the scenarios there for the same amounts of points. +**HEADS UP:** We will reset Betanet every Tuesday at 6pm Pacific, so plan a node restart to download and install the new release automatically. -In order to get more tokens on TestNet: +### Quickstart For Delegators (work in progress) +Most of the information can be found on the official [Stake Wars page (work in progress)](#). At a high level, you have to: +- Enroll with your Betanet wallet +- Receive the tokens that you will stake +- Pick your favorite validators and follow their staking instructions +- Join the conversation on [TBA](#) -1. Generate keys (don't delete or regenerate these!) -2. Send us the associated account id and public key -3. Stake each week using that account -4. Get sweet points for staking +**Heads up:** As a Delegator, you don't have to read further, this repository is written for node operators who want to become NEAR validators and enroll users like you. So, your next step is just to open the [Stake Wars page](#) and take it from there. -## How to get started +## Validator Walkthrough guide +If you plan to participate in the Stake Wars, we suggest you to follow this guide and join us on Discord if you have comments or issues. -Before you start, please make sure that you have or setup a machine with a publicly routable ip address. Also please make sure you have docker installed on your machine, or--if you prefer to run your node without docker--follow the instructions [here](https://docs.nearprotocol.com/docs/local-setup/running-testnet) to install the required packages. +This guide will help you to: -Read the [guidelines document](/GUIDELINES.md) first. It's not just legal mumbo-jumbo, it actually explains how this competition will be run and how to submit tests and bugs +1. Generate a new keypair +2. Receive some tokens +3. Run nearcore via nearup +4. Stake some funds +5. Join Stake Wars 2.0 -## Initialization +### 1.Generate a new keypair +You have to install [near-shell](https://github.com/nearprotocol/near-shell), a Node.js application that relies on nearlib to generate secure keys, connect to the NEAR platform and send transactions to the network on your behalf. +You don't have to install near-shell on your node - on the contrary, it's suggested to keep your staking wallet on a different machine. -To start, checkout nearcore repository: +1. `cd` into a directory you'd like to work in +2. Download `near-shell` with `npm install -g near-shell` +3. Run `npx create-near-app staking` +4. `cd` into `staking` +5. Set your NODE_ENV to betanet. You can do this in `bash` with the command `export NODE_ENV=betanet` +6. Run `near login` and follow the instructions that take you to the wallet +7. Once you're logged in, `near-shell` is ready to send staking transactions -```bash -git clone https://github.com/nearprotocol/nearcore.git -cd nearcore -``` +### 2.Receive some tokens +Work in Progress. By now use this [request form](https://docs.google.com/forms/d/1xarv54e-fFSuD2AQorAPx4086z3zyS5ZNGwcLr4QkeQ). On the last page you can put your betanet account id. -Next, generate node key and validator key by +### 3a.Download nearup and go automatic +Before you start, please make sure that you have or setup a machine with a publicly routable ip address. +Use [nearup tutorial](https://github.com/near/nearup) to download the binaries and run your node automatically. -```bash -./scripts/start_stakewars.py --init --account-id= -``` +For security and operations (eg infrastructure as code), you may want to compile nearcore from its source: -Here for account id, enter the account id you want to use for staking. +### 3b.Compile nearcore from source code +You can find updated build instructions on [NEAR docs](https://docs.nearprotocol.com/docs/local-setup/running-testnet#compile-testnet-without-docker), in the 'running testnet' section. +**Warning:** instead of `testnet` you have to run `betanet`, therefore you have to download and compile the [beta branch](https://github.com/nearprotocol/nearcore/tree/beta), otherwise your node will not be able to connect to the network. -Observe that `node_key.json` and `validator_key.json` are -generated in `~/.near`. +### 4a.Stake funds from your wallet (no delegation) -Please note that if you would like to generate key pairs for your account, -you can also do it using the following command: +#### Start nearup in validator mode + +When your launch `nearup` the first time, it will ask your account id, to generate the `validator_key` that will sign new blocks. This information will be stored in the file `validator_key.json` and contains your account_id and the validator keypair: ```bash -./scripts/start_stakewars.py --init --signer-keys --account-id= +cat ~/.near/betanet/validator_key.json ``` +If you get an error like this one, you your node has no validator key: +```bash +nearkat@nearkat ~ % cat ~/.near/betanet/validator_key.json |grep "public_key" +cat: /Users/nearkat/.near/betanet/validator_key.json: No such file or directory +``` +To generate one, the safest way is to reset your `.near` folder: +1. stop the node issuing the command `nearup stop` +2. cleanup your `~/.near` directory +3. restart the node with the command `nearup betanet` +(remember to append `--nodocker` if you are not running the container) -It will by default generate three key pairs in files `signer0_key.json`, `signer1_key.json`, and -`signer2_key.json`. - -## How to stake with a wallet generated account +**HEADS UP:** deleting your `.near` folder will wipe any existing validator key. Therefore, any existing staking transaction will have to be re-issued with the new public key. -### To get the local node started +Without any `.near` folder, `nearup` will ask your *betanet* account ID again. If successful, you should see a screen like this: +``` +Pull docker image nearprotocol/nearcore:beta +Setting up network configuration. +Enter your account ID (leave empty if not going to be a validator): nearkat +Generating node key... +Node key generated +Generating validator key... +Validator key generated +Stake for user 'nearkat' with 'ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB' +Starting NEAR client docker... +Node is running! +To check logs call: docker logs --follow nearcore +``` +From this screen you can verify that: +`` is set with the correct user 'nearkat' +`` is automatically generated with the key `ed25519:GR2xDB5ERrRkXN76JzvfpY8ksz7vFdLVegarLsJbMZJL` -1. Make sure to clear out the ~/.near folder every week no matter what. -2. Run `scripts/start_stakewars.py --signer-keys --init --account-id=` -3. Move accounts.csv into your ~/.near folder -4. Run `scripts/start_stakewars.py` +**HEADS UP:** Save this public key for later, you'll need it quite often in this tutorial. -### To stake from the command line +#### Issue the staking transaction -1. `cd` into a directory you'd like to work in -2. Download `near-shell` with `npm install -g near-shell` -3. Run `npx create-near-app staking` -4. `cd` into `staking` -5. Set your NODE_ENV to tatooine. You can do this in `bash` with `export NODE_ENV=tatooine` -6. Run `near login` and follow the instructions that take you to the wallet. -7. Once you're logged in, you can stake. This is the command to stake: +Get back to your `near-shell` machine and configure it to use `betanet`: +```bash +export NODE_ENV=betanet +``` +(no output expected) +Then, issue this command to stake: ```bash near stake ``` +**HEADS UP:** `` must be set in NEAR, and you should have enough tokens in your account. Don't stake 100% of your account holdings: please leave enough tokens to issue smart contracts and pay your account storage (100 $NEAR will do great). -NOTE: `` can be set in NEAR - -### Check if it worked +If you get an error like this one check if you correctly set `betanet` as the node environment: +```bash +nearkat@nearkat ~ % near stake nearkat ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB 75000 +Using options: { + networkId: 'default', + nodeUrl: 'https://rpc.nearprotocol.com', + contractName: undefined, + walletUrl: 'https://wallet.nearprotocol.com', + helperUrl: 'https://helper.nearprotocol.com', + accountId: 'nearkat', + stakingKey: 'ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB', + amount: '75000' +} +Staking 75000 (75000000000000000000000000000) on nearkat with public key = ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB. +Error: TypedError: [-32000] Server error: account nearkat does not exist while viewing + at JsonRpcProvider.sendJsonRpc (/usr/local/lib/node_modules/near-shell/node_modules/near-api-js/lib/providers/json-rpc-provider.js:113:27) + at processTicksAndRejections (internal/process/task_queues.js:97:5) + at async JsonRpcProvider.query (/usr/local/lib/node_modules/near-shell/node_modules/near-api-js/lib/providers/json-rpc-provider.js:60:24) + at async Account.fetchState (/usr/local/lib/node_modules/near-shell/node_modules/near-api-js/lib/account.js:45:23) + at async Account.state (/usr/local/lib/node_modules/near-shell/node_modules/near-api-js/lib/account.js:52:9) + at async Near.account (/usr/local/lib/node_modules/near-shell/node_modules/near-api-js/lib/near.js:40:9) + at async exports.stake (/usr/local/lib/node_modules/near-shell/index.js:179:21) + at async Object.handler (/usr/local/lib/node_modules/near-shell/utils/exit-on-error.js:4:9) { + type: 'UntypedError' +} -1. After running the command, you should see a transaction receipt that contains `status: { SuccessValue: '' }`. (As long as it is empty or contains a string you're good) -2. After two epochs, if you've staked enough, you will see the logs of your node appear with a `V/n` to tell you you're validating. -3. Run `near state ` and see if the amount you've staked is marked as locked. +``` +To solve the issue, try to execute `export NODE_ENV=betanet` and issue the stake transaction again. -### Difference between different types of keys +### 4b. Stake funds with a delegation smart contract (work in progress) +This process is similar to the one above, with the difference that you have to deploy a delegation smart contract, and stake your funds through it. -You might wonder why there are three different types of keys and how they can be used. Here is a short explanation: +Once the contract is deployed, any user will be able to deposit funds into your staking contract, and delegate their stake to your validator node. -* `node_key` is used to sign messages sent between nodes and you don't need to worry about them. -* `validator_key` is the key that your validating node will use to sign the blocks that they produce, as well as approvals of other blocks. -Notice that this key is not stored in state and cannot be used to sign transactions. -* `signer_key` is used to sign transactions originated from your account. They are not related to running a validating node per se, -but if you want to do anything with your account on the network, you need to have the corresponding private key(s) to send transactions. +Follow the guide in the [Staking Pool contract](https://github.com/near/initial-contracts) repository for details. -## Uploading info for genesis -We will be using a different genesis every week. -Fill your information in the typeform found at [near.ai/genesis](https://near.ai/genesis). You will be asked for: +## Check if it worked +You have five different ways to verify that your stake transaction was successfully included in the blockchain: +1. A correct output from near shell +2. A new event on the betanet block explorer +3. A correct balance in your account, using `near state` command +4. A change in the `nearup` logs displayng an uppercase "V" +5. A query to the JSON RPC using the `validator` endpoint -* `account_id`: the account id you used in the previous step. -* `full_pks`: the public keys you want to use for your account. **If you enter multiple keys here, please make sure that they are comma separated**. Please make sure that your have the corresponding private keys. - * If, in the initialization step, you generated signer keys this is where you should put the public keys. - * If you would like to use near-shell, make sure that your have your keys in the proper place (`~/neardev/default` for example). -* `amount`: please enter `10000000000000000000`. -* `is_treasury`: please enter `false`. -* `validator_stake`: please enter `10000000000000000000`. -* `validator_key`: enter the public key from `validator_key.json`. -* `peer_info`: it should be of the form `@:24567` where -`public_key` is the public key from `node_key.json`. +1. You should see a transaction receipt that ends with `status: { SuccessValue: '' }` similar to the one below: +``` +nearkat@nearkat ~ $ near stake nearkat ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB 70000 +Using options: { + networkId: 'betanet', + nodeUrl: 'https://rpc.betanet.nearprotocol.com', + contractName: undefined, + walletUrl: 'https://wallet.betanet.nearprotocol.com', + helperUrl: 'https://helper.betanet.nearprotocol.com', + accountId: 'nearkat', + stakingKey: 'ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB', + amount: '70000' +} +Staking 70000 (70000000000000000000000000000) on nearkat with public key = ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB. +{ + status: { SuccessValue: '' }, + transaction: { + signer_id: 'nearkat', + public_key: 'ed25519:8GQ3X1fuKdprwwkHUxi4bXj2ux9Bdm6gMJdgFdWk6hGc', + nonce: 7, + receiver_id: 'nearkat', + actions: [ + { + Stake: { + stake: '70000000000000000000000000000', + public_key: 'ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB' + } + } + ], + signature: 'ed25519:4ryh1uxbPVsoFuqAsyTowupGfpwz3XuaEnYw6fmQ1Q3nrLXgUL362RGZwFo2wKWJaSmJirqDnMtpiSzrH4DCHBQ2', + hash: 'FTTzoTpGVjXN8sSTKrRTt9RBnVZs7XsKnYXc8nF8mjAu' + }, + transaction_outcome: { + proof: [ + { + hash: '5eCuCp2a5yHjF1BuPrbpccW4VKvs9m3S6UNnkU3LUpMS', + direction: 'Right' + } + ], + block_hash: 'CLMZnLxzi5CzKepMRTqPk5wdMwMhwHu42YnYSfQoJDKK', + id: 'FTTzoTpGVjXN8sSTKrRTt9RBnVZs7XsKnYXc8nF8mjAu', + outcome: { + logs: [], + receipt_ids: [ 'Atpwa7tbbBizZ8bVJusMZ7dvUTCECksXxKxT69BxnMdm' ], + gas_burnt: 924119500000, + status: { + SuccessReceiptId: 'Atpwa7tbbBizZ8bVJusMZ7dvUTCECksXxKxT69BxnMdm' + } + } + }, + receipts_outcome: [ + { + proof: [ + { + hash: '8fNXhpjrs4iyPPbzTYUr1V4zM73LdeohocGMCTxJUBB6', + direction: 'Left' + } + ], + block_hash: 'CLMZnLxzi5CzKepMRTqPk5wdMwMhwHu42YnYSfQoJDKK', + id: 'Atpwa7tbbBizZ8bVJusMZ7dvUTCECksXxKxT69BxnMdm', + outcome: { + logs: [], + receipt_ids: [], + gas_burnt: 924119500000, + status: { SuccessValue: '' } + } + } + ] +} +``` +2. Visit the [betanet explorer](https://explorer.betanet.nearprotocol.com) and check that your staking transaction succeeded: -For other fields, please leave the blank. +![alt text](media/stake_tx_explorer.png "Explorer successful transaction") -## Download the spreadsheet +3. Run `near state ` and see if the amount you've staked is marked as locked, similar to the content below: +``` +nearkat@nearkat ~ $ near state nearkat +Using options: { + networkId: 'betanet', + nodeUrl: 'https://rpc.betanet.nearprotocol.com', + contractName: undefined, + walletUrl: 'https://wallet.betanet.nearprotocol.com', + helperUrl: 'https://helper.betanet.nearprotocol.com', + accountId: 'nearkat' +} +Account nearkat +{ + amount: '58957995048254107744134739414', + locked: '70000000000000000000000000000', + code_hash: '11111111111111111111111111111111', + storage_usage: 510, + storage_paid_at: 0, + block_height: 2556149, + block_hash: '3J8VBP5Yrooz3zoFhNHy6G15arkyuzg4QkYdtBsc3fUj', + formattedAmount: '58,957.995048254107744134739414' +} -When everyone who wants to participate finishes filling in their information, -download the spreadsheet as a csv file and upload to `~/.near/accounts.csv` on your node. +``` +The `locked:` value will express in yoctoNEAR your staked amount. -We will host the three csv for you to download during the calls. +4. After two epochs (24 hours), you will see the logs of your node appear with a `V/n` to tell you you're validating: +``` +Apr 14 21:44:57.128 INFO stats: # 2556590 XzssUzbfUmtAduVBjob2uGWK6hU8JP8jk4zwm11wRTN V/6 16/15/40 peers ⬇ 65.3kiB/s ⬆ 71.0kiB/s 1.30 bps 0 gas/s CPU: 8%, Mem: 1.2 GiB +Apr 14 21:45:07.130 INFO stats: # 2556603 6dpBFao9M1MWRZZe79ohn3z7oAZYzW5yFMCkyu89piQ8 V/6 16/15/40 peers ⬇ 64.2kiB/s ⬆ 71.0kiB/s 1.30 bps 0 gas/s CPU: 8%, Mem: 1.2 GiB +Apr 14 21:45:17.132 INFO stats: # 2556615 BJHBXF9mPqGeLjnbiPR8Y28NjZppZDjRTyiDFLNVbF2G V/6 16/15/40 peers ⬇ 61.9kiB/s ⬆ 72.5kiB/s 1.20 bps 0 gas/s CPU: 7%, Mem: 1.2 GiB +``` +The status `V/6` right after the block hash says that you are one of six validators. +If the status is `-/6` your node is not yet a validator, or the staking tokens were insufficient. +Sometimes you may see the parameter as `F/10`: this means your stake was too small, and you are currently a fisherman (which has no rewards). -If you are running a node on gcloud, the following command might be useful: +5. Query the Betanet block explorer via JSON RPC, to view all existing proposals: ```bash -gcloud beta compute scp :/home//.near/accounts.csv +curl -d '{"jsonrpc": "2.0", "method": "validators", "id": "dontcare", "params": [null]}' -H 'Content-Type: application/json' https://rpc.betanet.nearprotocol.com -v ``` -Note: due to how docker interacts with linux systems, editing `~/.near` might -require root privilege. In that case you can first copy the csv file to some location -on your node and then transfer it to `~/.near`. - -## Start your node +The call will return a JSON with the current parameters: +- current_validators +- next_validators +- current_fishermen +- next_fishermen +- **current_proposals << your transaction should be here** +- prev_epoch_kickout + +
+ Click to expand an example of JSON output + +```json +{ + "jsonrpc": "2.0", + "result": { + "current_validators": [ + { + "account_id": "bowen.test", + "public_key": "ed25519:2kjQU7uJjWwCgGzS26pz7PtnL2NT98LTZyBNYjr1sYwx", + "is_slashed": false, + "stake": "97970693373589304551816887209", + "shards": [ + 0 + ], + "num_produced_blocks": 1568, + "num_expected_blocks": 1568 + }, + { + "account_id": "buildlinks.test", + "public_key": "ed25519:Bq2SR9R8xwztP5YSudwdMgBXbKa1KcizcKD4QCdK65p7", + "is_slashed": false, + "stake": "100000000000000000000000000000", + "shards": [ + 0 + ], + "num_produced_blocks": 182, + "num_expected_blocks": 1570 + }, + { + "account_id": "figment-betanet", + "public_key": "ed25519:GtFcXjjdo3xs2xafAUstvdNLbw3YDRsv8798qhDfdWau", + "is_slashed": false, + "stake": "126557431195539821072612918725", + "shards": [ + 0 + ], + "num_produced_blocks": 1812, + "num_expected_blocks": 1832 + }, + { + "account_id": "illia", + "public_key": "ed25519:HDGR8HHcKJuPWsfe7rEbmmzMmB1h2sMV3synesYVGf1j", + "is_slashed": false, + "stake": "237114320489469642690227273793", + "shards": [ + 0 + ], + "num_produced_blocks": 0, + "num_expected_blocks": 3665 + }, + { + "account_id": "nearkat", + "public_key": "ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB", + "is_slashed": false, + "stake": "78222174019581877549836985626", + "shards": [ + 0 + ], + "num_produced_blocks": 1046, + "num_expected_blocks": 1046 + }, + { + "account_id": "node0", + "public_key": "ed25519:7PGseFbWxvYVgZ89K1uTJKYoKetWs7BJtbyXDzfbAcqX", + "is_slashed": false, + "stake": "238339659072897867748078610107", + "shards": [ + 0 + ], + "num_produced_blocks": 3663, + "num_expected_blocks": 3663 + }, + { + "account_id": "node1", + "public_key": "ed25519:6DSjZ8mvsRZDvFqFxo8tCKePG96omXW7eVYVSySmDk8e", + "is_slashed": false, + "stake": "242014825065931544260409042195", + "shards": [ + 0 + ], + "num_produced_blocks": 3925, + "num_expected_blocks": 3925 + }, + { + "account_id": "node2", + "public_key": "ed25519:GkDv7nSMS3xcqA45cpMvFmfV1o4fRF6zYo1JRR6mNqg5", + "is_slashed": false, + "stake": "199913782638170701764620852187", + "shards": [ + 0 + ], + "num_produced_blocks": 3142, + "num_expected_blocks": 3142 + }, + { + "account_id": "node3", + "public_key": "ed25519:ydgzeXHJ5Xyt7M1gXLxqLBW1Ejx6scNV5Nx2pxFM8su", + "is_slashed": false, + "stake": "240935684024498896347812640603", + "shards": [ + 0 + ], + "num_produced_blocks": 3922, + "num_expected_blocks": 3922 + }, + { + "account_id": "unknown.test", + "public_key": "ed25519:6VGREgEwSEYqb2qbhjK8PvJc2NJKtdD9zy6RTbAccH3S", + "is_slashed": false, + "stake": "117392659285106031101261119727", + "shards": [ + 0 + ], + "num_produced_blocks": 1832, + "num_expected_blocks": 1832 + } + ], + "next_validators": [ + { + "account_id": "bowen.test", + "public_key": "ed25519:2kjQU7uJjWwCgGzS26pz7PtnL2NT98LTZyBNYjr1sYwx", + "stake": "101525336463327823810344355637", + "shards": [ + 0 + ] + }, + { + "account_id": "buildlinks.test", + "public_key": "ed25519:Bq2SR9R8xwztP5YSudwdMgBXbKa1KcizcKD4QCdK65p7", + "stake": "103242936749015049193558050110", + "shards": [ + 0 + ] + }, + { + "account_id": "hashquark", + "public_key": "ed25519:9RHYjfS5eo8CAxnsE7R1VgDCK5ofTbk5z2CtfGkv8MvJ", + "stake": "151400000000000000000000000000", + "shards": [ + 0 + ] + }, + { + "account_id": "nearkat", + "public_key": "ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB", + "stake": "80723946901794317217366119514", + "shards": [ + 0 + ] + }, + { + "account_id": "node0", + "public_key": "ed25519:7PGseFbWxvYVgZ89K1uTJKYoKetWs7BJtbyXDzfbAcqX", + "stake": "246151555757109477336718079379", + "shards": [ + 0 + ] + }, + { + "account_id": "node1", + "public_key": "ed25519:6DSjZ8mvsRZDvFqFxo8tCKePG96omXW7eVYVSySmDk8e", + "stake": "250276918680695799107215971895", + "shards": [ + 0 + ] + }, + { + "account_id": "node2", + "public_key": "ed25519:GkDv7nSMS3xcqA45cpMvFmfV1o4fRF6zYo1JRR6mNqg5", + "stake": "206318272886843319377092484825", + "shards": [ + 0 + ] + }, + { + "account_id": "node3", + "public_key": "ed25519:ydgzeXHJ5Xyt7M1gXLxqLBW1Ejx6scNV5Nx2pxFM8su", + "stake": "249174529750016868197216096172", + "shards": [ + 0 + ] + }, + { + "account_id": "nuc.test", + "public_key": "ed25519:6CZbX8r9DqKNQ5Vd6xDrqsMuygV9HQ8QLecziC41D26p", + "stake": "40000000000000000000000000000", + "shards": [ + 0 + ] + }, + { + "account_id": "unknown.test", + "public_key": "ed25519:6VGREgEwSEYqb2qbhjK8PvJc2NJKtdD9zy6RTbAccH3S", + "stake": "121314281134898099361682531845", + "shards": [ + 0 + ] + } + ], + "current_fishermen": [], + "next_fishermen": [], + "current_proposals": [ + { + "account_id": "nearkat", + "public_key": "ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB", + "stake": "76000000000000000000000000000" + } + ], + "prev_epoch_kickout": [ + { + "account_id": "figment-betanet", + "reason": { + "NotEnoughBlocks": { + "produced": 0, + "expected": 3025 + } + } + }, + { + "account_id": "illia", + "reason": { + "NotEnoughBlocks": { + "produced": 0, + "expected": 6048 + } + } + } + ] + }, + "id": "dontcare" +} +``` -Finally, to start your node, run: +
-```bash -./scripts/start_stakewars.py +Every entry in the `current_validators` object of the JSON above provides the expected uptime: +``` +"current_validators": [ + { + "account_id": "nearkat", + "public_key": "ed25519:BE8hs6LuFbG5j1C2tLXKUT2NqRLbCxwBCKXqte9qZ1HB", + "is_slashed": false, + "stake": "75932253155495715897593582482", + "shards": [ + 0 + ], + "num_produced_blocks": 106, + "num_expected_blocks": 106 + } + ] ``` -## Stop your node +Be sure that `num_produced_blocks` is the same of `num_expected_blocks`, otherwise your node risks to be kicked out (see "Maintaining the Validator Seat" in the [validator economics docs](https://docs.nearprotocol.com/docs/validator/economics) for more details). + -To stop your node, run: +## Stop your node +First, release your funds, by setting to zero your stake: +```bash +near stake 0 +``` +Wait for two epochs (6 hours) and shut down your node. You may kill the validator process straight away, but it will have an impact on the network performance (less throughput) and other users will not be happy! +To stop your node, simply issue the command: ```bash -./scripts/stop.py +nearup stop ``` diff --git a/VALIDATORS.md b/VALIDATORS.md new file mode 100644 index 0000000..54e84be --- /dev/null +++ b/VALIDATORS.md @@ -0,0 +1,13 @@ +#Stake Wars 2.0 Validators List + +Hello! This is the list of professional validators that joined Stake Wars 2.0 +Fork this repo and submnit a PR adding your validator, or fixing any typo or error in the description. + +| Validator Name | website | Logo | Blurb | Account ID | Fees | Country | +| --- | --- | --- | --- | --- | --- | --- | +| Nearkats | https://near.dev | https://docs.nearprotocol.com/img/icon-core.svg | The unofficial and Betanet-only validator that provides token delegation services. Stake with us! | @nearkat | 0% | US | +| NUC Home Alone | - | - | A small, Intel NUC-based validator node, connected to a residential Interenet connection | @nuc.test | 0% | US | +| Validators.Online | https://validators.online/ | --- | --- | @validatorsonline.test | 1% | MY | +| Wetez | https://wetez.io | http://www.wetez.io/_nuxt/img/72ebb49.png | Wetez is the most professional team in the POS ( Proof of Stake) field. And we provide the most secure and efficient node management service. Stake with us! | @wetez11.test | 0% | CN | + +Note: at this stage, the delegation contract doesn't support validator fees. Therefore the `Fees` column can be safely omitted by now, so we can scope this phase to test the deposit/staking, performance/returns, and unstaking/withdraw. diff --git a/media/stake_tx_explorer.png b/media/stake_tx_explorer.png new file mode 100644 index 0000000..048a617 Binary files /dev/null and b/media/stake_tx_explorer.png differ diff --git a/scenarios.md b/scenarios.md index 7b16563..4fcb99b 100644 --- a/scenarios.md +++ b/scenarios.md @@ -1,24 +1,5 @@ -# Here are some test scenarios you can earn points for - -## This list will expand over time - -Some of these scenarios will require reaching out to request something from us. The best place to do that is Discord. We're going to set the wallet to start accounts at 100k NEAR starting next week. If you have specific things you need aside from that, please let us know for future tests. - -| scenario | point value | -|--------------------------|--------------| -| Time series challenge* | 1000 | -| Run 1 node (per week) | 100 | -| Run 10 nodes | 500 | -| Stake with 100 NEAR | 500 | -| Stake with 100k NEAR | 500 | -| Stake with 500k NEAR | 500 | -| Run in Kubernetes | 500 | -| Run using Windows | 100 | - -### \* Time Series Challenge - -Connect to the network, work for 10 sec, disconnect from the network, wait for 10 sec, repeat. - -Do this for values: 1 sec, 10 sec, and 60 sec. - -This can be probably emulated through some Linux tool that blocks network connections, just have a cron job that blocks network for X seconds, then unblocks it for X sec, repeat. +# Stake Wars 2.0 Test Scenarios +Please note that Stake Wars is not rewarding any node-related test scenarios. Instead, we want you to test the functionalities of the delegation smart contract, by performing the following actions: +- deposit and withdraw tokens +- lock and unlock tokens in the staking +- measure the rewards diff --git a/updates.md b/updates.md index cea7fc2..39e2640 100644 --- a/updates.md +++ b/updates.md @@ -1,20 +1,32 @@ # UPDATES -## UPDATE Dec 13th +## UPDATE Apr 21st -* We're restructuring the program to focus on finding bugs that are based on QA scenarios rather than security breaches and attacks. -* You can find these in `scenarios.md` in this repo. [HERE](./scenarios.md) +* Released [Road to Mainnet](https://near.ai/mainnet-roadmap) +* Released `nearup` to the validator community +* Updated the Stake Wars 2.0 branch on GitHub -## UPDATE Nov 22nd +## UPDATE Apr 14th -* We're using Github to collect genesis for this week. Please don't submit your keys for genesis if you can't make the call. Put in a PR againts accounts.csv with your changes. +* Stake Wars has been redesigned to involve end-users, and test NEAR smart contracts delegation +* The reference network for Stake Wars is now `betanet`. We suggest you to install and run the new node via [nearup](https://github.com/near/nearup) +* To obtain some betanet tokens and become validator, send a request via [this form](https://forms.gle/5KabPsD4BefR6nv68). + +## UPDATE Nov 12th + +* Just update the issue templates. We are now measuring severity internally since the templates were just confusing. +* The simplified submission process is: just follow the template, and we will add label. +* If we add the `help wanted` tag, you can fix it and receive tokens as part of the competition as well ## UPDATE Nov 20th * sudo is no longer needed if you're on Mac, or if you're on linux and can run docker without sudo. -## UPDATE Nov 12th +## UPDATE Nov 22nd -* Just update the issue templates. We are now measuring severity internally since the templates were just confusing. -* The simplified submission process is: just follow the template, and we will add label. -* If we add the `help wanted` tag, you can fix it and receive tokens as part of the competition as well \ No newline at end of file +* We're using Github to collect genesis for this week. Please don't submit your keys for genesis if you can't make the call. Put in a PR againts accounts.csv with your changes. + +## UPDATE Dec 13th + +* We're restructuring the program to focus on finding bugs that are based on QA scenarios rather than security breaches and attacks. +* You can find these in `scenarios.md` in this repo. [HERE](./scenarios.md) \ No newline at end of file