Skip to content

Commit

Permalink
Update docs with latest changes (Zondax#226)
Browse files Browse the repository at this point in the history
* feat: update deploy-it section to hyperspace
* feat: update actor definition with latest changes
* fix: update reference on use-it section
  • Loading branch information
emmanuelm41 authored and longfeiWan9 committed Mar 7, 2023
1 parent e6013b6 commit a6d0f2f
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: "Account Actor"
sidebar_position: 1
---

# Account Actor

The account actor is responsible for user account. If you want to call these methods in your smart contracts, you need to specify method number of that method you want to invoke. Please refer the each method for its method number.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: "DataCap Actor"
sidebar_position: 2
---

# DataCap Actor

DataCap Actor is responsible for DataCap token management.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: "Storage Market Actor"
sidebar_position: 3
---

# Storage Market Actor

Storage market actor is responsible for managing storage and retrieval deals.
Expand All @@ -7,7 +12,7 @@ The ActorCode for storage market actor is `hex"0005"` which will be used to call
### AddBalance

```go
func AddBalance(address Address) EmptyValue {}
func AddBalance(address Address, uint256 value) EmptyValue {}
```

Deposit the received FIL token, which is received along with this message, into the balance held in escrow address of the provider or client address.
Expand All @@ -17,6 +22,7 @@ Deposit the received FIL token, which is received along with this message, into
**Params**:

+ `bytes` Address - the address of provider or client.
+ `uint256` value - the amount of FIL token you want to deposit into the balance

**Results**:

Expand Down
7 changes: 6 additions & 1 deletion docs/api/definitions/Miner.md → docs/api/actors/Miner.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Miner built-in actor
---
title: "Miner Actor"
sidebar_position: 4
---

# Miner Actor

The miner built-in actor responsible to deal with storage mining operations and collect proof.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: "Multisig Actor"
sidebar_position: 5
---

# Multisig Actor

Multisig built-in actor is responsible for dealing with operations involving the Filecoin wallet.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: "Storage Power Actor"
sidebar_position: 6
---

# Storage Power Actor

Strorage power actor is responsible for keeping track of the storage power allocated at each storage miner.
Expand All @@ -7,7 +12,7 @@ The ActorCode for storage power built-in actor is `hex"0004"` which will be used
### CreateMiner

```go
func CreateMiner(params CreateMinerParams) CreateMinerReturn {}
func CreateMiner(params CreateMinerParams, uint256 value) CreateMinerReturn {}
```

Create a new miner for the owner address and worker address.
Expand All @@ -22,6 +27,7 @@ Create a new miner for the owner address and worker address.
+ `RegisteredPoStProof` WindowPoStProofType - the type of RegisteredPoStProof.
+ `bytes` Peer - peerID.
+ `bytes[]` Multiaddrs - the multi-address which is used to control new created miner.
+ `uint256` value - the amount of token the new miner will receive

**Results**:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: "Verified Registry Actor"
sidebar_position: 7
---

# Verified Registry Actor

Verified registry actor is responsible for managing verified clients.
Expand Down
4 changes: 4 additions & 0 deletions docs/api/actors/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Actors",
"position": 2
}
8 changes: 4 additions & 4 deletions docs/api/use-it.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: How to use it on my project?
sidebar_position: 2
sidebar_position: 3
---

In order to use these APIs in your project, you will need to import them on your own contract.
Expand Down Expand Up @@ -31,8 +31,8 @@ In your smart contract, copy and paste these lines.
```solidity
import { MarketAPI } from "@zondax/filecoin-solidity/contracts/v0.8/MarketAPI.sol";
import { CommonTypes } from "@zondax/filecoin-solidity/contracts/v0.8/types/CommonTypes.sol";
import { MarketTypes } from "@zondax/filecoin-solidity/contracts/v0.8/types/MarketAPI.sol";
import { BigInt } from "@zondax/filecoin-solidity/contracts/v0.8/cbor/BigNumberCbor.sol";
import { MarketTypes } from "@zondax/filecoin-solidity/contracts/v0.8/types/MarketTypes.sol";
import { BigInt } from "@zondax/filecoin-solidity/contracts/v0.8/cbor/BigIntCbor.sol";
```

### Do a call to a particular method
Expand Down Expand Up @@ -73,7 +73,7 @@ Finally, if you need to use it to interact with the APIs, you can convert it to

