Skip to content

Commit

Permalink
Merge pull request #668 from oasisprotocol/matevz/docs/3rdparty-rpcs
Browse files Browse the repository at this point in the history
docs: Add 3rd party RPC endpoints
  • Loading branch information
matevz authored Mar 18, 2024
2 parents 418fc1f + b7a7d7d commit e2eedaa
Show file tree
Hide file tree
Showing 35 changed files with 401 additions and 214 deletions.
62 changes: 62 additions & 0 deletions docs/dapp/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,65 @@ Sapphire, demonstrates best practices for writing confidential smart contracts
and working examples for you to explore and extend.

<DocCard item={findSidebarItem('/dapp/opl/')} />

# Consensus Layer RPC Endpoints

:::danger

The RPC endpoint is a **point of trust**. Beside rate limiting, it can also
perform censorship or even man-in-the-middle attack. If you have security
considerations, we strongly recommend that you [run your own client
node][non-validator-node],

:::

[non-validator-node]: ../node/run-your-node/non-validator-node.mdx

Most dApp developers will build dApps on the ParaTime layer (the *compute*
layer) depicted above. For Sapphire and Emerald which are EVM-compatible chains,
those dApps connect directly to an [EVM-compatible Web3 endpoint][web3].
However, if you are building a dApp for Cipher or the one that needs to
perform consensus operations such as the consensus-layer token transfers,
governance transactions, cross-chain ParaTime deposits and withdrawals and
similar, you will need to connect to the one of the endpoints speaking
[Oasis gRPC][grpc].

Public gRPC endpoints (in alphabetic order):

| Provider | Mainnet URL | Testnet URL |
|-----------------------------|---------------------|-----------------------------|
| [Oasis Protocol Foundation] | `grpc.oasis.io:443` | `testnet.grpc.oasis.io:443` |

[Oasis Protocol Foundation]: https://oasisprotocol.org
[web3]: ../node/web3.mdx
[grpc]: ../node/grpc.mdx

## Consensus Layer Block Explorers

| Provider | Mainnet URL | Testnet URL |
|-----------------------------|---------------------------|-------------------------------|
| [Bit Cat] | https://www.oasisscan.com | https://testnet.oasisscan.com |
| [Oasis Protocol Foundation] | *Coming soon* | *Coming soon* |

[Bit Cat]: https://www.bitcat365.com/

## Rosetta Endpoints

| Provider | Mainnet URL | Testnet URL |
|-----------------------------|-------------------------------------------|-------------------------------------------|
| [Oasis Protocol Foundation] | `https://rosetta.oasis.io/api/mainnet/v1` | `https://rosetta.oasis.io/api/testnet/v1` |


:::tip

If you are running your own Oasis client node endpoint, a block explorer or the
Rosetta gateway and you wish to be added to the public list above, open an issue
at [github.com/oasisprotocol/docs].

:::

[github.com/oasisprotocol/docs]: https://github.com/oasisprotocol/docs/issues

# See also

<DocCardList items={[findSidebarItem('https://api.docs.oasis.io/js/client'), findSidebarItem('https://pkg.go.dev/github.com/oasisprotocol/oasis-core/go')]} />
62 changes: 52 additions & 10 deletions docs/dapp/cipher/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@ import {findSidebarItem} from '@site/src/sidebarUtils';

# Cipher ParaTime

The Cipher ParaTime is a Confidential ParaTime for executing Wasm smart contracts.
Cipher is a confidential ParaTime for executing Wasm smart contracts.

As the officially supported ParaTime by the Oasis Protocol Foundation, Cipher
allows for:

* Flexibility — Developer can define which data to store in a public
* Flexibility: developer can define which data to store in a public
and which data in the (more expensive) confidential storage
* Security — Rust language primarily used for writing Wasm smart contracts is
known for its strict memory management and was developed specifically to
* Security: the [rust language] primarily used for writing Wasm smart contracts
is known for its strict memory management and was developed specifically to
avoid memory leaks
* Scalability — increased throughput of transactions
* Low-cost — 99%+ lower fees than Ethereum
* Scalability: increased throughput of transactions
* Low-cost: 99%+ lower fees than Ethereum
* 6 second finality (1 block)
* Cross-chain bridge to enable cross-chain interoperability (upcoming)

