jcarbonnell/preTrainingNEAR huggingface dataset:
Berklee College of Music Partners with NEAR Foundation to Build Music Licensing Platform
NEAR FOUNDATION
November 2, 2023
Berklee College of Music, the largest independent college of contemporary music and performing arts in the world, announced today a partnership with the NEAR Foundation to help build a music licensing platform. 

The agreement, which will harness NEAR Protocol’s easy-to-use tech stack, will lead to the creation of a marketplace where musicians can upload their music, and creators can license music from the students of this world-class music institution. 

The project will be released under an app called RAIDAR, which stands for Rights and Asset Information in Decentralized, Authoritative Repositories. Thanks to NEAR’s Web3 technology, all transactions will be recorded on the NEAR blockchain, ensuring a creators’ rights and representation are recorded on-chain. 

Behind Berklee’s music licensing app, built on NEAR
RAIDAR will use smart contracts to disintermediate the licensing process and ensure that musicians receive the full economic value and credit for their works. 

“This is a first of its kind product that will help to democratize the world of music by putting creators first and ensuring they are always rewarded and protected from exploitation for their original work,” says George Howard, Distinguished Professor of Music Business at Berklee. 

“Those who are seeking to license music for their projects now have a chance to access and support new creators by tapping into an exciting marketplace through the RAIDAR app, which is easy to navigate and offers a safe and reliable way to pay for music.”

RAIDAR — simple to use, accessible to all
The product is designed to be simple to use, which is a cornerstone of building on the NEAR Protocol. Musicians simply upload their music files and relevant metadata through a mobile- and desktop-friendly web app. 

Their song is then represented by a unique, secure smart contract and assigned to the creator’s wallet as an asset or NFT, empowering the creator to view and showcase the song, wherever they go.  

On the customer side, users can browse, search, and preview songs uploaded to the RAIDAR app and purchase single-use licenses for songs via the app. The song’s smart contract distributes funds received from the payment to the song’s creator. After the purchase transaction completes, the buyer receives an email with the corresponding song download link and a copy of the license agreement.

“We are extremely excited to be working with Berklee to support a new and unique use case that has real world value for those that use it,” says  Chris Donovan, CEO of the NEAR Foundation. 

“The RAIDAR app is a disruptive technology built on NEAR  that will help students to explore the power of smart contracts to ensure they are being paid fairly for their work, and that the world of music becomes more inclusive, safe and exciting for everyone.”
```js
import { Wallet } from './near-wallet';

const KEYPOM_CONTRACT_ADDRESS = "v2.keypom.near";
const NFT_CONTRACT_ADDRESS = "nft.primitives.near";
const NFT_TOKEN_ID = "1";
const DROP_AMOUNT = "10000000000000000000000";

const nftConnectedWallet = new Wallet({ createAccessKeyFor: NFT_CONTRACT_ADDRESS }); 

await wallet.callMethod({
  method: "nft_transfer_call",
  contractId: NFT_CONTRACT_ADDRESS,
  args: {
    receiver_id: keypomContract,
    token_id: nftTokenId,
    msg: dropId.toString()
  },
  deposit: 1,
  gas: "100000000000000",
});
```

