jcarbonnell/preTrainingNEAR huggingface dataset:
Refining NEAR Foundation’s Grant Approach
NEAR FOUNDATION
January 3, 2023

A few weeks ago, as part of a series of blogs on the state of funding, NEAR Foundation announced it would be examining its evolving funding strategy. This is in line with the Foundation’s  goal of providing a clear and concise update to continue to foster transparent communication. 

At this time, NEAR Foundation is actively working towards a more decentralized model of capital allocation that will initially involve the DeveloperDAO, MarketingDAO, CreativesDAO, with an additional DAO that will begin formation in Q1 of 2023. This will impact the ecosystem in the following ways:

Effective immediately, NEAR Foundation will cease allocating capital directly from our inbound start-up grants program, with the exception of our current events grants, which will be handed over to the MarketingDAO when they are set up to manage them. Request events funding by following the steps outlined here.
In January and February, we will be working directly with community members to outline a clear application process for funding via the DAOs. Processing time is expected to take 6-8 weeks. If you are interested in helping us form the new DAO with a focus on start-up projects, please submit your interest using this contact form.
Any  projects that have already received a portion of their funding and are working towards their agreed milestones will continue to be supported through the remaining milestones.
Any application that is not already in the approval stage will not receive funding. However, we will do our best to redirect you to appropriate, alternative funding sources.
NEAR Foundation’s goal is to empower the ecosystem to make decisions that support  the strategic approach that will drive NEAR  to the next phase of its roadmap, with a look ahead at new areas of product and development, as outlined in the NEAR Strategic Update and Outlook for 2023. We will continue to be as transparent as possible about the new funding strategy as it rolls out. The Foundation will communicate as often, and as frequently, as possible. We encourage the community to continue providing meaningful feedback so we can iterate more quickly as we unite to build the NEAR Ecosystem together.
NEAR Foundation Partners With Elliptic To Enhance On-Chain Security
COMMUNITY
February 22, 2022
The NEAR Foundation is delighted to announce it is partnering with Elliptic to help enhance security and on chain forensics. 

The partnership means both the NEAR blockchain and its native asset $NEAR will have access to Elliptic’s class-leading blockchain analytics and financial crime monitoring services.

“NEAR’s mission is to help onboard billions of users into Web3,” says NEAR Foundation CEO Marieke Flament. 

“We can’t do that unless we can create a safe and secure environment for people to explore this new world. Partnering with projects like Elliptic helps us realise this goal faster.”

The agreement will provide users of NEAR with full visibility of the NEAR blockchain across Elliptic’s full suite of products and services. This will initially include screening of crypto wallets and transactions on the NEAR blockchain through Elliptic’s Lens and Navigator products, with plans to incorporate Virtual Asset Providers (VASPs verification) and crime investigation capabilities through Elliptics Discovery and Forensics. 

“Blockchain technologies are embedded in the financial mainstream and giving businesses the tools to use them transparently is critical to their safe and secure adoption,” said Elliptic CPO John Connolly. 

“Working with NEAR Foundation is another important step towards providing the deepest analytical and technical insight across a broad range of blockchain technologies to ensure businesses can identify trusted partners and work with cryptoassets with confidence.”

Elliptic provides compliance solutions and services for exchanges, protocols and Web3 businesses. Its analytics scan more than 500 cryptoassets and 20 billion+ data points to provide accurate, actionable insights that businesses rely on to mitigate risk and be compliant.
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId="nft-contract-tabs" className="file-tabs">
<TabItem value="NFT Primitive" label="Reference" default>

```js
const tokenData = Near.call(
  "nft.primitives.near",
  "nft_transfer",
  {
    token_id: "1",
    receiver_id: "bob.near"
  },
  undefined,
  1,
);
```

</TabItem>

<TabItem value="Paras" label="Paras">

```js
const tokenData = Near.call(
  "x.paras.near",
  "nft_transfer",
  {
    token_id: "490641",
    receiver_id: "bob.near"
  },
  undefined,
  1
);
```

</TabItem>

<TabItem value="Mintbase" label="Mintbase">

```js
const tokenData = Near.call(
  "thomasettorreiv.mintbase1.near",
  "nft_transfer",
  {
    token_id: "490641",
    receiver_id: "bob.near"
  },
  undefined,
  1
);
```

</TabItem>

</Tabs>
---
id: hardware-rpc
title: Hardware Requirements for RPC Node
sidebar_label: Hardware Requirements
sidebar_position: 1
description: NEAR RPC Node Hardware Requirements
---

