diff --git a/cli/package.json b/cli/package.json index 56ef0272fac..8f6ed040eaa 100644 --- a/cli/package.json +++ b/cli/package.json @@ -15,7 +15,7 @@ "clean": "rm -rf ./dist", "build": "npx tsc --build && tsc-alias && yarn copy", "copy:internal": "copyfiles \"src/**/!(*.ts|*.js|*.tsx)\" dist/cli", - "copy:external": "copyfiles \"../src/common/css/**/!(*.ts|*.js|*.tsx)\" \"../src/common/icons/**/!(*.ts|*.js|*.tsx)\" \"../src/next/css/**/!(*.ts|*.js|*.tsx)\" dist/cli", + "copy:external": "copyfiles \"../src/common/css/**/!(*.ts|*.js|*.tsx)\" \"../src/icons/**/(*.ts|*.js|*.tsx)\" \"../static/icons/**/!(*.ts|*.js|*.tsx)\" \"../src/next/css/**/!(*.ts|*.js|*.tsx)\" dist/cli", "copy": "yarn copy:internal && yarn copy:external", "watch": "nodemon --watch src --ext '*' --exec yarn build", "prepack": "yarn build" diff --git a/docs/build/iota-sdk/1.0.0/docs/getting-started/nodejs.mdx b/docs/build/iota-sdk/1.0.0/docs/getting-started/nodejs.mdx index 6fd6a711f8b..84f30438c6c 100644 --- a/docs/build/iota-sdk/1.0.0/docs/getting-started/nodejs.mdx +++ b/docs/build/iota-sdk/1.0.0/docs/getting-started/nodejs.mdx @@ -121,50 +121,16 @@ Prebuild requires that the binary is in `build/Release` as though it was built w After you [installed the library](#install-the-iota-sdk), you can create a `Client` instance and interface with it. -```javascript -const { Client, initLogger } = require('@iota/sdk'); - -async function run() { - initLogger(); - - const client = new Client({ - nodes: ['https://api.testnet.shimmer.network'], - localPow: true, - }); - - try { - const nodeInfo = await client.getInfo(); - console.log('Node info: ', nodeInfo); - } catch (error) { - console.error('Error: ', error); - } -} - -run().then(() => process.exit()); +```typescript reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/client/getting-started.ts#L4-L23 ``` ### Wallet After you [installed the library](#installing-the-iota-sdk), you can create a `Wallet` instance and interact with it. -```javascript -import { Wallet, CoinType, WalletOptions } from '@iota/sdk'; - -const walletOptions: WalletOptions = { - storagePath: `Alice`, // A name to associate with the created account. - clientOptions: { - nodes: ['https://api.testnet.shimmer.network'], // The node to connect to. - }, - coinType: CoinType.Shimmer, - secretManager: { - // Setup Stronghold secret manager - stronghold: { - snapshotPath: 'vault.stronghold', // The path to store the account snapshot. - password: 'a-secure-password', // A password to encrypt the stored data. WARNING: Never hardcode passwords in production code. - }, - }, -}; -const wallet = new Wallet(walletOptions); +```typescript reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/wallet/getting-started.ts#L4-L60 ``` ## What's next? diff --git a/docs/build/iota-sdk/1.0.0/docs/getting-started/python.mdx b/docs/build/iota-sdk/1.0.0/docs/getting-started/python.mdx index 15a87d1d898..d1f0e07a908 100644 --- a/docs/build/iota-sdk/1.0.0/docs/getting-started/python.mdx +++ b/docs/build/iota-sdk/1.0.0/docs/getting-started/python.mdx @@ -92,40 +92,16 @@ deactivate After you [installed the library](#install-the-iota-sdk), you can create a `Client` instance and interface with it. -```python -from iota_sdk import Client - -# Create a Client instance -client = Client(nodes=['https://api.testnet.shimmer.network']) - -# Get the node info -node_info = client.get_info() -print(f'{node_info}') +```python reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/python/examples/client/getting_started.py ``` ### Wallet After you [installed the library](#install-the-iota-sdk), you can create a `Wallet` instance and interact with it. -```python -from iota_sdk import Wallet, StrongholdSecretManager, CoinType - -# This example creates a new database and account - -wallet_options = { - 'nodes': ['https://api.testnet.shimmer.network'], -} - -secret_manager = StrongholdSecretManager("wallet.stronghold", "some_hopefully_secure_password") - -wallet = Wallet('./alice-database', wallet_options, coin_type=CoinType.SHIMMER, secret_manager) - -# Store the mnemonic in the Stronghold snapshot. This only needs to be done once -account = wallet.store_mnemonic("flame fever pig forward exact dash body idea link scrub tennis minute " + - "surge unaware prosper over waste kitten ceiling human knife arch situate civil") - -account = wallet.create_account('Alice') -print(account) +```python reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/python/examples/wallet/getting_started.py#L4-L48 ``` ## What's next? diff --git a/docs/build/iota-sdk/1.0.0/docs/getting-started/rust.mdx b/docs/build/iota-sdk/1.0.0/docs/getting-started/rust.mdx index 956a47aab98..98bb968b710 100644 --- a/docs/build/iota-sdk/1.0.0/docs/getting-started/rust.mdx +++ b/docs/build/iota-sdk/1.0.0/docs/getting-started/rust.mdx @@ -137,21 +137,8 @@ iota-sdk = "1.0.0" To use the Client module, you simply need to create a `Client`. -```rust -use iota_sdk::client::{Client, Result}; - -#[tokio::main] -async fn main() -> Result<()> { - let client = Client::builder() - .with_node("https://api.testnet.shimmer.network")? // Insert your node URL here - .finish() - .await?; - - let info = client.get_info().await?; - println!("Node Info: {info:?}"); - - Ok(()) -} +```rust reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/client/getting_started.rs#L10-L23 ``` ### Wallet @@ -159,47 +146,8 @@ async fn main() -> Result<()> { To use the Wallet module, you need to create a `Wallet`. For this example to work `features = ["stronghold"]` is needed in the Cargo.toml import. To persist the wallet in a database, `"rocksdb"` can be added. -```rust -use iota_sdk::{ - client::{ - constants::SHIMMER_COIN_TYPE, - secret::{stronghold::StrongholdSecretManager, SecretManager}, - }, - wallet::{ClientOptions, Result, Wallet}, -}; - -#[tokio::main] -async fn main() -> Result<()> { - // Setup Stronghold secret manager. - // WARNING: Never hardcode passwords in production code. - let secret_manager = StrongholdSecretManager::builder() - .password("password".to_owned()) // A password to encrypt the stored data. - .build("vault.stronghold")?; // The path to store the account snapshot. - - let client_options = ClientOptions::new().with_node("https://api.testnet.shimmer.network")?; - - // Set up and store the wallet. - let wallet = Wallet::builder() - .with_secret_manager(SecretManager::Stronghold(secret_manager)) - .with_client_options(client_options) - .with_coin_type(SHIMMER_COIN_TYPE) - .finish() - .await?; - - // Generate a mnemonic and store it in the Stronghold vault. - // INFO: It is best practice to back up the mnemonic somewhere secure. - let mnemonic = wallet.generate_mnemonic()?; - wallet.store_mnemonic(mnemonic).await?; - - // Create an account. - let account = wallet - .create_account() - .with_alias("Alice") // A name to associate with the created account. - .finish() - .await?; - - Ok(()) -} +```rust reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/wallet/getting_started.rs#L12-L56 ``` ## What's next? diff --git a/docs/build/iota-sdk/1.0.0/docs/getting-started/wasm.mdx b/docs/build/iota-sdk/1.0.0/docs/getting-started/wasm.mdx index 56459bde145..f76c4ee356e 100644 --- a/docs/build/iota-sdk/1.0.0/docs/getting-started/wasm.mdx +++ b/docs/build/iota-sdk/1.0.0/docs/getting-started/wasm.mdx @@ -147,50 +147,16 @@ A bundler such as [webpack](https://webpack.js.org/) or [rollup](https://rollupj After you [installed the library](#install-the-iota-sdk), you can create a `Client` instance and interface with it. -```javascript -const { Client, initLogger } = require('@iota/sdk'); - -async function run() { - initLogger(); - - const client = new Client({ - nodes: ['https://api.testnet.shimmer.network'], - localPow: true, - }); - - try { - const nodeInfo = await client.getInfo(); - console.log('Node info: ', nodeInfo); - } catch (error) { - console.error('Error: ', error); - } -} - -run().then(() => process.exit()); +```typescript reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/client/getting-started.ts#L4-L23 ``` ### Wallet After you [installed the library](#installing-the-iota-sdk), you can create a `Wallet` instance and interact with it. -```javascript -import { Wallet, CoinType, WalletOptions } from '@iota/sdk'; - -const walletOptions: WalletOptions = { - storagePath: `Alice`, // A name to associate with the created account. - clientOptions: { - nodes: ['https://api.testnet.shimmer.network'], // The node to connect to. - }, - coinType: CoinType.Shimmer, - secretManager: { - // Setup Stronghold secret manager - stronghold: { - snapshotPath: 'vault.stronghold', // The path to store the account snapshot. - password: 'a-secure-password', // A password to encrypt the stored data. WARNING: Never hardcode passwords in production code. - }, - }, -}; -const wallet = new Wallet(walletOptions); +```typescript reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/wallet/getting-started.ts#L4-L60 ``` ### Web Usage diff --git a/docs/maintain/hornet/2.0.0-rc.6/docs/how_tos/using_docker.md b/docs/maintain/hornet/2.0.0-rc.6/docs/how_tos/using_docker.md index 1bfae53221f..3bf472d0787 100644 --- a/docs/maintain/hornet/2.0.0-rc.6/docs/how_tos/using_docker.md +++ b/docs/maintain/hornet/2.0.0-rc.6/docs/how_tos/using_docker.md @@ -104,6 +104,16 @@ If you want to change the port to a different value you can create a file named ``` HTTP_PORT=9000 ``` +If you don't have a DNS name for your node, you can use the (external) IP address for `NODE_HOST`, for example, `192.168.1.123`, or your public IP address. +With this setting, you can reach the node dashboard from within your network or the internet. +You don’t need `COMPOSE_FILE` and `ACME_EMAIL` for HTTP. You can remove them from your `.env` file or place a `#` before it to make it a remark: + +``` +#COMPOSE_FILE=docker-compose.yml:docker-compose-https.yml +#ACME_EMAIL=your-email@example.com + +NODE_HOST=your-external-ip-address +``` ### 2. Setup neighbors diff --git a/src/common/components/CustomNetworkDropdown/index.tsx b/src/common/components/CustomNetworkDropdown/index.tsx index 948d39e04f4..f4e10d70c6e 100644 --- a/src/common/components/CustomNetworkDropdown/index.tsx +++ b/src/common/components/CustomNetworkDropdown/index.tsx @@ -12,12 +12,14 @@ import type { } from '@theme/NavbarItem/DropdownNavbarItem'; import './styles.css'; -import { IotaCore, Shimmer, Next } from '../../icons'; +import icons from '@site/src/icons'; import { fetchSitemapUrlsFromNetwork, getBestNetworkUrlMatch, } from '@site/src/utils/networkUtils'; +const { IotaCore, Shimmer, Next } = icons; + interface NetworkDropdownItem { label: string; routeBasePath: string; diff --git a/src/common/components/Social/index.tsx b/src/common/components/Social/index.tsx index 1837a0a89d9..1c508633249 100644 --- a/src/common/components/Social/index.tsx +++ b/src/common/components/Social/index.tsx @@ -15,6 +15,7 @@ export interface SocialsConfig extends ThemeConfig { function SocialLink({ url, backgroundColor }: Social) { const { name, Icon } = get_socials_data(url); + return ( >; + icon?: string; }; export type Version = Item; @@ -52,6 +52,11 @@ enum SwitcherMenuState { Versions, } +function Icon({ icon, className }: { icon: string; className: string }) { + const Comp = icons[icon]; + return ; +} + type SwitcherMenuDropdownProps = { items: MenuItem[]; active: boolean }; function SwitcherMenuDropdown(props: SwitcherMenuDropdownProps) { @@ -64,7 +69,7 @@ function SwitcherMenuDropdown(props: SwitcherMenuDropdownProps) { >