Skip to content

Commit

Permalink
Merge e29e275 into 68c4923
Browse files Browse the repository at this point in the history
  • Loading branch information
FroVolod authored Jul 15, 2021
2 parents 68c4923 + e29e275 commit c588a0b
Show file tree
Hide file tree
Showing 104 changed files with 2,360 additions and 1,906 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,19 @@ jobs:
- name: Build near-cli and all crates
run: ${{ env.CARGO }} build --verbose --all ${{ env.TARGET_FLAGS }}

- name: View contract code for 'volodymyr.testnet'
run: |
./target/debug/near-cli view contract-code network testnet contract 'volodymyr.testnet' hash at-final-block
- name: Run tests (sans cross)
if: matrix.target == ''
run: ${{ env.CARGO }} test --verbose --all

- name: View contract code for 'volodymyr.testnet'
run: |
./target/debug/near-cli view contract-code network testnet contract 'volodymyr.testnet' hash at-final-block
- name: Transfer NEAR Tokens
run: |
./target/debug/near-cli transfer near network testnet sender volodymyr.testnet receiver 21.volodymyr.testnet \
amount 0.001NEAR sign-private-key --signer-public-key ed25519:Ebx7NiwqupsshnUsEZCzgm84SQqi8LZWJx7ermrr14JF \
--signer-secret-key ed25519:2qM8v3nF4opam1frweMmD5h4PM3H6jtxfuAE77rpEuUx2rSGj64AzDf9xPKG76bgAs5L1oecV93etPy6xKjds2YB send
# - name: Run tests without PCRE2 (with cross)
# # These tests should actually work, but they almost double the runtime.
# # Every integration test spins up qemu to run 'rg', and when PCRE2 is
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Get the release version from the tag
# if: env.NEAR_CLI_VERSION == ''
run: |
echo "NEAR_CLI_VERSION=0.1.7" >> $GITHUB_ENV
echo "NEAR_CLI_VERSION=0.1.8" >> $GITHUB_ENV
echo "version is: ${{ env.NEAR_CLI_VERSION }}"
- name: Create GitHub release
Expand Down
195 changes: 86 additions & 109 deletions docs/GUIDE.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ Before proceeding to the description of specific commands, it is necessary to co