This page covers the minimum and recommended hardware requirements for engaging with the NEAR platform as a RPC node.

For testing your RPC once the node is fully sync'd, see [this example RPC request.](https://docs.near.org/api/rpc/network#node-status)

## Recommended Hardware Specifications {#recommended-hardware-specifications}

| Hardware       | Recommended Specifications                                               |
| -------------- |--------------------------------------------------------------------------|
| CPU            | 8-Core (16-Thread) Intel i7/Xeon or equivalent with AVX support          |
| CPU Features   | CMPXCHG16B, POPCNT, SSE4.1, SSE4.2, AVX                                  |
| RAM            | 20GB DDR4                                                                 |
| Storage        | 1TB SSD (NVMe SSD is recommended. HDD will be enough for localnet only ) |

_Verify AVX support on Linux by issuing the command ```$ lscpu | grep -oh  avx```. If the output is empty, your CPU is not supported._


## Minimal Hardware Specifications {#minimal-hardware-specifications}

| Hardware       | Minimal Specifications                                                    |
| -------------- |---------------------------------------------------------------------------|
| CPU            | 8-Core (16-Thread) Intel i7/Xeon or equivalent with AVX support           |
| RAM            | 12GB DDR4                                                                 |
| Storage        | 500GB SSD (NVMe SSD is recommended. HDD will be enough for localnet only) |

_Verify AVX support on Linux by issuing the command ```$ lscpu | grep -oh  avx```. If the output is empty, your CPU is not supported._

## Cost Estimation {#cost-estimation}

Estimated monthly costs depending on operating system:

| Cloud Provider | Machine Size    | Linux                  |
| -------------- | --------------- | ---------------------- |
| AWS            | m5.2xlarge      | $330 CPU + $80 storage |
| GCP            | n2-standard-8   | $280 CPU + $80 storage |
| Azure          | Standard_F8s_v2 | $180 CPU + $40 storage |

<blockquote class="info">
<strong>Resources for Cost Estimation</strong><br /><br />

All prices reflect *reserved instances* which offer deep discounts on all platforms with a 1 year commitment

- AWS
  - cpu: https://aws.amazon.com/ec2/pricing/reserved-instances/pricing
  - storage: https://aws.amazon.com/ebs/pricing
- GCP
  - cpu: https://cloud.google.com/compute/vm-instance-pricing
  - storage: https://cloud.google.com/compute/disks-image-pricing
- Azure — https://azure.microsoft.com/en-us/pricing/calculator

</blockquote>

>Got a question?
<a href="https://stackoverflow.com/questions/tagged/nearprotocol">
  <h8>Ask it on StackOverflow!</h8></a>
NEAR Protocol BigQuery Public Dataset
NEAR FOUNDATION
September 22, 2023
NEAR Protocol is a user-friendly, carbon-neutral blockchain, built from the ground up to be performant, secure, and unparalleled scalability. In technical terms, NEAR is a layer one, sharded, proof-of-stake blockchain built with usability in mind. In simple terms, NEAR is a blockchain for everyone.

Today, we are excited to announce the NEAR BigQuery Public Dataset for anyone who wants to query blockchain data in an easy and cost-effective way.

Why BigQuery Public Dataset
Until now, a user’s data query needs were fulfilled by indexers. Those indexers were either supplied by NEAR Protocol or custom made. To build custom indexers required JSON files from the NEAR Lake storage layer to be transformed and loaded into a target database engine like PostgreSQL, and only then could a user execute queries against it. This approach is complex, time-consuming, and resource-draining. It requires constant monitoring to ensure databases have the most up-to-date information.
NEAR BigQuery Public Dataset changes this. It provides near real-time blockchain data that can be easily queried with SQL.

What we did
We built the NEAR LakeHouse in Databricks. The data is loaded into raw bronze files using Databricks Autoloader, and transformed with Databricks Delta Live Tables into cleaned and enriched silver tables following the Databricks Medallion Architecture. The silver tables are then copied into the GCP BigQuery Public Dataset ready for consumption.

The solution design
The code is open-source and can be found in our GitHub repository: near/near-public-lakehouse

To learn more about how to get started and the data available, please check our documentation:

https://docs.near.org/bos/queryapi/big-query

Benefits
NEAR instant insights: Historic on-chain data queried at scale.
Cost-effective: Eliminate the need to store and process bulk NEAR Protocol data; query as little or as much data as preferred.
Easy to use: No prior experience with blockchain technology is required; bring a general knowledge of SQL to unlock insights.
Conclusion
NEAR BigQuery Public Dataset  is now available for anyone wanting to harness blockchain data for their own needs. BigQuery can help not only developers, but broader audiences including: 

