jcarbonnell/preTrainingNEAR huggingface dataset:
NEAR Day at ETHDenver: Ethereum Without Limits
COMMUNITY
January 20, 2023
ETHDenver is once again upon us. NEAR will be there with a full schedule of talks, panels, bounties, after parties, and more, exploring why NEAR is the place where mainstream adoption of the Open Web will happen. 

NEAR makes building and innovating on Web3 simple, secure, and scalable — all well before “The Merge”. Soon, anyone in the world—devs, founders, creators, and app users — will be able to create without limits. Join us on March 2nd for NEAR Day at ETHDenver — a 1-day mini summit on all things NEAR. From March 3rd to March 5th, join NEAR at ETHDenver for the Main Event and Hackathon.

Registering for NEAR Day is free. Sign up for a spot via the link below to meet people from the NEAR community and join the hackathon! To join NEAR Day at ETHDenver, you will also need an ETHDenver pass.

Why NEAR @ ETH Denver? 
With the Aurora EVM and Rainbow Bridge, the NEAR ecosystem is basically “Ethereum without limits”. While NEAR will be in attendance to help foster a decentralized multi-chain future, NEAR is showcasing why it’s the platform of choice for Web3 builders and onboarding the masses into the Open Web.

Register for NEAR Day at ETHDenver
Builders, creators, and entrepreneurs will find us at NEAR Day, a 1-day mini summit on ETHDenver’s Main Stage of the National Western Complex on March 2nd. From March 3rd – March 5th, find the NEAR ecosystem booth during ETHDenver and mingle with NEAR Devs, Community members, and others from the ecosystem.

To participate at NEAR Day, all you need to do is register via the link below and have an ETHDenver pass. ETHDenver is a free event. Register now to secure your spot and find out why NEAR is the easiest, most accessible, and scalable blockchain in Web3. Stay tuned for more details!

Register for NEAR Day
For the full schedule and information about NEAR Day at ETHDenver  as well as #BUIDLWEEK and Main Event, please visit our event page. Check out ETHDenver’s full schedule to learn more about featured NEAR sessions and more. 

Join the Hackathon
Join ETHDenver’s Hackathon and build on NEAR. Members of NEAR Foundation, Aurora, and other projects will be on-site to help onboard devs, creators, and entrepreneurs into NEAR and advise on building dApps. 

Building on NEAR is easy and fun, and you’ll instantly be part of a vibrant and supportive community. Let’s get you started!

Register for Hackathon
Notable Speakers at NEAR Day and ETHDenver
Catch a number of exciting NEAR speakers and sessions at NEAR Day and ETHDenver. The final list of participants and sessions is still being solidified. However, we do have some speakers to highlight. 

Illia Polusukhin – NEAR Co-founder, CEO of NEAR
Marieke Flament – CEO of NEAR Foundation
Alex Shevchenko – CEO of Aurora Labs
Alex Skidanov – NEAR Co-founder
Polina Aladina – OnMachina Co-Founder
Learn about our other speakers at the NEAR Day event page.
```bash
near view nearweek-news-contribution.sputnik-dao.near get_proposals '{"from_index": 9262, "limit": 2}'
```

<details>
<summary>Example response</summary>
<p>

```bash
[
  {
    id: 9262,
    proposer: 'pasternag.near',
    description: 'NEAR, a top non-EVM blockchain, has gone live on Router’s Testnet Mandara. With Router Nitro, our flagship dApp, users in the NEAR ecosystem can now transfer test tokens to and from NEAR onto other supported chains. $$$$https://twitter.com/routerprotocol/status/1727732303491961232',
    kind: {
      Transfer: {
        token_id: '',
        receiver_id: 'pasternag.near',
        amount: '500000000000000000000000',
        msg: null
      }
    },
    status: 'Approved',
    vote_counts: { council: [ 1, 0, 0 ] },
    votes: { 'brzk-93444.near': 'Approve' },
    submission_time: '1700828277659425683'
  },
  {
    id: 9263,
    proposer: 'fittedn.near',
    description: 'How to deploy BOS component$$$$https://twitter.com/BitkubAcademy/status/1728003163318563025?t=PiN6pwS380T1N4JuQXSONA&s=19',
    kind: {
      Transfer: {
        token_id: '',
        receiver_id: 'fittedn.near',
        amount: '500000000000000000000000',
        msg: null
      }
    },
    status: 'InProgress',
    vote_counts: { 'Whitelisted Members': [ 1, 0, 0 ] },
    votes: { 'trendheo.near': 'Approve' },
    submission_time: '1700832601849419123'
  }
]
```

