Skip to content

Commit

Permalink
Merge branch 'master' into jmongeon-new-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jessiemongeon1 authored Dec 4, 2024
2 parents 68d21cc + 0258942 commit 12c29bd
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 24 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,11 @@ The [Ecosystem Helper](https://mvw4g-yiaaa-aaaam-abnva-cai.icp0.io/) is an oncha
### Asset guidelines
| Asset | | Requirements | Format | Notes |
|-------------|----------|--------------|--------------|-----------------------------------------------------------------------------------|
| logo | required | 112x112px | webp/svg/png | Currently displayed 56x56px |
| screenshots | optional | 1024x576px | webp/jpg | The schema supports multiple files, but only the first one will be displayed |
| video | optional | max 10MB | webm/mp4 | If there is a video file specified, it will be displayed instead of a screenshot. |
| Asset | | Requirements | Format | Notes |
|-------------|----------|---------------------------------|---------------------------|----------------------------------------------------------------------------------------|
| logo | required | 112x112px (1:1 aspect ratio) | svg(recommended)/png/webp | Optimize file size with [SVGOMG](https://svgomg.net) or [TinyPNG](https://tinypng.com) |
| screenshots | optional | 1024x576px | webp/jpg | The schema supports multiple files, but only the first one will be displayed |
| video | optional | max 10MB | webm/mp4 | If there is a video file specified, it will be displayed instead of a screenshot. |
### Tags
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-docs/defi/dex/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Some examples of DEXs running on ICP include:

## Interacting with a DEX

To use a decentralized exchange (DEX) on ICP, you can interact with the web application for the exchange, use [tooling such as an SDK or API](#tooling) for more technical interactions, or create your own decentralized exchange application. DEXs are used to interact with the token mechanics of [ICP](docs/current/developer-docs/defi/tokens/token-standards#icp-tokens), the native token of the Internet Computer, and [ICRC-1](/docs/current/developer-docs/defi/tokens/token-standards#icrc-1) compliant tokens.
To use a decentralized exchange (DEX) on ICP, you can interact with the web application for the exchange, use [tooling such as an SDK or API](#tooling) for more technical interactions, or create your own decentralized exchange application. DEXs are used to interact with the token mechanics of [ICP](/docs/current/developer-docs/defi/tokens/token-standards#icp-tokens), the native token of the Internet Computer, and [ICRC-1](/docs/current/developer-docs/defi/tokens/token-standards#icrc-1) compliant tokens.

### Tooling

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Open the `dfx.json` file in your project's directory. Replace the existing conte
"ic": "ryjl3-tyaaa-aaaaa-aaaba-cai"
}
},
"init_arg" : "(variant { Init = record { minting_account = "MINTER_ACCOUNT_ID"; initial_values = vec { record { "DEFAULT_ACCOUNT_ID"; record { e8s = 10_000_000_000 : nat64; }; }; }; send_whitelist = vec {}; transfer_fee = opt record { e8s = 10_000 : nat64; }; token_symbol = opt \"LICP\"; token_name = opt \"Local ICP\"; } })"
"init_arg" : "(variant { Init = record { minting_account = \"MINTER_ACCOUNT_ID\"; initial_values = vec { record { \"DEFAULT_ACCOUNT_ID\"; record { e8s = 10_000_000_000 : nat64; }; }; }; send_whitelist = vec {}; transfer_fee = opt record { e8s = 10_000 : nat64; }; token_symbol = opt \"LICP\"; token_name = opt \"Local ICP\"; } })"
}
},
"defaults": {
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-docs/defi/wallets/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ On ICP, both developers and end users will use different types of wallets for di
| Type of wallet | Activities | Examples |
|----------------|------------|----------|
|[Asset wallet](overview.mdx) | Hold, transfer, and receive assets such as fungible tokens including ICP and other ICRC1/ICRC2 tokens (ex. ckBTC, ckETH) and non-fungible tokens. View token holdings. Stake ICP and create a neuron to participate in the NNS. User based authentication. | Plug, Stoic, Oisy. [View the full list](#third-party-custody). |
| [Canister-controlled wallet](/docs/current/developer-docs/smart-contracts/overview/introduction) | Using [Chain Fusion](/docs/current/developer-docs/multi-chain/overview), canisters on ICP can hold, sign, and transact with assets on various chains including ICP, Bitcoin, Ethereum, EVMs, and more. | [Cycles wallet](/docs/current/developer-docs/defi/cycles/cycles-wallet) (will be depreciated from dfx). Holds cycles needed to deploy, upgrade, and perform other operations on canisters. The cycles wallet is still supported, but has been replaced by the [cycles ledger](docs/current/developer-docs/defi/cycles/cycles-ledger). It is recommended to use the cycles ledger instead. |
| [Canister-controlled wallet](/docs/current/developer-docs/smart-contracts/overview/introduction) | Using [Chain Fusion](/docs/current/developer-docs/multi-chain/overview), canisters on ICP can hold, sign, and transact with assets on various chains including ICP, Bitcoin, Ethereum, EVMs, and more. | [Cycles wallet](/docs/current/developer-docs/defi/cycles/cycles-wallet) (will be depreciated from dfx). Holds cycles needed to deploy, upgrade, and perform other operations on canisters. The cycles wallet is still supported, but has been replaced by the [cycles ledger](/docs/current/developer-docs/defi/cycles/cycles-ledger). It is recommended to use the cycles ledger instead. |

### Other authentication methods

Expand Down
2 changes: 1 addition & 1 deletion docs/developer-docs/gas-cost.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Getting cycles back from a canister
- To withdraw cycles from a canister, the [canister must be deleted](/docs/current/tutorials/developer-journey/level-1/1.6-managing-canisters#getting-cycles-back-from-a-canister).

Topping up canisters
- [Top up your canisters](docs/current/developer-docs/smart-contracts/topping-up/topping-up-canister).
- [Top up your canisters](/docs/current/developer-docs/smart-contracts/topping-up/topping-up-canister).
- [Cycles management services](/docs/current/developer-docs/smart-contracts/topping-up/cycles_management_services).
- [Cycle.express](https://cycle.express/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Canister smart contracts on ICP have special properties that allow developers to

To learn more about full canister smart contract functionality, refer to the [smart contracts documentation](/docs/current/developer-docs/smart-contracts/overview/introduction).

Specifically, through protocol-level integration of ICP with the [Bitcoin network](docs/current/developer-docs/multi-chain/bitcoin/overview), ICP smart contracts can interact with the Bitcoin network directly. Canister smart contracts can run [queries against the full Bitcoin UTXO](/docs/current/developer-docs/multi-chain/bitcoin/using-btc/read-state) set, including finding the balance of any Bitcoin address. They can [hold](/docs/current/developer-docs/multi-chain/bitcoin/using-btc/generate-addresses), [sign](/docs/current/developer-docs/multi-chain/bitcoin/using-btc/sign-transactions), and [submit transactions](/docs/current/developer-docs/multi-chain/bitcoin/using-btc/submit-transactions) to the Bitcoin network.
Specifically, through protocol-level integration of ICP with the [Bitcoin network](/docs/current/developer-docs/multi-chain/bitcoin/overview), ICP smart contracts can interact with the Bitcoin network directly. Canister smart contracts can run [queries against the full Bitcoin UTXO](/docs/current/developer-docs/multi-chain/bitcoin/using-btc/read-state) set, including finding the balance of any Bitcoin address. They can [hold](/docs/current/developer-docs/multi-chain/bitcoin/using-btc/generate-addresses), [sign](/docs/current/developer-docs/multi-chain/bitcoin/using-btc/sign-transactions), and [submit transactions](/docs/current/developer-docs/multi-chain/bitcoin/using-btc/submit-transactions) to the Bitcoin network.

The [Threshold Schnorr integration](/docs/current/developer-docs/smart-contracts/signatures/t-schnorr) allows developers to interact with Runes and Ordinals directly in canisters. A [Schnorr canister example](https://github.com/dfinity/examples/tree/master/motoko/t-schnorr) is available in Motoko and Rust.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ keywords: [advanced, concept, async code, inter-canister calls, async inter-cani

import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow";

# Composite queries
# Async code and inter-canister calls

<MarkdownChipRow labels={["Advanced", "Concept"]} />

# Async code and inter-canister calls

## Overview

In programming, the [async/await pattern](https://en.wikipedia.org/wiki/Async/await) is a syntactic feature of many programming languages that allows an asynchronous, non-blocking function to be structured in a similar way to an ordinary synchronous function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ This guide outlines essential development best practices for building on the Int

Ensure all canisters have sufficient cycles to sustain operations for several years initially. Given the cost-effectiveness of storage and computation on ICP compared to other platforms, this upfront investment is usually modest.

Refer to [topping up cycles page](docs/current/developer-docs/smart-contracts/topping-up/topping-up-canister) to learn how to top-up cycles effectively.
Refer to [topping up cycles page](/docs/current/developer-docs/smart-contracts/topping-up/topping-up-canister) to learn how to top-up cycles effectively.

Refer to the [cycles estimate](/docs/current/developer-docs/gas-cost) page to estimate cycle usage.

### Recommendation: Manage cycle depletion.

ICP features a mechanism to prevent canisters from running out of cycles. Canisters have a configurable `freezing_threshold`, dynamically evaluated in cycles. Set `freezing_threshold` conservatively, ensuring at least 90 to 180 days' worth of cycles for proactive management.

Refer to [this resource](docs/current/developer-docs/smart-contracts/topping-up/topping-up-canister#managing-cycle-depletion-with-freezing-threshold) to learn how to configure the `freezing_threshold` of a canister.
Refer to [this resource](/docs/current/developer-docs/smart-contracts/topping-up/topping-up-canister#managing-cycle-depletion-with-freezing-threshold) to learn how to configure the `freezing_threshold` of a canister.

To make sure you won’t get surprised by a high cycle burn rate or hitting an instruction limit, you can use the recently added [performance counter API](https://internetcomputer.org/blog/features/async-performance-counter) to profile your canisters even before going live.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ However, build tools aren’t perfect, and may fail to ensure reproducible build

ICP does not allow you to access the Wasm module of an arbitrary canister. This is a design decision, as developers might want to keep some code private. However, ICP does allow anyone to access the SHA-256 of the Wasm module.

To obtain this hash, you must first note the principal of the canister whose code you want to check. For example, to check the code of the Internet Identity canister, the principal is `rdmx6-jaaaa-aaaaa-aaadq-cai`. Then, the easiest way to access this data is using [`dfx`](docs/current/developer-docs/getting-started/install) from a command line using the following command:
To obtain this hash, you must first note the principal of the canister whose code you want to check. For example, to check the code of the Internet Identity canister, the principal is `rdmx6-jaaaa-aaaaa-aaadq-cai`. Then, the easiest way to access this data is using [`dfx`](/docs/current/developer-docs/getting-started/install) from a command line using the following command:

```bash
dfx canister --network ic info rdmx6-jaaaa-aaaaa-aaadq-cai
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ On subnets with higher loads, your application may experience elevated latencies

### Recommendation: Consider moving the canister to another subnet.

If your canister is running on a subnet that has a consistently high load and thus elevated latency, consider adding a [compute allocation](docs/current/developer-docs/gas-cost#execution-and-compute-allocation) setting. A compute allocation of 1% will guarantee your canister is scheduled for execution once every 100 rounds.
If your canister is running on a subnet that has a consistently high load and thus elevated latency, consider adding a [compute allocation](/docs/current/developer-docs/gas-cost#execution-and-compute-allocation) setting. A compute allocation of 1% will guarantee your canister is scheduled for execution once every 100 rounds.

## Troubleshooting best practices

Expand Down
18 changes: 12 additions & 6 deletions plugins/airtable.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,21 @@ async function fetchAirtableRecords({ apiKey, baseId, tableName, viewId }) {
}

async function processEventsData(records) {
const endDateCutoff = new Date(Date.now() - 6 * 30 * 24 * 60 * 60 * 1000)
.toISOString()
.split("T")[0];

const today = new Date().toISOString().split("T")[0];

records = await Promise.all(
records.map(async (record) => {
const parsedRecord = parseAirtableData(record);

let imageUrl = await fetchShareImage(parsedRecord.eventLink);
// Only fetch share image for current/future events
let imageUrl = null;
if (parsedRecord.endDate >= today) {
imageUrl = await fetchShareImage(parsedRecord.eventLink);
}

// If no share image is found, use a default image
if (!imageUrl) {
Expand All @@ -171,10 +181,6 @@ async function processEventsData(records) {
})
);

const endDatecutoff = new Date(Date.now() - 6 * 30 * 24 * 60 * 60 * 1000)
.toISOString()
.split("T")[0];

records = records.filter((rec) => {
if (!rec.startDate || new Date(rec.startDate) == "Invalid Date") {
logger.warn("Invalid event, no start date: " + rec.eventName);
Expand All @@ -186,7 +192,7 @@ async function processEventsData(records) {
return false;
}

if (rec.endDate < endDatecutoff) {
if (rec.endDate < endDateCutoff) {
// old event
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions search/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.76.0"
2 changes: 1 addition & 1 deletion src/components/Common/sampleItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export const sampleItems: SampleItem[] = [
},
motoko:
"https://github.com/dfinity/examples/tree/master/motoko/send_http_get",
docs: "docs/current/developer-docs/smart-contracts/advanced-features/https-outcalls/https-outcalls-how-to-use",
docs: "/docs/current/developer-docs/smart-contracts/advanced-features/https-outcalls/https-outcalls-how-to-use",
rust: "https://github.com/dfinity/examples/tree/master/rust/send_http_get",
},
},
Expand Down

0 comments on commit 12c29bd

Please sign in to comment.