```solidity
import { BigNumbers, BigNumber } from "@zondax/solidity-bignumber/src/BigNumbers.sol";
import { BigInt } from "@zondax/filecoin-solidity/contracts/v0.8/cbor/BigNumberCbor.sol";
import { BigInt } from "@zondax/filecoin-solidity/contracts/v0.8/cbor/BigIntCbor.sol";
BigNumber memory numA = BigNumbers.init(10000, false);
BigNumber memory numB = BigNumbers.init(2000, false);
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added docs/assets/hyperspace/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/hyperspace/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/hyperspace/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/hyperspace/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/wallaby/5.png
Binary file not shown.
Binary file removed docs/assets/wallaby/6.png
Binary file not shown.
Binary file removed docs/assets/wallaby/7.png
Binary file not shown.
Binary file removed docs/assets/wallaby/8.png
Binary file not shown.
34 changes: 17 additions & 17 deletions docs/deploy-it.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,58 +20,58 @@ MetaMask is a software cryptocurrency wallet used to interact with the Ethereum
Install metamask extension on your browser. Metamask is available for Chrome and Firefox. You will need to follow a series of steps in order to create your store, set a password, and so on.
Once you are ready, you will see the following screen.

![image](assets/wallaby/1.png)
![image](assets/hyperspace/1.png)

### Adding new network

In order to interact with the wallaby network, you will need to add it to the list of them. Please, click on the dropdown box where "Ethereum Mainnet" is displayed, and hit "Add network".
In order to interact with the hyperspace network, you will need to add it to the list of them. Please, click on the dropdown box where "Ethereum Mainnet" is displayed, and hit "Add network".

![image](assets/wallaby/2.png)
![image](assets/hyperspace/2.png)

### Adding network manually

After a few seconds, you will end up on the following page. Please, click on "Add a network manually"

![image](assets/wallaby/3.png)
![image](assets/hyperspace/3.png)

### Setting up the parameters

Now it is time to fill each text box with the corresponding value. Once you finish typing in the values, hit "Save".

- Name: Filecoin Wallaby
- RPC URL: https://api.zondax.ch/fil/node/wallaby/rpc/v0
- ChainID: 31415 (Wallaby's ID)
- Name: Filecoin Hypersapce
- RPC URL: https://api.zondax.ch/fil/node/hyperspace/rpc/v0
- ChainID: 3141 (Hyperspace's ID)
- Currency symbol: TFIL (Test FIL).

![image](assets/wallaby/4.png)
![image](assets/hyperspace/4.png)

### Choosing Wallaby network
### Choosing Hyperspace network

Click again on the network selector, and choose the new "Filecoin Wallaby" network.
Click again on the network selector, and choose the new "Filecoin Hyperspace" network.

![image](assets/wallaby/5.png)
![image](assets/hyperspace/5.png)

### Your address

Now that you have chosen the wallaby network, your address is ready to use. But you need some tokens in order to spend gas on smart contracts. Copy the address, as you will need it in the next step.
Now that you have chosen the hyperspace network, your address is ready to use. But you need some tokens in order to spend gas on smart contracts. Copy the address, as you will need it in the next step.

![image](assets/wallaby/6.png)
![image](assets/hyperspace/6.png)

### Time to get some tokens

Go to the [faucet website :link:](https://wallaby.network/#faucet), paste the address you copied on the previous step, complete the captcha challenge, and ask for the tokens. Some minutes will pass until the transactions is finished.
Go to the [faucet website :link:](https://beryx.zondax.ch/faucet), paste the address you copied on the previous step, complete the captcha challenge, and ask for the tokens. Some minutes will pass until the transactions is finished.

![image](assets/wallaby/7.png)
![image](assets/hyperspace/7.png)

### Ready to go!

Some minutes after requesting tokens on the faucet, you will be your new balance reflected on your wallet. Congratulations! You are ready to deploy your smart contracts using Remix and Metamask.

![image](assets/wallaby/8.png)
![image](assets/hyperspace/8.png)

## Deploying your smart contract

The remix IDE is a powerful editor you can use to write your smart contracts. You will be able to write, compile and deploy them directly from it. In order to deploy them on the wallaby network, we will use MetaMask as the current environment.
The remix IDE is a powerful editor you can use to write your smart contracts. You will be able to write, compile and deploy them directly from it. In order to deploy them on the hyperspace network, we will use MetaMask as the current environment.

From the main menu, go to "Deploy & Run Transactions". It is the latest icon on the left-side menu.

Expand Down

0 comments on commit a6d0f2f

Please sign in to comment.