If you're looking for EVM-compatible ParaTimes, check out the
[Emerald](../emerald/README.mdx) and the confidential
[Sapphire](../sapphire/README.mdx) paratimes.

## Smart Contracts Development
[rust language]: https://www.rust-lang.org/

The Cipher ParaTime implements the [Oasis Contract SDK] API. To learn how to
write a confidential smart contract in Rust and deploy it on the Oasis Cipher
ParaTime, read the related Oasis Contract SDK chapters:
## Smart Contract Development

Cipher implements the [Oasis Contract SDK] API. To learn how to write a
confidential smart contract in Rust and deploy it on Cipher, read the related
Oasis Contract SDK chapters:

<DocCard item={
findSidebarItem('/dapp/cipher/prerequisites')
Expand All @@ -40,6 +43,45 @@ ParaTime, read the related Oasis Contract SDK chapters:
findSidebarItem('/dapp/cipher/confidential-smart-contract')
} />

## RPC Endpoints

:::danger

The RPC endpoint is a *point of trust*. Beside traffic rate limiting, it can
also perform censorship or even a man-in-the-middle attack. If you have security
considerations, we strongly recommend that you set up your own [ParaTime client
node][paratime-client-node].

:::

Cipher endpoints share the gRPC protocol with the Oasis Core. You can connect to
one of the public endpoints below (in alphabetic order):

[paratime-client-node]: ../../node/run-your-node/paratime-client-node.mdx

| Provider | Mainnet RPC URLs | Testnet RPC URLs |
|-----------------------------|---------------------|-----------------------------|
| [Oasis Protocol Foundation] | `grpc.oasis.io:443` | `testnet.grpc.oasis.io:443` |

[Oasis Protocol Foundation]: https://oasisprotocol.org

## Block Explorers

No block explorers are available for Cipher yet. Consider debugging the Cipher
blocks using the [`oasis paratime show`] command in [Oasis CLI].

[`oasis paratime show`]: ../../general/manage-tokens/cli/paratime.md#show
[Oasis CLI]: ../../general/manage-tokens/cli/README.md

:::tip

If you are running your own Cipher endpoint and you wish to be added to the
public list above, open an issue at [github.com/oasisprotocol/docs].

:::

[github.com/oasisprotocol/docs]: https://github.com/oasisprotocol/docs

## See also