Users: Create queries to track NEAR Protocol assets, monitor transactions, or analyze on-chain events at a massive scale.
Researchers: Use indexed data for data science tasks, including on-chain activities, identifying trends, or feeding AI/ML pipelines for predictive analysis.
Startups: Use NEAR Protocol’s indexed data for deep insights on user engagement, smart contract utilization, or insights across tokens and NFT adoption.
Acknowledgments
We are grateful for the following contributors who helped us to deliver the NEAR BigQuery Public Dataset. 

NEAR Foundation/Pagoda: Eduardo Ohe, Pavel Kudinov, Jo Yang, Abhishek Anirudhan, Yad Konrad, Olga Telezhnaya, Bohdan Khorolets,Morgan McCauley, Ernesto Cejas Padilla, Rob Tsai, Damián Parrino. 
Google Cloud: Colleen Pimentel, Rodrigo de Freitas Vale, and Devan Mitchem.
Databricks: Clayton Martin, and Alice Zhang.
A Reminder to Migrate from NEAR Wallet
NEAR FOUNDATION
October 12, 2023
In July, NEAR Foundation published “Embracing Decentralization: What’s Next for the NEAR Wallet”, a detailed exploration of how Pagoda is migrating NEAR Wallet from being a browser wallet into a wallet hub. As we noted at the time, this wallet evolution illustrates the substantial growth of the NEAR ecosystem, which now offers a wide range of cross-chain wallets and native wallets. 

As part of this wallet evolution, the NEAR Wallet is set to be discontinued on January 1, 2024.

You can migrate to your wallet of choice using the automatic Wallet Transfer Wizard, integrated into the current NEAR Wallet, or manually by using your recovery phrase. Whichever path you choose, understand that your account and its assets are safe.

Do not worry if you have not transferred your accounts by January 1, 2024 — the Transfer Wizard will still be available after the wallet functionality sunsets. And again, rest assured that your assets will remain secure until you import them to a new wallet.

For more details on using  the Transfer Wizard, visit the Migrating from NEAR Wallet page.
Introducing Wallet Selector: A New Tool for the NEAR Ecosystem
COMMUNITY
April 7, 2022
Web3 users looking for an easy way to interact with the NEAR blockchain using their wallet of choice now have a slew of options. Wallet Selector, a new easy-to-navigate pop-up allows users to select their preferred wallet to easily interact with the NEAR protocol. 

Launched in March 2022 by the NEAR Foundation, this simple modal will appear whenever users are given the option to “Connect Wallet” to the NEAR blockchain. 

Wallet Selector provides developers and builders with new options to connect their projects to NEAR, and in future, will allow mobile apps to connect to the NEAR blockchain seamlessly in just a few clicks. 

NEAR Wallet Selector
Unlocking the wallet ecosystem 
At launch, Wallet Selector will feature three supported wallets: 

NEAR Wallet – a simple, easy to use web-based wallet. 
Sender Wallet – a browser extension available Chrome, Brave, and other browsers.
Ledger Wallet – the secure hardware wallet that allows users to store their wallet in a secure place. 
Meteor Wallet – the simple and secure wallet to manage your crypto, access DeFi, and explore NEAR.
Thanks to NEAR’s open and inclusive approach, other wallet developers will be able to contribute to the NEAR ecosystem.

Developers looking to add their wallets, there is documentation and instructions on the NEAR Github repository.
---
sidebar_position: 1
---

# Public Method Types

Methods can be called externally by using the `pub` identifier within the [`#[near_bindgen]` macro](../contract-structure/near-bindgen.md) which will expose the method in the compiled WASM bytecode.

It is important to only mark methods that should be called externally as public. If you need a contract to call itself, you can mark the function as public but add the [`#[private]` annotation](private-methods.md) so that it will panic if called from anything but the contract itself.

A basic usage of this would look like the following:

```rust
#[near_bindgen]
impl MyContractStructure {
    pub fn some_method(&mut self) {
        // .. method logic here
    }
}
```

Where this would expose `some_method` from the WASM binary and allow it to be called externally.

<details>
  <summary>Expand to see generated code</summary>

```rust
#[cfg(target_arch = "wasm32")]
#[no_mangle]
pub extern "C" fn some_method() {
    near_sdk::env::setup_panic_hook();
    if near_sdk::env::attached_deposit() != 0 {
        near_sdk::env::panic("Method some_method doesn\'t accept deposit".as_bytes());
    }
    let mut contract: MyContractStructure = near_sdk::env::state_read().unwrap_or_default();
    contract.some_method();
    near_sdk::env::state_write(&contract);
}
```
</details>