_The `Wallet` object comes from our [quickstart template](https://github.com/near-examples/hello-near-examples/blob/main/frontend/near-wallet.js)_
---
id: get-started
---

# Getting Started

## Install Rust and Wasm toolchain

Follow [these instructions](https://doc.rust-lang.org/book/ch01-01-installation.html) for setting up Rust.

To install Rust on Linux or MacOS, use the following command:

```bash
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

source $HOME/.cargo/env
```

Then, add the `wasm32-unknown-unknown` toolchain. This toolchain is required because the contracts that we will build will be compiled to [Wasm](https://webassembly.org/) to run on the NEAR blockchain.

```bash
rustup target add wasm32-unknown-unknown
```

## Create a new project

The best way to create a new NEAR app connected with a frontend is through [create-near-app](https://github.com/near/create-near-app). When initializing the project, your option are `npx create-near-app <projectName> [--frontend next|vanilla|none] [--contract rs|ts|none --tests rs|ts|none]`. 

```bash
npx create-near-app my-project --contract rs --frontend none --tests rs
```

If you only wish to develop and deploy a Rust contract, the [status message example](https://github.com/near-examples/rust-status-message) is great to use as a template or through [cargo-generate](https://github.com/cargo-generate/cargo-generate).

To initialize a new project with `cargo-generate`, run the following commands:

```bash
cargo install cargo-generate --features vendored-openssl

cargo generate --git https://github.com/near-examples/rust-status-message --name my-project
cd my-project
```

If you would like to generate a new crate manually with `cargo new --lib <crate-name>`, make sure you include the following configuration in the generated `Cargo.toml`:

```toml
[dependencies]
near-sdk = "4.0.0"

[lib]
crate-type = ["cdylib"]

[profile.release]
codegen-units = 1
# Tell `rustc` to optimize for small code size.
opt-level = "z"
lto = true
debug = false
panic = "abort"
# Opt into extra safety checks on arithmetic operations https://stackoverflow.com/a/64136471/249801
overflow-checks = true
```
---
id: intro
title: Moving from Web 2 to Web 3
sidebar_label: Introduction
---

by Sigma Software

>DISCLAIMER. All references to particular products, frameworks, solutions, libraries and other software of NEAR ecosystem are provided for educational purposes only. All product names, logos, brands, trademarks and registered trademarks are property of their respective owners. Use of these names, trademarks and brands throughout the document does not imply endorsement.

## Introduction

In this guideline we’ll see how to bring a traditional Web 2 application into a Web 3 world using NEAR Protocol.

It’s written for developers who are just starting their journey into the world of Web 3 and Blockchain, so we’ll start by explaining what Web 3 and blockchain are. Then, we’ll explore how to build decentralized applications (dApps) using NEAR Protocol. And after we’ve learned the basics, we’ll guide you through the intricacies of fusing client applications, traditional web servers and the NEAR blockchain.

During our journey we’ll focus on high-level decisions, architecture, and explore not just HOW to do something, but also WHY it’s done this way. And as with anything, there’s no single right way, so we’ll explore different alternatives and help you to choose the right one. 

Of course, real world applications aren’t built with words, but with code, so links to numerous code examples will be provided. But to make it as useful as possible, this guideline itself will be kept implementation and technology agnostic whenever possible.

If you are already familiar with Web 3 and blockchains, feel free to skip to the [NEAR Protocol section](near.md). And if you are already quite comfortable with NEAR, you can jump straight ahead into the [NFTs for Web 2 Applications](nfts.md) chapter, where we’ll guide you on how to connect Web 2 and the NEAR blockchain together to bring the full power of NFTs into your app.

Without further ado, let’s begin our journey!
---
id: introduction
sidebar_label: Home
title: NEAR RPC API
---

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

The RPC API allows you to communicate directly with the NEAR network. For example,
tools such as [near-api-js](/tools/near-api-js/quick-reference) are just abstractions making RPC calls.

<hr className="subsection" />

## RPC Providers

There are multiple [RPC providers which you can choose from](./providers.md). These providers will work as intermediaries to help you interact with the NEAR network.

<hr className="subsection" />

## NEAR RPC - Quick Links

| API                                                 | Description                                                                  |
|-----------------------------------------------------|------------------------------------------------------------------------------|
| [Access Keys](/api/rpc/access-keys)                 | Retrieve information about an account's access keys.                         |
| [Accounts / Contracts](/api/rpc/contracts)          | View details about accounts and contracts as well as perform contract calls. |
| [Block / Chunk](/api/rpc/block-chunk)               | Query the network and get details about specific blocks or chunks.           |
| [Gas](/api/rpc/gas)                                 | Get gas price for a specific block or hash.                                  |
| [Protocol](/api/rpc/protocol)                       | Retrieve current genesis and protocol configuration.                         |
| [Network](/api/rpc/network)                         | Return status information for nodes and validators.                          |
| [Transactions](/api/rpc/transactions)               | Send transactions and query their status.                                    |
| [Maintenance Windows](/api/rpc/maintenance-windows) | Query the maintenance windows in current epoch for a validator.              |

:::tip
You can access the JSON RPC 2.0 endpoints using [Postman](/api/rpc/setup#postman-setup),
[JavaScript](/api/rpc/setup#javascript-setup), and [HTTPie](/api/rpc/setup#httpie-setup).
:::
---
sidebar_position: 2
---

# Reproducible Builds
Reproducible builds let different people build the same program and get the exact same outputs as one another. It helps users trust that deployed contracts are built correctly and correspond to the source code. To verify your contract user can build it themselves and check that the binaries are identical.

## Problem
If you will build your contract on two different machines, most likely you will get two similar but not identical binaries. Your build artifact can be affected by the locale, timezone, build path, and billion other factors in your build environment. Rust community has a long story of fighting this issue but still, [it is not achieved yet](https://github.com/rust-lang/rust/labels/A-reproducibility).

## CI solution
We recommend you to build your contracts with the use of our [Contract Builder](https://github.com/near/near-sdk-rs/tree/master/contract-builder). It's is using Docker, controlled and sharable environment that can be used by both you and your users. Docker image is available [here](https://hub.docker.com/r/nearprotocol/contract-builder). The contract built in it will result in a binary that is the same if built on other machines.
NEAR and Galxe Team Up for SPACE ID Voyage Season 2
NEAR FOUNDATION
June 8, 2023
NEAR Foundation and Galxe —the  leading platform for Web3 community building — are joining forces to provide new and existing Web3 users with a seamless onboarding experience for SPACE ID’s renewed referral program, “Voyage Season 2 – Calling”. 

This new partnership is significant, as Galxe is the first major Web3 partner launching a component on NEAR’s Blockchain Operating System (BOS). The BOS is an OS on which developers can effortlessly build and distribute chain-agnostic, decentralized apps and experiences on the  Open Web.  

SPACE ID is a universal name service network with a one-stop identity platform to discover, register, trade, and manage Web3 domains. It also includes a Web3 Name SDK & API for developers across blockchains and provides a multi-chain name service for everyone to easily build and create a web3 identity. Established in the third quarter of 2022, SPACE ID quickly took the market by storm with its .bnb domain name service, as well as more recently with .arb name service. 

How the BOS will power the SPACE ID Voyage decentralized frontend
NEAR’s BOS will be powering the decentralized frontend for SPACE ID’s Voyage, a referral program where users invite others to register a .bnb or .arb address and earn special Voyage Boxes in return. Starting on June 7th, users will be able to participate in Space ID’s Voyage program through near.org and register .bnb names — enjoying a seamless, one-stop, decentralized experience powered by BOS. 

Before the BOS integration, participating in quests like Voyage could be a complicated process. Users had to navigate through multiple pages, going back and forth to sign-in, register a domain, check eligibility, and claim rewards separately. A tech stack for decentralized and user-friendly frontends, BOS enables a unified interface where users can do all of the above with a single sign-in — directly in-app — so that users never have to leave the page on which they started.

How SPACE ID uses BOS’s composable components
The BOS components for SPACE ID are created independently and composed inside another composite component. This, in and of itself, clearly demonstrates the true composability strengths of BOS. 

And thanks to BOS’s permissionless nature, developers are able to fork the components and embed them into their BOS components or websites. Users are then able to view the source code for each of the these components both on-chain and in-browser — improving transparency and security at every step of the user journey. 

Discover Galxe’s exciting SPACE ID Campaign today. Register a .bnb domain name and claim a Voyage Box today on near.org. 

Stay tuned for more exciting NEAR Foundation and Galxe campaigns to come — powered by BOS!
```js
const accountId = context.accountId ?? props.accountId;
const keypomContract = "v2.keypom.near";
const nftContract = "nft.primitives.near";
const nftTokenId = "1";
const dropAmount = "10000000000000000000000";

Near.call([
  {
    contractName: keypomContract,
    methodName: "create_drop",
    args: {
      public_keys: state.publicKeys,
      deposit_per_use: dropAmount,
      fcData: {
        // 2D array of function calls. In this case, there is 1 function call to make for a key use
        // By default, if only one array of methods is present, this array of function calls will be used for all key uses
        methods: [
          // Array of functions for Key use 1. 
            [{
              receiverId: nftContract,
              methodName: "nft_mint",
              args: JSON.stringify({
              // Change this token_id if it already exists -> check explorer transaction
                  token_id: nftTokenId,
                  metadata: {
                    title: "My NFT drop",
                    description: "",
                    media: "",
                  }
              }),
              accountIdField: "receiver_id",
              // Attached deposit for when the receiver makes this function call
              attachedDeposit: "10000000000000000000000"
            }]
        ]
      }
    },
    deposit: "23000000000000000000000", // state.publicKeys.length * dropAmount + 3000000000000000000000,
    gas: "100000000000000",
  },
]);
```
---
sidebar_position: 1
---

# Essential Syntax

This document describes the essential syntax required for creating Components to run on the BOS Web Engine. All BOS developers should familiarize themselves with the contents of this document.

## Component Export

Every BWE component must have a valid export. This can be a named export where the name is `BWEComponent` or a default export. If you are not opinionated about your exports, we recommend following the example set by the boilerplate code generated in the sandbox.

## Component IDs

When embedding multiple instances of the same BWE Component at the same level within a parent Component, each child must be given an explicit ID in order for the engine to differentiate between them during renders. This is similar to the `key` prop in React, but is separately required by BOS Web Engine.

A very common use case where this is encountered is when rendering a `Component` within a `.map()` call on an array of data.

As a best practice, we recommend new Components be written with a meaningful `id` value to avoid potential collisions in the
future.

### Examples

Assuming we have an import of `import Child from near://bwe-demos.near/Child`:

---

```jsx
<Child />
```
✅
The automatically generated ID is sufficient to identify a single child Component.

---

```jsx
<Child />
<Child id="2nd" />
```
✅
The second Component has an explicit `id` value, preventing any collisions. While this does work, it would be much less brittle
if both child Components had unique `id` values.

---

```jsx
<Child id="1st" />
<Child id="2nd" />
```
✅✅
Ideal, makes future maintenance easier.

---

```jsx
<Child />
<Child />
```
❌ 
Without unique `id` values, child Components cannot be differentiated by the outer application.

---

<details>
  <summary>More Details</summary>
  <p>To ensure Components are uniquely addressable by the application, BOS Web Engine uses a Component's ancestors' path names as a prefix to create a base Component ID. So for a child Component `Child` under `Parent`, which in turn is a child under `Root`, the base Component ID would include a concatenation of `Child>Parent>Root`.</p>
<p>Rendering multiple instances of the same Component under the same Parent should be considered undefined behavior.</p>
</details>
Octopus Network Seed Funding Round Complete
COMMUNITY
April 2, 2021
Octopus Network Announcement: Seed Funding Round Complete!
The Octopus Network Team recently announced the completion of a seed-funding round for building out the base level infrastructure of Octopus Network. The $3 million dollars fundraise includes capital from deep-crypto venture firms including: 

D1 Ventures
SevenX Ventures
Puzzle Ventures
PNYX Capital
Electric Capital
Ascensive Assets
Origin Capital
ZMT Capital
Bixin
OKEx Block Dream Fund
Spark Digital
ChainX
Stafi
NGC Ventures 
Prior to this seed round, Octopus had received a $1 million dollar strategic investment from the NEAR Foundation. In context this fundraise is a strong vote of confidence in both the future of appchains, as well as NEAR Protocol. 

The Early Days of Appchains on NEAR: Octopus in Context
An Appchain is a decentralized Web3.0 application in the form of an independent blockchain. Octopus Network provides appchains with flexible on-demand shared security, out-of-the-box cross-chain interoperability, and infrastructure services including blockchain explorers, API endpoint, indexers, etc. In short, Octopus Network allows for projects to quickly and efficiently customize and launch their own blockchain, without needing to source all of the features required to maintain that blockchain. 

By reducing the capital expenditure for publishing and launching an Appchain by two orders of magnitude – from millions of dollars to tens of thousands dollars – Octopus Network is preparing to unleash a new wave of innovation in Web3.0 applications. 

On Octopus Network the next generation of Web 3.0 applications can develop in a cost-effective, scalable, and secure manner. The $3 million dollar seed round fundraise for Octopus is the first step of an inevitable software revolution. To stay up to date with Octopus Network and the many different appchains preparing to deploy on Octopus, follow the team on Discord and Twitter! 

If you’re a developer who wants to see what building on NEAR is all about, check out the NEAR documentation to get started.
NEAR joins FlamingoDAO 🦩
COMMUNITY
October 30, 2020
A new future for digital property is beginning — one that promises to help reduce the distortions of the first Internet wave and ensure greater compensation for creators across the globe. This is done through non-fungible tokens (NFTs), which are set to transform culture and serve as an anchor for the first generation of digital property. 

 

NFTs are unique, non-interchangeable digital assets that live on a blockchain. Most blockchain enthusiasts were introduced to NFTs in 2017, when CryptoKitties became so popular it slowed down the entire Ethereum network. But NFTs in 2020 have grown into so much more than digital cats. Today, NFTs are music samples, digital paintings, memes, digital land, event tickets, etc. The list goes on. For the first time in history, digital creators have a way to properly monetize their assets and make a living.

 

The Flamingo DAO is a new initiative by The LAO that takes on the “hive mind” approach of decentralization to support the ever-growing NFT ecosystem. Flamingo is unique because it operates as a community-driven collective of members that will make decisions to support the NFT ecosystem. The LAO is behind the idea of Flamingo and already has experience supporting projects such as Aavegotchi and Shell Protocol.

 

The NEAR Foundation is thrilled to announce that it has joined the Flamingo DAO as a formal participant. NiMA Asghari will be the representative on behalf of the NEAR Community Council. As a collective, Flamingo will invest in digital properties and push the boundaries of NFTs, DeFi, fractionalization, metaverses, and much more. It will support several use cases, such as:

 

Acquiring NFTs and fractionalizing them;
Commissioning work from NFT creators;
Investing in digital artists;
Creating digital museums and galleries;
Supporting investments in core NFT projects.
 

NEAR is perfectly positioned to support NFTs. Already, popular NFT marketplace Mintbase is building on NEAR so its users can easily create stores and sell their digital assets. Mintbase and NEAR also launched the Createbase guild, where anyone who wants to experiment with NFTs on NEAR can join and apply for funding. Together, NEAR and Mintbase support creative projects up to 5000 USD (primarily in NEAR tokens) per month.

The NEAR Foundation is excited to be a part of the Flamingo DAO. This is the first in a series of community-oriented investments in DAOs and collective projects for NEAR, showcasing NEAR’s commitment to growing the NFT space.
```js
const tokenContract = "token.v2.ref-finance.near";
const tokenPriceResult = await fetch(
  `https://indexer.ref.finance/get-token-price?token_id=${tokenContract}`
);
const tokenPriceValue = await tokenPriceResult.json();
```
_The `Wallet` object comes from our [quickstart template](https://github.com/near-examples/hello-near-examples/blob/main/frontend/near-wallet.js)_

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

```json
{
  "token_contract_id": "token.v2.ref-finance.near",
  "price": "0.08153090"
}
```

</p>

</details>

:::tip
Ref Finance has a method to [get all token prices at once](https://indexer.ref.finance/list-token-price).
:::