</p>

</details>
---
title: Essentials
description: A brief overview of some essential tools to get started with NEAR
sidebar_position: 5
---

# Essentials
----

:::info on this page
* Wallets
* Exploring the NEAR blockchain
* Development on NEAR
:::

There are a lot of ways to interact with both NEAR protocol and the NEAR token.
While the number of tools that can interface with NEAR for different use-cases is always growing, we're going to look at a short list of essential tools to help you start using NEAR. 

In addition to the tools listed below, you can also find additional resource in the [support](/development/tools-infrastructure.md) section of this wiki

## NEAR Wallet

The [MyNEARWallet](https://app.mynearwallet.com/) serves as an entry-point to using NEAR. 
It is a non-custodial, web-based wallet for the NEAR blockchain.
It allows you to send and receive NEAR, stake NEAR, and create NEARdrops to easily onboard new people on NEAR.
Check out our guide to [creating a NEAR wallet](overview/tokenomics/creating-a-near-wallet.md)

## NEAR Explorer

[NEAR Explorer](https://explorer.near.org/) is an online blockchain browser which displays information about nodes, blocks, addresses, and transactions on NEAR.
The NEAR Explorer gives you information about how many nodes are online, how many nodes are validating blocks, how much NEAR each node is staking, how many delegators they have, and what their fee is.
It also gives you a historical look at [statistics](https://explorer.near.org/stats) about the NEAR protocol.

You can find detailed information about the latest block, and the latest transaction.
Alternatively, you can search for a specific block hash, or transaction hash to find out more about them.
Additionally, you can search for a specific account address to find out more about it.

## Command Line Interface (CLI)

The [NEAR CLI](https://github.com/near/near-cli) is a Node.js command line interface that allows you to interface with the NEAR blockchain from the command line.
You can use it for more granular control over common NEAR functions including:

- Creating an account
- Starting transactions
- Deploying smart contracts
- Querying transactions
- Finding information about validators

For more information about the CLI, [check out our developer documentation](https://docs.near.org/tools/near-cli)
NEARCON Returns: Here’s Everything You Need to Know So Far
NEAR FOUNDATION
June 15, 2023
Last year’s NEARCON was epic. NEARCON 2023 will be iconic. 

While all of you have been diligently building NEAR into one of the best ecosystems in the blockchain world, NEAR Foundation has been planning a 4-day journey into an open web. 

Let’s take a quick look at everything we have to share (so far). 

What to expect at NEARCON 2023
For this year’s NEARCON, we’re expanding. There will be two venues — NEARCON HQ and Hack HQ. 

Most of the action will happen at NEARCON HQ. But if you’re a hacker, or just like hanging with them, you can do that at Hack HQ.

At NEARCON, you can expect to:

Join 5,000+ delegates as we explore the power and possibilities of an open web
Encounter a diverse melting pot of creators, builders, policy makers, and more — you’ll even find the rare thought leader in their natural environment
Get inspired by talks from renowned authors, economists, artists, politicians, VCS, developers, entrepreneurs, and more
Explore the Blockchain Operating System (BOS), try it for yourself, and find out why it’s the driving force behind an open web 
Connect with projects, speakers, community members, builders, and multi-chain enthusiasts from around the world
Hack the days and nights away for a chance to build on the BOS and win $180+k   
And experience so much more that you’ll be looking around and asking yourself, “What bear market?” 
Get your early bird tickets now!
NEARCON 2023 tickets are $20 off until July 1. So, don’t wait — snag your ticket for $79 now because after July 1st they are $99. 

NEAR Foundation is also offering another deal. If you refer 4 friends to NEARCON 2023, you will get a special gift upon check-in at the conference. 

Become a Speaker or Sponsor
Thinking about becoming a NEARCON speaker? We’d love to hear from you. 

Speaking spots always go fast, so make haste. Apply to speak at NEARCON here. 

Psstt… we’re looking for technical applications that don’t just shill but highlight problems being solved — on the BOS and the wider open web. 

Apply for the Hackathon and get in for free
NEAR and NEARCON loves its hackers. And to show it, we’ve made it so that any builder or developer who applies for the hackathon gets in for free. 

Find more information about the NEARCON 2023 hackathon here.
---
id: callbacks
title: Cross-Contract Calls
---

While writing cross-contract calls there is a significant aspect to keep in mind: all the calls are **independent** and **asynchronous**. In other words:

- The method in which you make the call and method for the callback are **independent**.
- Between the call and the callback, people could interact with the contract.

This has important implications on how you should handle the callbacks. Particularly:

1. Your callback method needs to be public, but you want to make sure only your contract can call it.
2. Make sure you don't leave the contract in a exploitable state between the call and the callback.
3. Manually rollback any changes to the state in the callback if the external call failed.

---

## Private Callbacks
In order for your contract to call itself when a cross-contract call is done, you need to make the callback method public. However, most of the times you would want it to be private. You can make it private while keeping it public by asserting that the `predecessor` is `current_account`. In rust this is done automatically by adding the `#[private]` decorator.

---

## User's Money
When a method panics, the money attached to that transaction returns to the `predecessor`. This means that, if you make a cross-contract call and it fails, then the money **returns to your contract**. If the money came from a user calling your contract, then you should transfer it back during the callback.

![img](https://miro.medium.com/max/1400/1*Hp4TOcaBqm9LS0wkgWw3nA.png)
*If the user attached money, we need to manually return it in the callback*

:::caution
Make sure you pass have enough GAS in the callback to make the transfer
:::

---

## Async Callbacks
Between a cross-contract call and its callback **any method of your contract can be executed**. Not taking this into account is one of the main sources of exploits. It is so common that it has its own name: reentrancy attacks.

Imagine that we develop a `deposit_and_stake` with the following **wrong logic**: (1) The user sends us money, (2) we add it to its balance, (3) we try to stake it in a validator, (4) if the staking fails, we remove the balance in the callback. Then, a user could schedule a call to withdraw between (2) and (4), and, if the staking failed, we would send money twice to the user.

![img](https://miro.medium.com/max/1400/1*VweWHQYGLBa70uceiWHLQA.png)
*Between a cross-contract call and the callback anything could happen*

Luckily for us the solution is rather simple. Instead of immediately adding the money to our user’s balance, we wait until the callback. There we check, and if the staking went well, then we add it to their balance.

![img](https://miro.medium.com/max/1400/1*o0YVDCp_7l-L3njJMGhU4w.png)
*Correct way to handle deposits in a cross-contract call*
NEAR Announces $800 Million in Funding Initiatives To Support Ecosystem Growth
NEAR FOUNDATION
October 25, 2021
The NEAR ecosystem is announcing a monumental $800 million in funding initiatives targeted at accelerating growth. 

The announcement, which includes the $350 million in funding announced by Proximity Labs last week – reported in Bloomberg – is designed to build on the momentum in the NEAR ecosystem over the last 12 months. 

While NEAR is giving all communities access to this record amount of funding, it will be focusing on Decentralized Finance (DeFi) teams who are actively revolutionizing and reimagining the way we interact with money. 

DeFi projects on NEAR have already hit a significant milestone of more than $150M Total Value Locked (TVL). NEAR has an ambitious goal to grow that number quickly and securely. NEAR is also actively looking for projects focused on NFTs, DAOs, and gaming. 

NEAR’s next chapter is all about fostering growth by helping developers access best-in-class support and providing users with a frictionless experience using and navigating the web3 world. New funding helps accelerate this process.

NEAR levels up 
Of the $800 million in funding, $100 million will be allocated to Startup Grant Pools. More than 20 startups will be identified and given $5M each in funding to redistribute to key stakeholders – the ecosystem ultimately decides who gets funding. 

Some $250 million will be allocated to ecosystem grants helping existing projects further develop and scale. The remaining $100M will be allocated to Regional Funds: money allocated to foster the development of NEAR’s largest community regions in Asia, Europe, and the US.  

Prior to this announcement, NEAR had already spent $45M across more than 120 projects, including Core Protocol Infrastructure Grants to the likes of: 

Textile
Liquality
CronCat 
Kurtosis 
The Grain Programming Language 
The sleeping giant awakes 
NEAR has been building on its roadmap steadily and securely. Later this year, it will launch the next phase sharding, nicknamed Simple Nightshade. NEAR will go from one to four shards, increasing scalability while not compromising on simplicity. Developers won’t have to add any additional code to smart contracts or adjust their platforms and users will continue to experience the same great UX, but at faster speeds. 

Once complete, NEAR will be decentralizing further by lowering the barrier to entry to its validator network, increasing the number of validators first to 100, and then to a few hundred in Q1 2022. As part of this process, there will be further funding to projects helping the rollout and development of NEAR’s sharding technology. 

Stay tuned for more information.
---
title: Contact Us
description: How to contact humans working on NEAR.
sidebar_position: 4
---

NEAR is primarily community centered, so the best way to contact somebody with knowledge about NEAR when you have questions or suggestions is within the NEAR community:

- [Discord](https://discord.com/invite/UY9Xf2k)
- [Telegram](https://t.me/cryptonear)
- [NEAR Forum](https://gov.near.org/)

Alternatively, if you need to contact somebody at NEAR Foundation and the community links above weren't helpful you drop us an [email](mailto:hello@near.foundation).

If you are encountering issues with your wallet, you can open a [support ticket here](https://nearhelp.zendesk.com/hc/en-us).

**NEAR Foundation Address**

NEAR Foundation

Chamerstrasse 12C

6300 Zug
```js
const nftTokenId = "1";

Near.call([{
  contractName: nftContract, 
  methodName: 'nft_transfer_call', 
  args: {
    receiver_id: keypomContract,
    token_id: nftTokenId,
    msg: dropId.toString()
  },
  deposit: "1",
  gas: "300000000000000"
}]);
```
Architecture of a distributed music streaming application
COMMUNITY
April 10, 2020
In our Reddit/r/NEARProtocol AMA with Audius’s CEO on April 10th, 2020, we will discuss the opportunities for musicians to monetize on blockchain applications better.

Disclaimer: Audius is not built using NEARProtocol. Our discussion is in the spirit of support to our musicians.

Introduction
Right now, most of the profits in the music industry are going to music labels. Musicians are left with 12% of total profits. Historically, music labels have existed for two reasons: music production and music distribution. Both have changed dramatically in recent times. The cost of producing an album was as high as $1m during the 1980s but has been drastically reduced to only $10k per album. As a result, many musicians are choosing the route of DIY publishing which allows them to skip the label. 

Music distribution was usually facilitated via music labels working directly with physical stores and PR to push their music to customers. This dramatically changed with the advent of the Internet, which allows anyone to upload their music. However, the increased accessibility also makes it more difficult for artists to get discovered. Spotify, which provides distribution for labels in the online realm, primarily serves the interest of labels. For every million streams, a band only receives $6,000. Additionally, labels are still in control over what people see since social sharing is limited. 

Can we create a place that serves both as a place to discover new music while at the same time changes the economy behind the content? If yes, where do we start?

Solution
We should be able to provide something valuable to musicians upfront and enable economics for the service later.

For example, a decentralized content platform would allow musicians to share re-used work of other musicians. 

Even though music labels wouldn’t be on board with such a platform, it would provide much value for musicians since it will be the only service of it’s kind on the Internet.

Such a prototype should be able to do the following: 

Store music on decentralized storage nodes
Have a record of all of the listens, likes, shares, and other engagement metrics, so everything is tracked
As the economy is enabled on top of this service later, it will be easy to attribute payouts
Allow people to share the music with each other
Why Blockchain?
The metadata attribution remains safe, verifiable, and immutable due to the decentralization of the network. Blockchain technology ensures that artists get paid safely and instantly as consumers listen to content. Blockchain also allows them to digitize music licenses in the form of a smart contract.
# Bindings Specification

This is the low-level interface available to the smart contracts, it consists of the functions that the host (represented by
Wasmer inside near-vm-runner) exposes to the guest (the smart contract compiled to Wasm).

Due to Wasm restrictions the methods operate only with primitive types, like `u64`.

Also for all functions in the bindings specification the following is true:

- Method execution could result in `MemoryAccessViolation` error if one of the following happens:
  - The method causes host to read a piece of memory from the guest but it points outside the guest's memory;
  - The guest causes host to read from the register, but register id is invalid.

Execution of a bindings function call result in an error being generated. This error causes execution of the smart contract
to be terminated and the error message written into the logs of the transaction that caused the execution. Many bindings
functions can throw specialized error messages, but there is also a list of error messages that can be thrown by almost
any function:

- `IntegerOverflow` -- happens when guest passes some data to the host but when host tries to apply arithmetic operation
  on it it causes overflow or underflow;
- `GasExceeded` -- happens when operation performed by the guest causes more gas than the remaining prepaid gas;
- `GasLimitExceeded` -- happens when the execution uses more gas than allowed by the global limit imposed in the economics
  config;
- `StorageError` -- happens when method fails to do some operation on the trie.

The following binding methods cannot be invoked in a view call:

- `signer_account_id`
- `signer_account_pk`
- `predecessor_account_id`
- `attached_deposit`
- `prepaid_gas`
- `used_gas`
- `promise_create`
- `promise_then`
- `promise_and`
- `promise_batch_create`
- `promise_batch_then`
- `promise_batch_action_create_account`
- `promise_batch_action_deploy_account`
- `promise_batch_action_function_call`
- `promise_batch_action_transfer`
- `promise_batch_action_stake`
- `promise_batch_action_add_key_with_full_access`
- `promise_batch_action_add_key_with_function_call`
- `promise_batch_action_delete_key`
- `promise_batch_action_delete_account`
- `promise_results_count`
- `promise_result`
- `promise_return`

If they are invoked the smart contract execution will panic with `ProhibitedInView(<method name>)`.
```js
import { Wallet } from './near-wallet';

const TOKEN_CONTRACT_ADDRESS = "token.v2.ref-finance.near";
const wallet = new Wallet({ createAccessKeyFor: TOKEN_CONTRACT_ADDRESS });
 
await wallet.callMethod({
  method: 'ft_transfer',
  args: {
    receiver_id: 'alice.near',
    amount: '100000000000000000',
  },
  contractId: TOKEN_CONTRACT_ADDRESS,
  deposit: 1
});
```

_The `Wallet` object comes from our [quickstart template](https://github.com/near-examples/hello-near-examples/blob/main/frontend/near-wallet.js)_
---
id: node-types
title: Node Types
sidebar_label: Node Types
sidebar_position: 2
description: Types of NEAR Nodes
---

You can run three different types of node - Validator Node, RPC Node, and Archival Node.

### Validator Node {#validator-node}

Validator nodes are the operators of the NEAR blockchain and are essential to the health of the network. Validator nodes participate in the consensus and produce blocks and/or chunks. You can see a real-time view of NEAR network validator nodes on the [NEAR Explorer](https://explorer.near.org/nodes/validators).

### RPC Node {#rpc-node}

RPC nodes are RPC service providers that provide public RPC endpoints for developers to use. The NEAR Foundation currently maintains a public RPC endpoint `http://rpc.mainnet.near.org/` that is free for everyone to use. However, any participants are encouraged to run their own RPC node and offer RPC services through [an Open Source & Public Goods grant from the NEAR Foundation](https://near.org/blog/refining-near-foundations-grant-approach/). For more information, please check out Community section in the documentation and reach out in the Validator Channels on [Discord](https://discord.gg/ZMPr3VB) and on [Telegram](https://t.me/near_validators).

### Archival Node {#archival-node}

Archival nodes store full blockchain data, and build an archive of historical states. These nodes are useful for block explorers, chain analysis, and infrastructure providers.

See [API Setup](https://docs.near.org/api/rpc/setup) section for archival RPC nodes endpoints.

> Got a question?
> <a href="https://stackoverflow.com/questions/tagged/nearprotocol">
> <h8>Ask it on StackOverflow!</h8></a>