## Exposing trait implementations

Functions can also be exposed through trait implementations. This can be useful if implementing a shared interface or standard for a contract. This code generation is handled very similarly to basic `pub` functions, but the `#[near_bindgen]` macro only needs to be attached to the trait implementation, not the trait itself:

```rust
pub trait MyTrait {
    fn trait_method(&mut self);
}

#[near_bindgen]
impl MyTrait for MyContractStructure {
    fn trait_method(&mut self) {
        // .. method logic here
    }
}
```

In this example, the generated code will be the same as the previous example, except with a different method name.

<details>
  <summary>Expand to see generated code</summary>

```rust
#[cfg(target_arch = "wasm32")]
#[no_mangle]
pub extern "C" fn trait_method() {
    near_sdk::env::setup_panic_hook();
    if near_sdk::env::attached_deposit() != 0 {
        near_sdk::env::panic("Method trait_method doesn\'t accept deposit".as_bytes());
    }
    let mut contract: MyContractStructure = near_sdk::env::state_read().unwrap_or_default();
    contract.trait_method();
    near_sdk::env::state_write(&contract);
}
```
</details>
---
sidebar_position: 3
sidebar_label: Chunk
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# `Chunk` Structure

## Definition

`Chunk` of a [`Block`](block.mdx) is a part of a [`Block`](block.mdx) from a [Shard](shard.mdx). The collection of Chunks of the Block forms the NEAR Protocol [`Block`](block.mdx)

