Skip to content

Commit

Permalink
Documentation for the faucet service (#156)
Browse files Browse the repository at this point in the history
* Add some docs for faucet (faucet-manual)

* Cosmetic changes (faucet-manual)

* Add page to sidebar (faucet-manual)

* Developing documentation of faucet

* Developing documentation of faucet

* Added get token via NeonSwap

* add faucet

* Fix img size in faucet doc page

* Revert "Fix img size in faucet doc page"

This reverts commit fdc443f.

* Fix image size

Co-authored-by: Eugeny Kurkovich <[email protected]>
Co-authored-by: YYYurchenko <[email protected]>
  • Loading branch information
3 people authored Apr 5, 2022
1 parent a1546dc commit 6dd7260
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 44 deletions.
176 changes: 176 additions & 0 deletions docs/developing/utilities/faucet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
---
title: Faucet
---

Using Faucet you can request Test NEON tokens on Solana devnet.

## Requesting test NEON tokens via UI

### Step 1
Set up MetsMask in accordance with [Setting up MetaMask](../../wallet/metamask_setup#installing-metamask)

### Step 2
Go to the page to request test tokens using the following [link](https://neonswap.live/#/get-tokens).

### Step 3
Connect your wallet:
- Click button `CONNECT WALET`

<div class='neon-img-box-300' style={{textAlign: 'center'}}>

![](./images/connect_walet.png)

</div>

- Click button `CONNECT METAMASK`

<div class='neon-img-box-300' style={{textAlign: 'center'}}>

![](./images/connect_metamask.png)

</div>

- In the MetaMask window, select one or more accounts and click `Next`.

<div class='neon-img-box-300' style={{textAlign: 'center'}}>

![](./images/metamask_next.png)

</div>

- Сlick the `Connect` button to confirm.

<div class='neon-img-box-300' style={{textAlign: 'center'}}>

![](./images/confirm_connection.png)

</div>

- In the form that appears, enter the number of requested tokens and click the button `GET TOKENS`.

<div class='neon-img-box-300' style={{textAlign: 'center'}}>

![](./images/get_tokens.png)

</div>


# Requesting test NEON tokens via HTTP API Endpoints

A client uses POST requests to send data to the server.
Several endpoints are supported.

```
|------------------------------------------------------------------------------------------
| Endpoint | Workload | Description
|------------------------------------------------------------------------------------------
| request_ping | text | Requests ping to check availability of the service
| request_version | | Requests version of the service
| request_neon_in_galans | JSON | Requests NEON tokens, amount in galans (fractions)
| request_neon | JSON | Requests NEON tokens
| request_erc20 | JSON | Requests ERC20 tokens
|------------------------------------------------------------------------------------------
```

Example of JSON workload:
```
{ "wallet": "0x4570e07200b6332989Dc04fA2a671b839D26eF0E", "amount": 1 }
```

Example of ping request with **curl** utility:
```
curl -i -X POST -d 'Hello' 'http://localhost:3333/request_ping'
```

Example of version request with **curl** utility:
```
curl -i -X POST 'http://localhost:3333/request_version'
```

Example of NEON drop request with **curl** utility:
```
curl -i -X POST \
-d '{"wallet": "0x4570e07200b6332989Dc04fA2a671b839D26eF0E", "amount": 1}' \
'http://localhost:3333/request_neon'
```


# Configuration

The configuration file should be in TOML format.

```
|----------------------------------------------------------------------------------------------
| Option | Description
|----------------------------------------------------------------------------------------------
| rpc.bind | Local interface TCP address
| rpc.port | TCP port to listen
| rpc.allowed_origins | List of client URLs that can send requests
| web3.enable | Flag to on/off the entire web3 section
| web3.rpc_url | Ethereum network endpoint
| web3.private_key | Ethereum private key to support operations
| web3.tokens | List of available ERC20 token addresses
| web3.max_amount | Largest amount of ERC20 tokens to distribute with a single request
| solana.enable | Flag to on/off the entire solana section
| solana.url | Solana network endpoint
| solana.commitment | Solana client commitment level
| solana.operator_keyfile | Solana keyfile to support operations
| solana.evm_loader | Address of the EVM Loader program
| solana.max_amount | Largest amount of NEONs to distribute with a single request
|----------------------------------------------------------------------------------------------
```

Example of the configuration file contents:
```
[rpc]
bind = "0.0.0.0"
port = 3333
allowed_origins = ["http://localhost"]
[web3]
enable = true
rpc_url = "http://localhost:9090/solana"
private_key = "0x0000000000000000000000000000000000000000000000000000000000000Ace"
tokens = ["0x00000000000000000000000000000000CafeBabe",
"0x00000000000000000000000000000000DeadBeef"]
max_amount = 1000
[solana]
enable = true
url = "http://localhost:8899"
commitment = "processed"
evm_loader = "EvmLoaderId11111111111111111111111111111111"
operator_keyfile = "operator_id.json"
max_amount = 10
```

The configuration file is optional and, if present, can be incomplete
(default values or environment variables will be used in such cases).


# Environment Variables

Environment variables, if present, override portions of the configuration.

```
|----------------------------------------------------------------------------------------------
| Name | Overrides | Value Example
|----------------------------------------------------------------------------------------------
| FAUCET_RPC_BIND | rpc.bind | `0.0.0.0`
| FAUCET_RPC_PORT | rpc.port | `3333`
| FAUCET_RPC_ALLOWED_ORIGINS | rpc.allowed_origins | `["http://localhost"]`
| FAUCET_WEB3_ENABLE | web3.enable | `true`
| WEB3_RPC_URL | web3.rpc_url | `http://localhost:9090/solana`
| WEB3_PRIVATE_KEY | web3.private_key | `0x00...0A`
| NEON_ERC20_TOKENS | web3.tokens | `["0x00B", "0x00C"]`
| NEON_ERC20_MAX_AMOUNT | web3.max_amount | `1000`
| FAUCET_SOLANA_ENABLE | solana.enable | `true`
| SOLANA_URL | solana.url | `http://localhost:8899`
| SOLANA_COMMITMENT | solana.commitment | `processed`
| EVM_LOADER | solana.evm_loader | `EvmLoaderId11111111111111111111111111111111`
| NEON_OPERATOR_KEYFILE | solana.operator_keyfile | `operator_id.json`
| NEON_ETH_MAX_AMOUNT | solana.max_amount | `10`
| NEON_LOG | | `json`
| RUST_LOG | | `info`
|----------------------------------------------------------------------------------------------
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/developing/utilities/images/get_tokens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/operating/operator_guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Running Neon EVM as a Proxy Operator
title: Running a Proxy server
---

*This guide is for people who want to register with Neon EVM as a proxy operator for processing transactions on Solana. It is assumed these people have previous experience compiling Solana-based blockchain nodes or have worked as blockchain validators.*
Expand Down
109 changes: 66 additions & 43 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
type: 'category',
label: 'About',
items: [ 'about/introduction', 'about/terminology']
}, {
}, {
type: 'category',
label: 'Wallets',
items: ['wallet/metamask_setup']
Expand All @@ -25,62 +25,81 @@ module.exports = {
{ type: 'link', label: 'Indexing Dashboard', href: "https://neon.aleph.cloud/" } ]
}, {
type: 'category',
label: 'Token Transferring',
label: 'Tokens Transferring',
items: [ 'token_transferring/neonpass_overview',
'token_transferring/neonpass_usage' ]
'token_transferring/neonpass_usage']
}, {
type: 'category',
label: 'Developing',
items: [
'developing/getting_started',
{
type: 'category',
label: 'Setting up environment',
label: 'Setting up Environment',
items: [ 'developing/dev_environment/choosing_proxy',
'developing/dev_environment/connect_to_solana_via_proxy',
{ type: 'doc', label: 'Local Neon EVM environment', id: 'developing/dev_environment/solana_cluster/cluster_installation' } ]
}, {
'developing/dev_environment/solana_cluster/cluster_installation',
]
},
{
type: 'category',
label: 'Deploying dApps',
items: [ 'developing/deploy_facilities/using_remix',
items: [
'developing/deploy_facilities/using_remix',
'developing/deploy_facilities/using_truffle',
'developing/deploy_facilities/using_hardhat',
'developing/deploy_facilities/migrating_dapps',
'developing/deploy_facilities/using_erc20_tokens',
'developing/deploy_facilities/adding_new_tokens' ]
}, {
'developing/deploy_facilities/adding_new_tokens',
]
},
// 'developing/contract_testing/neonswap_tests',
{
type: 'category',
label: 'Using Utilities',
items: [ { type: 'link', label: 'NeonScan', href: "https://neonscan.org/" },
'developing/utilities/neonpass',
'developing/utilities/neonswap' ]
} ]
label: 'Using utilities',
items: [
{ type: 'link', label: 'NeonScan', href: "https://neonscan.'org/" },
'developing/utilities/neonpass',
'developing/utilities/neonswap',
'developing/utilities/faucet',
]
}
]
}, {
type: 'category',
label: "Operating",
items: [ 'operating/operator_requirements',
'operating/operator_guide' ]
}, {
items: [
'operating/operator_requirements',
'operating/operator_guide',
]
},
// {
// type: 'category',
// label: 'Contributing',
// items: [ 'contributing/maintain_docs','contributing/bpf_trace' ]
// },
{
type: 'category',
label: 'Governance',
items: [ 'governance/governance_overview',
'governance/governance_ui' ]
items: [
'governance/governance_overview',
'governance/governance_ui'
]
}, {
type: 'category',
label: 'Environment',
items: [ 'clusters/solana_cluster',
'clusters/neon_proxy_rpc_endpoints' ]
items: [
'clusters/solana_cluster',
'clusters/neon_proxy_rpc_endpoints'
]
}, {
type: 'category',
label: 'Architecture',
items: [
'architecture/neon_evm_arch',
'architecture/eth_sol_solution',
{ type: 'doc', label: 'EVM compatibility', id: 'architecture/evm_compatibility' },
{
type: 'doc',
label: 'EVM compatibility',
id: 'architecture/evm_compatibility'
}, {
type: 'category',
label: 'Core Aspects',
items: [ 'architecture/core_aspects/account',
Expand All @@ -90,26 +109,30 @@ module.exports = {
'architecture/core_aspects/proof-of-work',
'architecture/core_aspects/transaction',
'architecture/core_aspects/web3' ]
}, {
},
{
type: 'category',
label: 'Architectural Limitations',
items: [ 'design_proposals/accepted/restriction_on_iterative_trx',
'design_proposals/accepted/erc721_tokens',
'design_proposals/accepted/precompiled_contracts',
'design_proposals/accepted/gas_calculator',
'design_proposals/accepted/unsupported_functions',
'design_proposals/accepted/storage_size_for_account' ]
} ]
}, {
type: 'category',
label: 'FAQ',
items: [ 'faq/what-is-neon',
'faq/how-does-neon-work',
'faq/how-use-neon',
'faq/why-choose-neon',
'faq/how-run-neon-evm',
'faq/couldnt-find-answer' ]
}
items: [
'design_proposals/accepted/restriction_on_iterative_trx',
'design_proposals/accepted/erc721_tokens',
'design_proposals/accepted/precompiled_contracts',
'design_proposals/accepted/gas_calculator',
'design_proposals/accepted/unsupported_functions',
'design_proposals/accepted/storage_size_for_account'
]
}
]
},
{ type: 'category', label: 'FAQ', items: [
'faq/what-is-neon',
'faq/how-does-neon-work',
'faq/how-use-neon',
'faq/why-choose-neon',
'faq/how-run-neon-evm',
'faq/couldnt-find-answer',
]
}
]
};

Expand Down

0 comments on commit 6dd7260

Please sign in to comment.