Information for this parameter should be found [here](https://explorer.testnet.near.org/blocks) or will need to be obtained using [View recent block hash](#view-recent-block-hash).

<details><summary><i>recent block hash</i></summary>
<img src="media/blocks.png" width="836"/>
<img src="media/block_hash.png" width="836"/>
</details>
<details><summary><i>recent block hash</i></summary>
<img src="media/blocks.png" width="836"/>
<img src="media/block_hash.png" width="836"/>
</details>

<details><summary><i>Demonstration of the _Offline_ mode</i></summary>
<a href="https://asciinema.org/a/REcIXg1yQqLpz42EzNQt8B99f?autoplay=1&t=1&speed=2">
<img src="https://asciinema.org/a/REcIXg1yQqLpz42EzNQt8B99f.png" width="836"/>
</a>
</details>
<details><summary><i>Demonstration of the _Offline_ mode</i></summary>
<a href="https://asciinema.org/a/REcIXg1yQqLpz42EzNQt8B99f?autoplay=1&t=1&speed=2">
<img src="https://asciinema.org/a/REcIXg1yQqLpz42EzNQt8B99f.png" width="836"/>
</a>
</details>

2. Sign transaction

Expand All @@ -45,8 +45,21 @@ Before proceeding to the description of specific commands, it is necessary to co

* _I want to sign the transaction with keychain_

If you select this signature option, _near-cli_ will find the access keys itself in the *username.json* file located in */Users/user/.near-credentials/default/*.
For example, */Users/frovolod/.near-credentials/default/volodymyr.testnet.json*.
Depending on the selected network mode, _Online_ / _Offline_ near-cli will independently find access keys and sign the created transaction.
For _Offline_ mode, the access keys must be in the *username.json* file located in */Users/user/.near-credentials/default/*.
For example, */Users/frovolod/.near-credentials/default/volodymyr.testnet.json*.
For _Online_ mode, the access keys must be in the *public_key.json* file located in */Users/user/.near-credentials/network_name/user_name/*.
For example, */Users/frovolod/.near-credentials/testnet/volodymyr.testnet/ed25519_8h7kFK4quSUJRkUwo3LLiK83sraEm2jnQTECuZhWu8HC.json*

* _I want to sign the transaction with Ledger device_

This option involves signing the created transaction using a ledger.

<details><summary><i>Demonstration of the command in interactive mode</i></summary>
<a href="https://asciinema.org/a/7WyNHxSCKY1v6uOa5INPvXW9x?autoplay=1&t=1&speed=2">
<img src="https://asciinema.org/a/7WyNHxSCKY1v6uOa5INPvXW9x.png" width="836"/>
</a>
</details>

* _I want to construct the transaction and sign it somewhere else_

Expand Down Expand Up @@ -407,19 +420,12 @@ In order to execute this command, in the terminal command line type:
<details><summary><i>The result of this command will be as follows:</i></summary>

```txt
--- Transaction sent ---
--- Transaction execution: ---
Transaction sent ...
Successful transaction
<volodymyr.testnet> has transferred 1.000 NEAR to <21.volodymyr.testnet> successfully.
Transaction Id 3Xw8R58BTmoRrJufpy5utej8MzNuA11Zw6pnS8vUcCNG.
Transaction ID: EiRJ7JCCX7qi9wc9KETnco2n81afU1xbsjyJCuH5SWcX.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.wallet.testnet.near.org/3Xw8R58BTmoRrJufpy5utej8MzNuA11Zw6pnS8vUcCNG
https://explorer.testnet.near.org/transactions/EiRJ7JCCX7qi9wc9KETnco2n81afU1xbsjyJCuH5SWcX
```
</details>

Expand Down Expand Up @@ -450,19 +456,12 @@ In order to execute this command, in the terminal command line type:
<details><summary><i>The result of this command will be as follows:</i></summary>

```txt
--- Transaction sent ---
--- Transaction execution: ---
Transaction sent ...
Successful transaction
The "distribute_staking" call to <meta.pool.testnet> on behalf of <volodymyr.testnet> succeeded.
Transaction Id CK4ZT2NfJhqfQAjVsvoTuyJs74SY4DQfgwKC79tZGEfw.
Transaction ID: 7TpFFVBs9CXYoRpRtZqMuLAWnGbgx3qyRy9jhawv8HqX.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.wallet.testnet.near.org/CK4ZT2NfJhqfQAjVsvoTuyJs74SY4DQfgwKC79tZGEfw
https://explorer.testnet.near.org/transactions/7TpFFVBs9CXYoRpRtZqMuLAWnGbgx3qyRy9jhawv8HqX
```
</details>

Expand Down Expand Up @@ -532,7 +531,7 @@ In order to execute this command, in the terminal command line type:
./near-cli add access-key \
network testnet \
account 'volodymyr.testnet' \
public-key 'ed25519:Ebx7...' \
public-key 'ed25519:61WaaKFEXTvhk35xmyScVE9yHc5DareBvomLYbCYteb' \
grant-full-access \
sign-with-keychain \
send
Expand All @@ -541,18 +540,12 @@ In order to execute this command, in the terminal command line type:
<details><summary><i>The result of this command will be as follows:</i></summary>

```txt
--- Transaction sent ---
--- Transaction execution: ---
Added full access key = ed25519:2Xh8n53G5YCjEj6eangH6PZjf2YdfogxikMV6q6MxFRH to volodymyr.testnet.
Transaction Id Am9bmTSaaG1SoDU2m1MyXz3cbU4uY2XxghxeHGkeBX4x.
Transaction sent ...
Successful transaction
Added access key = ed25519:61WaaKFEXTvhk35xmyScVE9yHc5DareBvomLYbCYteb to volodymyr.testnet.
Transaction ID: 59LEJEQT7jVMXdVi3ab4y8nbQ7uFJ8wRny9tD3qkv5Ez.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.wallet.testnet.near.org/Am9bmTSaaG1SoDU2m1MyXz3cbU4uY2XxghxeHGkeBX4x
https://explorer.testnet.near.org/transactions/59LEJEQT7jVMXdVi3ab4y8nbQ7uFJ8wRny9tD3qkv5Ez
```
</details>

Expand Down Expand Up @@ -587,18 +580,12 @@ In order to execute this command, in the terminal command line type:
<details><summary><i>The result of this command will be as follows:</i></summary>

```txt
--- Transaction sent ---
--- Transaction execution: ---
Added function access key = ed25519:ECPLXJyLv3emQ9g76fxUHM98hP5MkXD5mcyRe6KiqGK2 to 21.volodymyr.testnet.
Transaction Id PTab8ENhtLJfNqsUwVpiPw3sLPySwpzJuSNX9yEHhLD.
Transaction sent ...
Successful transaction
Added access key = ed25519:H8pzJt6RHCtVL7THc2AW5KwTXUtVhDCRocHqapfH5L47 to 21.volodymyr.testnet.
Transaction ID: 92y4UzovU4vgfKRVBmLR15M6mYPGp1y2za6HKXXsjF1H.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.testnet.near.org/transactions/PTab8ENhtLJfNqsUwVpiPw3sLPySwpzJuSNX9yEHhLD
https://explorer.testnet.near.org/transactions/92y4UzovU4vgfKRVBmLR15M6mYPGp1y2za6HKXXsjF1H
```
</details>

Expand All @@ -625,9 +612,15 @@ In order to add a new contract, in the terminal command line type:

<details><summary><i>The result of this command will be as follows:</i></summary>

<a href="https://asciinema.org/a/DOOZ2yQfUUzuRUY1S3LaktHRm?autoplay=1&t=1&speed=2">
<img src="https://asciinema.org/a/DOOZ2yQfUUzuRUY1S3LaktHRm.png" width="836"/>
</a>
```txt
Transaction sent ...
Successful transaction
Contract code has been successfully deployed.
The "increment" call to <volodymyr.testnet> on behalf of <volodymyr.testnet> succeeded.
Transaction ID: AhJ2fRAu6ocn3RDaKaCtofzfhr5C1z4wXEZDbrhewm4.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.testnet.near.org/transactions/AhJ2fRAu6ocn3RDaKaCtofzfhr5C1z4wXEZDbrhewm4
```
</details>

<details><summary><i>Demonstration of the command in interactive mode</i></summary>
Expand Down Expand Up @@ -674,19 +667,13 @@ You can place a state using this command:
<details><summary><i>The result of this command will be as follows:</i></summary>

```txt
--- Transaction sent ---
--- Transaction execution: ---
Transaction sent ...
Failed transaction
Error: Insufficient stake 100.000 NEAR.
The minimum rate must be 28626.505 NEAR.
Transaction Id 92TdRcwGXyVCgMniE1aX8kWTzBB58s9Y5i8dHAnh74Y8.
The minimum rate must be 31097.761 NEAR.
Transaction ID: 8m2NphgJfvY4u4kWt7ntaZmXt6CrqXuq44VVZoDMUATo.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.wallet.testnet.near.org/92TdRcwGXyVCgMniE1aX8kWTzBB58s9Y5i8dHAnh74Y8
https://explorer.testnet.near.org/transactions/8m2NphgJfvY4u4kWt7ntaZmXt6CrqXuq44VVZoDMUATo
```
</details>

Expand All @@ -703,7 +690,7 @@ In order to create a sub-account, in the terminal command line type:
./near-cli add sub-account \
network testnet \
owner-account 'volodymyr.testnet' \
sub-account '22.volodymyr.testnet' \
sub-account '282.volodymyr.testnet' \
sub-account-full-access \
generate-keypair \
deposit '1 NEAR' \
Expand All @@ -714,19 +701,14 @@ In order to create a sub-account, in the terminal command line type:
<details><summary><i>The result of this command will be as follows:</i></summary>

```txt
--- Transaction sent ---
--- Transaction execution: ---
New account <22.volodymyr.testnet> has been successfully created.
Transaction Id He1D8DoYEkazhVw5PJ4TxNgafmsqj7Yb72YQebM3a98p.
Transaction sent ...
Successful transaction
New account <282.volodymyr.testnet> has been successfully created.
Added access key = ed25519:512RGPTghPXSNziZRUi9K7UzMHiAwEetL5FpmZw6zdHd to 282.volodymyr.testnet.
<volodymyr.testnet> has transferred 1.000 NEAR to <282.volodymyr.testnet> successfully.
Transaction ID: 24a5rxkH4gLus4YBqm47JRNygbZEKLgiJVCZFx3Hcjqp.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.wallet.testnet.near.org/He1D8DoYEkazhVw5PJ4TxNgafmsqj7Yb72YQebM3a98p
https://explorer.testnet.near.org/transactions/24a5rxkH4gLus4YBqm47JRNygbZEKLgiJVCZFx3Hcjqp
```
</details>

Expand All @@ -746,27 +728,20 @@ In order to remove access keys, in the terminal command line type:
./near-cli delete access-key \
network testnet \
account 'volodymyr.testnet' \
public-key 'ed25519:HaUQJkxYtTXrJVLNHEtHPmvLJ1fuUczwocm53Xn5eFJy' \
public-key 'ed25519:Ekgny2BNdwaoRuNW2JBkSv6FGDjmrd5iP8noXE4dTUk2' \
sign-with-keychain \
send
```

<details><summary><i>The result of this command will be as follows:</i></summary>

```txt
--- Transaction sent ---
--- Transaction execution: ---
Access key <ed25519:HaUQJkxYtTXrJVLNHEtHPmvLJ1fuUczwocm53Xn5eFJy> for account <volodymyr.testnet> has been successfully deletted.
Transaction Id 6Du4cGn1go9EQdrsRzD6D2az4jGGQUW9361cLG1GVxNp.
Transaction sent ...
Successful transaction
Access key <ed25519:Ekgny2BNdwaoRuNW2JBkSv6FGDjmrd5iP8noXE4dTUk2> for account <volodymyr.testnet> has been successfully deletted.
Transaction ID: 9xeBgqpRButrSGZNUGcYbsxs2JM3A9NoH7Bkh6op4K8D.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.wallet.testnet.near.org/6Du4cGn1go9EQdrsRzD6D2az4jGGQUW9361cLG1GVxNp
https://explorer.testnet.near.org/transactions/9xeBgqpRButrSGZNUGcYbsxs2JM3A9NoH7Bkh6op4K8D
```
</details>

Expand All @@ -783,7 +758,7 @@ In order to execute this command, in the terminal command line type:
```txt
./near-cli delete account \
network testnet \
account '21.volodymyr.testnet' \
account '282.volodymyr.testnet' \
beneficiary 'volodymyr.testnet' \
sign-with-keychain \
send
Expand All @@ -792,19 +767,12 @@ In order to execute this command, in the terminal command line type:
<details><summary><i>The result of this command will be as follows:</i></summary>

```txt
--- Transaction sent ---
--- Transaction execution: ---
Account <22.volodymyr.testnet> has been successfully deletted.
Transaction Id EhhLMtUEmLHV4bzdvSmzv9pLyUbKChGgtWKhuPRXx2w5.
Transaction sent ...
Successful transaction
Account <282.volodymyr.testnet> has been successfully deletted.
Transaction ID: CfRvfMvEY7vtKM2ub18nKsMivNo95wUC5VYYQ64gcPm.
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.wallet.testnet.near.org/EhhLMtUEmLHV4bzdvSmzv9pLyUbKChGgtWKhuPRXx2w5
https://explorer.testnet.near.org/transactions/CfRvfMvEY7vtKM2ub18nKsMivNo95wUC5VYYQ64gcPm
```
</details>

Expand Down Expand Up @@ -850,6 +818,15 @@ This utility allows you to sign a previously formed and unsigned transaction wit
</a>
</details>

#### Sign a transaction with Ledger

This utility allows you to sign a previously formed and unsigned transaction using a ledger. It is assumed that the ledger is connected to the computer, unlocked and running the _NEAR_ application.
<details><summary><i>Demonstration of the command in interactive mode</i></summary>
<a href="https://asciinema.org/a/G96fR2Ap9qdImtn2ITUJL82RR?autoplay=1&t=1&speed=2">
<img src="https://asciinema.org/a/G96fR2Ap9qdImtn2ITUJL82RR.png" width="836"/>
</a>
</details>

#### Combine unsigned transaction with signature

This utility allows you to sign a previously generated and unsigned transaction with your signature.
Expand Down
Loading

0 comments on commit c588a0b

Please sign in to comment.