Chunk contains all the structures that make the Block:
- [Transactions](transaction.mdx)
- [Receipts](receipt.mdx)
- [ChunkHeader](#chunkheaderview)

## `IndexerChunkView`

<Tabs>
  <TabItem value="rust" label="Rust">

```rust links=1
pub struct ChunkView {
    pub author: AccountId,
    pub header: ChunkHeaderView,
    pub transactions: Vec<IndexerTransactionWithOutcome>,
    pub receipts: Vec<ReceiptView>,
}
```

  </TabItem>
  <TabItem value="typescript" label="TypeScript">

```ts links=1
export interface Chunk {
  author: string;
  header: ChunkHeader;
  transactions: IndexerTransactionWithOutcome[];
  receipts: Receipt[],
}
```

  </TabItem>
</Tabs>

## `ChunkHeaderView`

<Tabs>
  <TabItem value="rust" label="value">

```rust links=1
pub struct ChunkHeaderView {
    pub chunk_hash: CryptoHash,
    pub prev_block_hash: CryptoHash,
    pub outcome_root: CryptoHash,
    pub prev_state_root: StateRoot,
    pub encoded_merkle_root: CryptoHash,
    pub encoded_length: u64,
    pub height_created: BlockHeight,
    pub height_included: BlockHeight,
    pub shard_id: ShardId,
    pub gas_used: Gas,
    pub gas_limit: Gas,
    /// TODO(2271): deprecated.
    #[serde(with = "u128_dec_format")]
    pub rent_paid: Balance,
    /// TODO(2271): deprecated.
    #[serde(with = "u128_dec_format")]
    pub validator_reward: Balance,
    #[serde(with = "u128_dec_format")]
    pub balance_burnt: Balance,
    pub outgoing_receipts_root: CryptoHash,
    pub tx_root: CryptoHash,
    pub validator_proposals: Vec<ValidatorStakeView>,
    pub signature: Signature,
}
```

  </TabItem>
  <TabItem value="typescript" value="TypeScript">

```ts links=1
export interface ChunkHeader {
  balanceBurnt: number;
  chunkHash: string;
  encodedLength: number;
  encodedMerkleRoot: string;
  gasLimit: number;
  gasUsed: number;
  heightCreated: number;
  heightIncluded: number;
  outcomeRoot: string;
  outgoingReceiptsRoot: string;
  prevBlockHash: string;
  prevStateRoot: string;
  rentPaid: string;
  shardId: number;
  signature: string;
  txRoot: string;
  validatorProposals: ValidatorProposal[];
  validatorReward: string;
};
```

  </TabItem>
</Tabs>
```rust
#[near_bindgen]
impl Contract {
  #[payable]
  pub fn send_tokens(&mut self, receiver_id: AccountId, amount: U128) -> Promise {
    assert_eq!(env::attached_deposit(), 1, "Requires attached deposit of exactly 1 yoctoNEAR");

    let promise = ext(self.ft_contract.clone())
      .with_attached_deposit(YOCTO_NEAR)
      .ft_transfer(receiver_id, amount, None);

    return promise.then( // Create a promise to callback query_greeting_callback
      Self::ext(env::current_account_id())
      .with_static_gas(Gas(30*TGAS))
      .external_call_callback()
    )
  }

  #[private] // Public - but only callable by env::current_account_id()
  pub fn external_call_callback(&self, #[callback_result] call_result: Result<(), PromiseError>) {
    // Check if the promise succeeded
    if call_result.is_err() {
      log!("There was an error contacting external contract");
    }
  }
}
```
_This snippet assumes that the contract is already holding some FTs and that you want to send them to another account._
NEAR Ecosystem @ Korea BUIDL Week 2024
COMMUNITY
March 18, 2024
MARCH 26 – APRIL 2, 2024

As the sun rises in the east, a new dawn breaks for NEAR. Fresh from ETHDenver, where we planted a firm flag in the ground to own the Chain Abstraction narrative, the NEAR Ecosystem arrives at Korea BUIDL Week 2024 riding a wave of momentum and armed with exciting updates and alpha destined to reshape the blockchain landscape.

Chain Abstraction – a groundbreaking approach that abstracts away the complexities of different blockchain architectures – was a central focus for us at ETHDenver. We captivated attendees with live demonstrations, showcasing Chain Abstraction’s potential to enable developers to build seamlessly across multiple networks without the need for custom integrations or bridges.

By boldly staking our claim on this game-changing technology, we made a powerful statement at ETHDenver, signaling our intent to lead the charge in unlocking unprecedented levels of cross-chain communication and composability.

Now, as we descend upon Korea BUIDL Week, we are poised to take Chain Abstraction to the global stage, introducing this transformative narrative and its robust, developer-friendly tooling to an international audience of innovators, entrepreneurs, and industry leaders. 

Developers, builders, researchers, and enthusiasts – join us for a week of events as we continue to push the boundaries of what’s possible.

NEAR is Everything Everywhere All at Once at Korea BUIDL Week

We’re hitting the ground running with NEAR Foundation’s second Chain Abstraction Day (apply-to-attend) in our year long series, taking place March 26, 2024 during Korea BUIDL Week. We’re doubling down and taking everyone to the moon!

Our co-founder and CEO, Illia Polosukhin, will be dropping some major alpha at BUIDL Asia 2024, sharing insights into NEAR’s vision for Chain Abstraction and how it’s poised to unlock unprecedented levels of interoperability and composability across decentralized networks.
But that’s not all – we’re bringing the heat with dedicated workshops, content, and a massive hackathon bounty prize up for grabs at ETH Seoul, challenging the brilliant minds of the blockchain world to push the boundaries of Chain Abstraction. Developers, builders, and innovators: get ready to bring your A-game and compete for this lucrative reward.

Don’t miss your shot at NEAR’s massive hackathon bounty prizes at ETHSeoul – check out the link to see what lucrative rewards await the winners. Register for the hackathon today and let your skills shine on the global stage.
And if that’s not enough, NEAR is also proud to support SheFi Summit Seoul, empowering women builders in Web3. This groundbreaking event showcases the incredible female talent in our ecosystem, with NEAR women taking the stage to share their visionary work. 

Abstractooors, you won’t want to miss the fun!
# Math API

```rust
random_seed(register_id: u64)
```

Returns random seed that can be used for pseudo-random number generation in deterministic way.

###### Panics

- If the size of the registers exceed the set limit `MemoryAccessViolation`;

---

```rust
sha256(value_len: u64, value_ptr: u64, register_id: u64)
```

Hashes the random sequence of bytes using sha256 and returns it into `register_id`.

###### Panics

- If `value_len + value_ptr` points outside the memory or the registers use more memory than the limit with `MemoryAccessViolation`.

---

```rust
keccak256(value_len: u64, value_ptr: u64, register_id: u64)
```

Hashes the random sequence of bytes using keccak256 and returns it into `register_id`.

###### Panics

- If `value_len + value_ptr` points outside the memory or the registers use more memory than the limit with `MemoryAccessViolation`.

---

```rust
keccak512(value_len: u64, value_ptr: u64, register_id: u64)
```

Hashes the random sequence of bytes using keccak512 and returns it into `register_id`.

###### Panics

- If `value_len + value_ptr` points outside the memory or the registers use more memory than the limit with `MemoryAccessViolation`.