<DocCardList items={[
Expand Down
153 changes: 71 additions & 82 deletions docs/dapp/emerald/README.mdx
Original file line number Diff line number Diff line change
@@ -1,107 +1,96 @@
import DocCardList from '@theme/DocCardList';
import {findSidebarItem} from '@site/src/sidebarUtils';
import {AddEmeraldToMetaMask as E, AddEmeraldTestnetToMetaMask as ET} from '@site/src/AddToMetaMask';

# Emerald ParaTime

The Emerald ParaTime is our official EVM Compatible ParaTime providing smart contract environment with full EVM compatibility.
Emerald is our official ParaTime which executes smart contracts inside the
[Ethereum Virtual Machine (EVM)].

As the official EVM compatible ParaTime on the Oasis Network, Emerald allows for:
Emerald allows for:

* Full EVM compatibility
* Easy integration with EVM-based dApps, such as DeFi, NFT, Metaverse and crypto gaming
* Scalability — increased throughput of transactions
* Low-cost — 99%+ lower fees than Ethereum
* Easy integration with EVM-based dApps, such as DeFi, NFT, Metaverse and crypto
gaming
* Scalability: increased throughput of transactions
* Low-cost: 99%+ lower fees than Ethereum
* 6 second finality (1 block)
* Cross-chain bridge to enable cross-chain interoperability (upcoming)

If you're looking for EVM, but with confidentiality,
check out the [Sapphire ParaTime](../sapphire/README.mdx).
If you're looking for EVM, but with confidentiality, check out the
[Sapphire ParaTime](../sapphire/README.mdx).

## ParaTime Incentives
[Ethereum Virtual Machine (EVM)]: https://ethereum.org/en/developers/docs/evm/

Emerald is fully decentralized with node operators distributed globally, and Oasis ROSE will be the native token used for gas fees.
## Chain Information

The ParaTime will release tokens on-chain to reward nodes for participation. These tokens will be released, per epoch, with the reward being 3 ROSE Tokens per entity per epoch.
### Mainnet

Epochs are currently being produced at a speed of one per hour. Each node has an approximately 30% chance of being selected by the primary committee to claim the rewards. Hence, a node entity can earn 24 ROSE tokens per day, 720 ROSE tokens per month.
- Network name: `emerald`
- Long network name: `Oasis Emerald`
- Chain ID:
- Hex: `0xa516`
- Decimal: `42262`

The reward program is two years long.
### Testnet

## Web3 Gateway
- Network name: `emerald-testnet`
- Long network name: `Oasis Emerald Testnet`
- Chain ID:
- Hex: `0xa515`
- Decimal: `42261`

To get started building on our Emerald ParaTime, you can use our public Web3 gateway, fully compatible with Ethereum's Web3 gateway.
## RPC Endpoints

### Mainnet
:::danger

* RPC HTTP endpoint: `https://emerald.oasis.dev`
* RPC WebSockets endpoint: `wss://emerald.oasis.dev/ws`
* Chain ID:
* Hex: 0xa516
* Decimal: 42262
* Block explorer: [https://explorer.emerald.oasis.dev](https://explorer.emerald.oasis.dev)

<button
class="button button--primary margin-bottom--md"
onClick={() => {
if (!window.ethereum?.request) {
return alert('Have you installed MetaMask yet? If not, please do so.\n\nComputer: Once it is installed, you will be able to add the ParaTime to your MetaMask.\n\nPhone: Open the website through your MetaMask Browser to add the ParaTime.')
}
window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [
{
chainId: '0xa516',
chainName: 'Oasis Emerald',
nativeCurrency: {
name: 'Emerald Rose',
symbol: 'ROSE',
decimals: 18,
},
rpcUrls: ['https://emerald.oasis.dev', 'wss://emerald.oasis.dev/ws'],
blockExplorerUrls: ['https://explorer.emerald.oasis.dev'],
},
],
})
}}
>
Click here to register Emerald Mainnet to your MetaMask or Brave Wallet
</button>
The RPC endpoint is a *point of trust*. Beside traffic rate limiting, it can
also perform censorship or even a man-in-the-middle attack. If you have security
considerations, we strongly recommend that you set up your own [ParaTime client
node][paratime-client-node] and the [Web3-compatible gateway].

### Testnet
:::


[Web3-compatible gateway]: ../../node/web3.mdx
[paratime-client-node]: ../../node/run-your-node/paratime-client-node.mdx

You can connect to one of the public Web3 gateways below (in alphabetic order):

| Provider | Mainnet RPC URLs | Testnet RPC URLs |
|-----------------------------|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| [1RPC] | <E rpcs={['https://1rpc.io/oasis/emerald']} /> | N/A |
| [Oasis Protocol Foundation] | <E rpcs={['https://emerald.oasis.io','wss://emerald.oasis.io/ws']} /> | <ET rpcs={['https://testnet.emerald.oasis.io','wss://testnet.emerald.oasis.io/ws']} /> |

[Oasis Protocol Foundation]: https://oasisprotocol.org

Public RPCs may have rate limits or traffic restrictions. For professional,
dedicated RPC endpoints, consider the following providers (in alphabetic order):

| Provider | Instructions | Pricing |
|---------------------------|---------------------------|-------------------------|
| [1RPC] | [docs.1rpc.io][1RPC-docs] | [Pricing][1RPC-pricing] |


[1RPC]: https://www.1rpc.io/
[1RPC-docs]: https://docs.1rpc.io/guide/how-to-use-1rpc
[1RPC-pricing]: https://www.1rpc.io/#pricing

## Block Explorers

| Provider | Mainnet URL | Testnet URL | EIP-3091 compatible |
|-----------------------------|-------------------------------------------|-------------------------------------------|---------------------|
| [Oasis Protocol Foundation] | https://explorer.oasis.io/mainnet/emerald | https://explorer.oasis.io/testnet/emerald | Yes |

:::tip

If you are running your own Emerald endpoint or a block explorer, and you wish
to be added to the public list above, open an issue at
[github.com/oasisprotocol/docs].

* RPC HTTP endpoint: `https://testnet.emerald.oasis.dev`
* RPC WebSockets endpoint: `wss://testnet.emerald.oasis.dev/ws`
* Chain ID:
* Hex: 0xa515
* Decimal: 42261
* Block explorer: [https://testnet.explorer.emerald.oasis.dev](https://testnet.explorer.emerald.oasis.dev)

<button
class="button button--primary margin-bottom--md"
onClick={() => {
if (!window.ethereum?.request) {
return alert('Have you installed MetaMask yet? If not, please do so.\n\nComputer: Once it is installed, you will be able to add the ParaTime to your MetaMask.\n\nPhone: Open the website through your MetaMask Browser to add the ParaTime.')
}
window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [
{
chainId: '0xa515',
chainName: 'Oasis Emerald Testnet',
nativeCurrency: {
name: 'TEST',
symbol: 'TEST',
decimals: 18,
},
rpcUrls: ['https://testnet.emerald.oasis.dev/', 'wss://testnet.emerald.oasis.dev/ws'],
blockExplorerUrls: ['https://testnet.explorer.emerald.oasis.dev'],
},
],
})
}}
>
Click here to register Emerald Testnet to your MetaMask or Brave Wallet
</button>
:::

