Skip to content

Commit

Permalink
Crowdin Machine Translation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcss committed Sep 24, 2024
1 parent bb5e5b5 commit 4aad675
Show file tree
Hide file tree
Showing 93 changed files with 8,309 additions and 165 deletions.
13 changes: 13 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
project_id: 683600
api_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
preserve_hierarchy: true
files:
# JSON translation files
- source: /i18n/en/**/*
translation: /i18n/%two_letters_code%/**/%original_file_name%
# Docs Markdown files
- source: /docs/**/*
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/current/**/%original_file_name%
# Blog Markdown files
- source: /changelog/**/*
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-blog-changelog/**/%original_file_name%
10 changes: 6 additions & 4 deletions docs/01-concepts/powpeg/hsm-firmware-attestation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ To verify the Powpeg nodes, follow the HSM firmware attestation process using th

### Frequently Asked Questions

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="1">
<Accordion.Header as="h3">What is the multisig scheme for the powHSM? It is a M of N multisig.
<Accordion.Header as="h3">What is the multisig scheme for the powHSM? It is a M of N multisig.
What is M and what is N?</Accordion.Header>
<Accordion.Body>
> - A: The best way to get this information is by querying the Bridge directly, since the number of members of the PowPeg may change after a PowPeg composition change.
> - You can use the following methods to query the bridge: `getFederationSize`, `getFederationThreshold`.
> - A: The best way to get this information is by querying the Bridge directly, since the number of members of the PowPeg may change after a PowPeg composition change.
> - You can use the following methods to query the bridge: `getFederationSize`, `getFederationThreshold`.
> - By consensus the required amount of signers (M) will always be half plus one the total amount of pegnatories `M = N / 2 + 1`. See the signatories and attestation information in [PowPeg HSM Firmware Attestation](#powpeg-hsm-firmware-attestation---sovryn).
</Accordion.Body>
</Accordion.Item>
</Accordion>
</Accordion>
````
2 changes: 2 additions & 0 deletions docs/01-concepts/rbtc/conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Watch this explainer video on **How to do BTC & R-BTC Conversions using the Root

### FAQs

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="0">
<Accordion.Header as="h3">How often does the Rootstock Federation address change?</Accordion.Header>
Expand All @@ -67,6 +68,7 @@ Watch this explainer video on **How to do BTC & R-BTC Conversions using the Root
</Accordion.Body>
</Accordion.Item>
</Accordion>
````

### Feedback

Expand Down
8 changes: 8 additions & 0 deletions docs/01-concepts/rbtc/networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The minimum amount of Bitcoin to convert is **0.005 BTC** for Mainnet.

Instructions on how to do a Mainnet peg-in.

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="0">
<Accordion.Header as="h3">1. Get a BTC address with balance</Accordion.Header>
Expand Down Expand Up @@ -69,11 +70,13 @@ Instructions on how to do a Mainnet peg-in.
</Accordion.Body>
</Accordion.Item>
</Accordion>
````

### RBTC to BTC conversion

Instructions on how to do a Mainnet peg-out.

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="0">
<Accordion.Header as="h3">1. Get BTC address with RBTC private key</Accordion.Header>
Expand All @@ -97,6 +100,7 @@ Instructions on how to do a Mainnet peg-out.
</Accordion.Body>
</Accordion.Item>
</Accordion>
````

## Testnet Conversion

Expand All @@ -110,6 +114,7 @@ The minimum amount of Bitcoin to convert is **0.005 tBTC** for Testnet.

Instructions on how to do a Testnet peg-in.

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="0">
<Accordion.Header as="h3">1. Connect a wallet to Bitcoin Testnet</Accordion.Header>
Expand Down Expand Up @@ -164,6 +169,7 @@ Instructions on how to do a Testnet peg-in.
</Accordion.Body>
</Accordion.Item>
</Accordion>
````

### tRBTC to tBTC conversion

Expand All @@ -173,6 +179,7 @@ Instructions on how to do a Testnet peg-out.
The release process on Bitcoin network takes 10 Rootstock block confirmations and at least 10 more minutes.
:::

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="0">
<Accordion.Header as="h3">1. Get tBTC address with tRBTC private key</Accordion.Header>
Expand All @@ -198,3 +205,4 @@ The release process on Bitcoin network takes 10 Rootstock block confirmations an
</Accordion.Body>
</Accordion.Item>
</Accordion>
````
16 changes: 10 additions & 6 deletions docs/02-developers/02-requirements/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ See how to setup the RPC API and get an [API Key](/developers/rpc-api/setup).

## Network Configuration

Fill these values to connect to the Rootstock Mainnet or Testnet.
Fill these values to connect to the Rootstock Mainnet or Testnet.

<table class="table">
<thead>
Expand Down Expand Up @@ -100,6 +100,7 @@ npm i -g hardhat-shorthand

### POSIX Compliant Shell

````mdx-code-block
<Tabs>
<TabItem value="windows" label="Windows">
Standard terminals like `cmd` or PowerShell may not support some commands. We recommended installing [Git for Windows](https://gitforwindows.org/) for Git Bash, which provides a more UNIX-like experience. Here's a [tutorial on Git Bash](https://www.atlassian.com/git/tutorials/git-bash).
Expand All @@ -108,26 +109,28 @@ npm i -g hardhat-shorthand
Standard terminal.
</TabItem>
</Tabs>
````

### Installing Node.js and NPM

````mdx-code-block
<Tabs>
<TabItem value="nvm" label="NVM" default>
- Node v18 or later.
- Node v18 or later.
- For installation, use [NVM install script](https://github.com/nvm-sh/nvm#install--update-script).
</TabItem>
<TabItem value="windows" label="Windows">
1. Download the Node.js Installer from [Node.js Downloads](https://nodejs.org/en/download).
2. Run the installer and follow the on-screen instructions.
3. Open Command Prompt or PowerShell and check versions with `node -v` and `npm -v`.
3. Open Command Prompt or PowerShell and check versions with `node -v` and `npm -v`.
- See Posix Compliant Shell.
</TabItem>
<TabItem value="macos" label="MacOS">
1. Install Homebrew (if not installed):
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
```
2. Install Node.js and npm with `brew install node`
```
2. Install Node.js and npm with `brew install node`
3. Check versions in Terminal with `node -v` and `npm -v`
</TabItem>
<TabItem value="linux" label="Linux">
Expand All @@ -137,8 +140,9 @@ npm i -g hardhat-shorthand
4. Check versions in the terminal with `node -v` and `npm -v`
</TabItem>
</Tabs>
````

## Optional Setup

- [Foundry](/developers/smart-contracts/foundry)
- [Remix](https://remix.ethereum.org/)
- [Remix](https://remix.ethereum.org/)
2 changes: 2 additions & 0 deletions docs/02-developers/04-quickstart/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tags: [rsk, rootstock, beginner, quick starts, developers, advanced, port to roo
description: "Quick starts, demos and starter kits to develop on Rootstock."
---

````mdx-code-block
<Filter
values={[
{label: 'Beginner', value: 'beginner'},
Expand Down Expand Up @@ -89,3 +90,4 @@ values={[
description="Learn how to port an Ethereum dApp to Rootstock."
/>
</Filter>
````
24 changes: 13 additions & 11 deletions docs/02-developers/04-quickstart/web3-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See tutorial on how to [interact with Rootstock using Rust](/resources/tutorials

## Prerequisites

- A testnet account with tRBTC funds.
- A testnet account with tRBTC funds.
- [Get tRBTC](https://faucet.rootstock.io/).
- An API KEY from the [Rootstock RPC Service](https://rpc.rootstock.io/).
- Set up the project
Expand Down Expand Up @@ -70,7 +70,7 @@ add the following variables to the file:
Replace `YOUR_APIKEY` with the API key from your dashboard.

```bash
# get this YOUR_APIKEY from the Rootstock RPC Service.
# get this YOUR_APIKEY from the Rootstock RPC Service.
RPC_PROVIDER_APIKEY = '{YOUR_APIKEY}'

# this is the private key of the account from which you will deploy the contract
Expand All @@ -82,7 +82,7 @@ ACCOUNT_PRIVATE_KEY = '{YOUR_PRIVATE_KEY}'

### Write the smart contract

The contract to be compiled and deployed in the next section is a simple contract that stores a message, and will allow for setting different messages by sending a transaction.
The contract to be compiled and deployed in the next section is a simple contract that stores a message, and will allow for setting different messages by sending a transaction.

You can get started by creating a file for the contract:

Expand Down Expand Up @@ -189,7 +189,7 @@ account_from = {
```

4. Create a contract instance using the `web3.eth.contract` function and passing in the ABI and bytecode of the contract
5. Set the [gas price strategy](https://web3py.readthedocs.io/en/stable/gas_price.html#gas-price) using the `web3.eth.set_gas_price_strategy` function, which will allow us to fetch the gasPrice from the RPC Provider. This is important because otherwise the Web3 library will attempt to use `eth_maxPriorityFeePerGas` and `eth_feeHistory` RPC methods, which are only supported by post-London Ethereum nodes.
5. Set the [gas price strategy](https://web3py.readthedocs.io/en/stable/gas_price.html#gas-price) using the `web3.eth.set_gas_price_strategy` function, which will allow us to fetch the gasPrice from the RPC Provider. This is important because otherwise the Web3 library will attempt to use `eth_maxPriorityFeePerGas` and `eth_feeHistory` RPC methods, which are only supported by post-London Ethereum nodes.
6. Build a constructor transaction using the contract instance. You will then use the `build_transaction` function to pass in the transaction information including the `from` address and the `nonce` for the sender. To get the `nonce` you can use the `web3.eth.get_transaction_count` function
7. Sign the transaction using the `web3.eth.account.sign_transaction` function and pass in the constructor transaction and the `private_key` of the sender
8. Using the signed transaction, you can then send it using the `web3.eth.send_raw_transaction` function and wait for the transaction receipt by using the `web3.eth.wait_for_transaction_receipt` function
Expand Down Expand Up @@ -317,7 +317,7 @@ python getMessage.py

### Write data to the contract (Write Methods)

Write methods are the type of interaction that modify the contract's storage (change variables), meaning a transaction needs to be signed and sent. In this section, you'll create the script to change the text stored in the Greeter contract.
Write methods are the type of interaction that modify the contract's storage (change variables), meaning a transaction needs to be signed and sent. In this section, you'll create the script to change the text stored in the Greeter contract.

To get started, you can create a file for the script and name it `setMessage.py`:

Expand All @@ -331,7 +331,7 @@ Open the `setMessage.py` file and take the following steps to create the script:
2. Set up the Web3 provider
3. Define the `account_from` variable, including the `private_key`, and the `contract_address` of the deployed contract. The private key is required to sign the transaction. Note: This is for example purposes only. Never store your private keys in your code
4. Create a contract instance using the `web3.eth.contract` function and passing in the ABI and address of the deployed contract
5. Set the gas price strategy using the `web3.eth.set_gas_price_strategy` function, which will allow us to fetch the gasPrice from the RPC Provider. This is important because otherwise the Web3 library will attempt to use `eth_maxPriorityFeePerGas` and `eth_feeHistory` RPC methods, which are only supported by post-London Ethereum nodes.
5. Set the gas price strategy using the `web3.eth.set_gas_price_strategy` function, which will allow us to fetch the gasPrice from the RPC Provider. This is important because otherwise the Web3 library will attempt to use `eth_maxPriorityFeePerGas` and `eth_feeHistory` RPC methods, which are only supported by post-London Ethereum nodes.
6. Build the `setGreeting` transaction using the contract instance and passing in the new message. You'll then use the `build_transaction` function to pass in the transaction information including the `from` address and the `nonce` for the sender. To get the `nonce` you can use the `web3.eth.get_transaction_count` function
7. Sign the transaction using the `web3.eth.account.sign_transaction` function and pass in the `setGreeting` transaction and the `private_key` of the sender
8. Using the signed transaction, you can then send it using the `web3.eth.send_raw_transaction` function and wait for the transaction receipt by using the `web3.eth.wait_for_transaction_receipt` function
Expand Down Expand Up @@ -386,7 +386,7 @@ txn_receipt = web3.eth.wait_for_transaction_receipt(txn_hash)
print(f"Transaction successful with hash: { txn_receipt.transactionHash.hex() }")
```

If successful, the transaction hash will be displayed in the terminal.
If successful, the transaction hash will be displayed in the terminal.

```python
python setMessage.py
Expand Down Expand Up @@ -538,10 +538,11 @@ Transaction successful with hash: 0x79ab8be672b0218d31f81876c34321ee7b08e6a4ec8b

## Summary

In this guide, we learnt how to use the Web3.py library to deploy, interact with a smart contract and send transactions on Rootstock.
In this guide, we learnt how to use the Web3.py library to deploy, interact with a smart contract and send transactions on Rootstock.

## Troubleshooting

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="0">
<Accordion.Header as="h3">1. Error message: eth_sendTransaction method does not exist</Accordion.Header>
Expand All @@ -550,8 +551,8 @@ In this guide, we learnt how to use the Web3.py library to deploy, interact with
```bash
web3.exceptions.MethodUnavailable: {'code': -32601, 'message': 'The method eth_sendTransaction does not exist/is not available. See available methods at https://dev.rootstock.io/developers/rpc-api/methods'}
```
- Note: The cause of the error on the deployment is that the Web3.py module is set to use the private keys of the RPC provider (Hosted Keys), which is a legacy way to use accounts, and is not supported by modern RPC providers, as they do not store private keys.
- Methods like `web3.eth.send_transaction` do not work with RPC providers, because they rely on a node state and all modern nodes are stateless, which underneath make JSON-RPC calls to methods like `eth_accounts` and `eth_sendTransaction`. You must always use local private keys when working with nodes hosted by someone else.
- Note: The cause of the error on the deployment is that the Web3.py module is set to use the private keys of the RPC provider (Hosted Keys), which is a legacy way to use accounts, and is not supported by modern RPC providers, as they do not store private keys.
- Methods like `web3.eth.send_transaction` do not work with RPC providers, because they rely on a node state and all modern nodes are stateless, which underneath make JSON-RPC calls to methods like `eth_accounts` and `eth_sendTransaction`. You must always use local private keys when working with nodes hosted by someone else.
- If unfamiliar, note that you can [export your private keys from Metamask](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key) and other wallets. Remember to never share your private keys, and do not put it on your code or repository.
- In order to successfully deploy the contract, the developer needs to set up Web3.py to use his Local Private Keys, and to build and pre-sign the transaction before sending it, so the module uses `eth_sendRawTransaction` instead.
- To allow Web3.py to use the local keys, we have to use the Signing middleware to add the Private Key to the signing keychain.
Expand Down Expand Up @@ -612,6 +613,7 @@ In this guide, we learnt how to use the Web3.py library to deploy, interact with
</Accordion.Body>
</Accordion.Item>
</Accordion>
````

#### Resources
- [Web3.py: Gas Price Strategy](https://web3py.readthedocs.io/en/stable/gas_price.html#gas-price)
Expand All @@ -620,4 +622,4 @@ In this guide, we learnt how to use the Web3.py library to deploy, interact with
- [Web3.py: Working with Local Private Keys](https://web3py.readthedocs.io/en/stable/web3.eth.account.html#working-with-local-private-keys)
- [Web3.py: Contract Deployment Example](https://web3py.readthedocs.io/en/stable/web3.contract.html)
- [Web3.py: Sign a Contract Transaction](https://web3py.readthedocs.io/en/stable/providers.html)
- [Web3.py: Setting up an RPC Provider](https://web3py.readthedocs.io/en/stable/providers.html)
- [Web3.py: Setting up an RPC Provider](https://web3py.readthedocs.io/en/stable/providers.html)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Creating a user-friendly web interface for smart contracts on the Rootstock netw
## Project Setup

1. Create a new folder called `frontend` and navigate to the directory:

```shell
mkdir frontend
cd frontend
Expand Down Expand Up @@ -323,12 +323,13 @@ Navigate to the URL: `http://127.0.0.1:8080` to test the code in the browser and

These tools are specifically tailored for Web3 development, and they can simplify the integration of blockchain functionaity into web interfaces. Here are a few recommended tools and libraries that are popular in the Web3 space, along with brief descriptions:

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="0">
<Accordion.Header as="h3">1. RainbowKit</Accordion.Header>
<Accordion.Body>
- [RainbowKit](https://www.rainbowkit.com/) is a React library offering a comprehensive wallet connection solution. It provides a beautiful, easy-to-use wallet connection interface that supports multiple wallets and networks.
- **Why Use It:**
- **Why Use It:**
It is great for projects where you want a seamless and user-friendly wallet connection experience. It's easy to integrate and manage, especially in React-based applications.
</Accordion.Body>
</Accordion.Item>
Expand Down Expand Up @@ -359,4 +360,5 @@ These tools are specifically tailored for Web3 development, and they can simplif
- [Foundry](https://book.getfoundry.sh) is a smart contract development toolchain, and user-friendly development environment used for writing and advanced smart contracts testing in Solidity.
</Accordion.Body>
</Accordion.Item>
</Accordion>
</Accordion>
````
8 changes: 5 additions & 3 deletions docs/02-developers/06-integrate/01-rif-relay/sample-dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ To learn more about Metatmask and how to add it to Rootstock programmatically, s

To set up RIF relay contract, clone the RIF Relay Contracts Repository: https://github.com/rsksmart/rif-relay-contracts, then follow the [RIF Relay Deployment](/developers/integrate/rif-relay/deployment/) guide to deploy an RIF Relay contract, enable revenue sharing, and whitelist the token by allowing it.

````mdx-code-block
<Accordion>
<Accordion.Item eventKey="0">
<Accordion.Header as="h3">Check allowed tokens</Accordion.Header>
Expand Down Expand Up @@ -68,13 +69,14 @@ To set up RIF relay contract, clone the RIF Relay Contracts Repository: https://
--token-address 0x6f217dEd6c86A57f1211F464302e6fA544045B4f \
--amount 10000000000000000000 \
--receiver <wallet-address> \
--network regtest
--network regtest
```
- Import the minted token into the wallet.
- To see the token in the wallet, click on “import tokens”, and then paste the token address.
</Accordion.Body>
</Accordion.Item>
</Accordion>
````

### Step 4: Set up RIF Relay Server

Expand All @@ -97,7 +99,7 @@ This sample dApp shows you how to send transactions to the Rootstock blockchain
- Configure environment variables

Create a new file named `.env` in the top directory, and add the following lines in it (with the contract addresses generated when we deployed the contracts) in the **Set up RIF Relay Contracts** section above:

```bash
REACT_APP_CONTRACTS_RELAY_HUB=0x463F29B11503e198f6EbeC9903b4e5AaEddf6D29
REACT_APP_CONTRACTS_DEPLOY_VERIFIER=0x14f6504A7ca4e574868cf8b49e85187d3Da9FA70
Expand Down Expand Up @@ -135,4 +137,4 @@ Create a new file named `.env` in the top directory, and add the following line
- For commands to mint token, See step 6 in the Set up RIF Relay contracts section above.
![Mint Tokens](/img/rif-relay/starter-kit/mint-tokens.png)
- Transfer to different addresses, using TKN for transfer fees payment, instead of RBTC
![Transfer using TKN](/img/rif-relay/starter-kit/transfer-using-tkn.png)
![Transfer using TKN](/img/rif-relay/starter-kit/transfer-using-tkn.png)
Loading

0 comments on commit 4aad675

Please sign in to comment.