[github.com/oasisprotocol/docs]: https://github.com/oasisprotocol/docs

## See also

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The `savePrice` function will save any base/quote rate that is passed to it in t

### Mainnet Reference Data Contract

You can access the reference data aggregator contract on mainnet at [0xDA7a001b254CD22e46d3eAB04d937489c93174C3](https://explorer.emerald.oasis.dev/address/0xDA7a001b254CD22e46d3eAB04d937489c93174C3/transactions).
You can access the reference data aggregator contract on Mainnet at [0xDA7a001b254CD22e46d3eAB04d937489c93174C3](https://explorer.oasis.io/mainnet/emerald/address/0xDA7a001b254CD22e46d3eAB04d937489c93174C3).

### Available Reference Data

Expand Down
10 changes: 5 additions & 5 deletions docs/dapp/emerald/writing-dapps-on-emerald.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ParaTime][how-to-deposit-rose] chapter to learn more.
[Ed25519]: https://en.wikipedia.org/wiki/EdDSA#Ed25519
[ECDSA]: https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm
[how-to-deposit-rose]: ../../general/manage-tokens/how-to-transfer-rose-into-paratime.mdx
[Testnet faucet]: https://faucet.testnet.oasis.dev/
[Testnet faucet]: https://faucet.testnet.oasis.io/

## Testnet and Mainnet

Expand Down Expand Up @@ -231,12 +231,12 @@ networks: {
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
emerald_testnet: {
url: "https://testnet.emerald.oasis.dev",
url: "https://testnet.emerald.oasis.io",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
emerald_mainnet: {
url: "https://emerald.oasis.dev",
url: "https://emerald.oasis.io",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
Expand Down Expand Up @@ -433,7 +433,7 @@ error description, for example:
<DocCard item={findSidebarItem('/node/web3')} />


[mainnet-explorer]: https://explorer.emerald.oasis.dev
[testnet-explorer]: https://testnet.explorer.emerald.oasis.dev
[mainnet-explorer]: https://explorer.oasis.io/mainnet/emerald
[testnet-explorer]: https://explorer.oasis.io/testnet/emerald
[mainnet-oasisscan]: https://oasisscan.com
[testnet-oasisscan]: https://testnet.oasisscan.com
4 changes: 2 additions & 2 deletions docs/dapp/opl/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ index cd8df42..0875e8e 100644
+ accounts,
+ },
+ 'sapphire-testnet': {
+ url: 'https://testnet.sapphire.oasis.dev',
+ url: 'https://testnet.sapphire.oasis.io',
+ chainId: 0x5aff,
+ accounts,
+ },
Expand Down Expand Up @@ -131,7 +131,7 @@ We can likewise deploy to [Testnet](../../dapp/sapphire/guide#testnet-and-mainne
with Sapphire.

In this case, we should prepare a wallet with Testnet tokens on both BNB Smart
Chain [Faucet](https://testnet.bnbchain.org/faucet-smart) and Sapphire [faucet](https://faucet.testnet.oasis.dev).
Chain [Faucet](https://testnet.bnbchain.org/faucet-smart) and Sapphire [faucet](https://faucet.testnet.oasis.io).

We will use a common private key for both the host and enclave smart contracts.

Expand Down
Loading

0 comments on commit e2eedaa

Please sign in to comment.