Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEPLOY] staging to master #241

Merged
merged 19 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ staging, main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ staging ]
schedule:
- cron: '21 8 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
29 changes: 11 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,26 @@ Make yourself familiar with the [Project Structure](https://developers.cardano.o

We try to keep everything as simple as possible, but not simpler. If you see something that could be improved you are encouraged to raise an issue wherein you propose your changes and explain the rationale.

## Showcase
## Project Showcase

The project showcase should be a place where someone new to the ecosystem can come to see what can be done - it should not be seen as a database where every project is promoted.

### Requirements for adding your project
### Adding your own project

* It must be built on Cardano and have a real use case. For example, a forum where people can talk about Cardano is great, but nothing for this showcase section.
* It has to run on Cardano mainnet.
* It has to have a running product. (no presale, no protected pages, no coming soon messages)
* It has to have enough community reputation. @TODO how to measure this?
* It has to provide a unique value from existing showcase items. (we can't list thousands of NFT or native tokens with the current UI)
* It has to have a stable domain name. (a random Netlify/Vercel domain is not allowed, no URL shortener, no app store links, or similar)
* The GitHub account that adds the project must not be new.
* The GitHub account must have a history/or already be known in the Cardano community.

### Instructions to add your project

1. Add your project in the JSON array in the [src/data/showcases.js](https://github.com/cardano-foundation/developer-portal/edit/staging/src/data/showcases.js)
2. Add a description for your project that **describes what your project does**. Read more about descriptions [below](#a-word-about-project-descriptions]
3. Add a local image preview. (decent screenshot or logo of your project)
4. The image must be added to the GitHub repository and use `require("image")`.
5. [Create a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) for the `staging` branch.
Read the **requirements** and follow the **instructions** in the header of the [src/data/showcases.js](https://github.com/cardano-foundation/developer-portal/edit/staging/src/data/showcases.js) file

#### A word about project descriptions

Descriptions help users find a project they are interested in and decide whether to visit the links you provided. Use relevant keywords and describe what your project is all about or that it does. Don't include claims in your description like *the **best** wallet*, *the **first** ABC* or *the **only** XYZ*. We will ask you to change the description in your pull request before merging. @TODO rationale?

## Builder Tools

This section features tools that help developers build on Cardano.

### Adding your own tool

Read the **requirements** and follow the **instructions** in the header of the [src/data/builder-tools.js](https://github.com/cardano-foundation/developer-portal/edit/staging/src/data/builder-tools.js) file.

## Pull Requests

To maintain the quality of content on the developer portal we use pull requests to integrate changes from contributors.
Expand Down
2 changes: 1 addition & 1 deletion blog/2021-07-12-developer-portal-launch.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: launch-of-the-developer-portal-2021
title: "Finally here: the Cardano developer portal! Accepting all builds."
title: "Finally here: the Cardano developer portal"
author: Cardano Foundation
author_title: Developer Spotlight
author_url: https://github.com/cardano-foundation
Expand Down
42 changes: 42 additions & 0 deletions blog/2021-08-09-nft-minting-standard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
slug: nft-minting-standard
title: "How we minted the NFTAs, and why we went for this standard"
author: Cardano Foundation
author_title: Developer Spotlight
author_url: https://github.com/cardano-foundation
author_image_url: https://avatars.githubusercontent.com/u/37078161?s=200&v=4
tags: [developer-portal, nft, nfta]
description: "How we minted the NFTAs, and why we went for this standard."
image: https://developers.cardano.org/img/og-developer-portal.png
---

![title image](/img/devblog/nfta.jpg)

**Dear Cardano community,**

To celebrate the [Cardano Developer Portal launch](https://developers.cardano.org/), The Cardano Foundation minted the world’s first Non-Fungible Tokens of Appreciation (NFTAs). NFTAs are NFTs showing appreciation to the ten developers that provided feedback and helped build the developer portal. Think of them as “certificates of participation” when you attend a seminar or an event that they give out to attendees. Only they are digital!

<!-- truncate -->

In addition, to show our appreciation, we rewarded the community members with Bronze Tokens of Appreciation. Bronze Tokens are a way to give the NFTAs extra utility over their collectability. Tokens can be redeemed once to highlight a topic or project on the Cardano Developer Portal. For example, it can spotlight a project they are working on or inform the Cardano community of a specific topic. The spotlight articles can be found at the [Cardano Developer Portal Blog](https://developers.cardano.org/blog/).


**The minting strategy**

The Cardano Foundation’s goal was to remain neutral when it came down to deciding the standard to mint the NFTAs. We are in the same ‘playground’ and learn with the community about what standards work to what end. The NFT Standard we chose was [CIP 721](https://github.com/cardano-foundation/CIPs/blob/8b1f2f0900d81d6233e9805442c2b42aa1779d2d/CIP-NFTMetadataStandard.md). We chose this because it was the most complete minting proposal at the time of the campaign launch. But we don’t necessarily endorse it as the standard. We encourage new proposals to be submitted using the Cardano Improvement Proposal framework, and we will continue to learn and build with you, the community.

The [CIP 721](https://github.com/cardano-foundation/CIPs/blob/8b1f2f0900d81d6233e9805442c2b42aa1779d2d/CIP-NFTMetadataStandard.md) Metadata Standard authors are [Alessandro Konrad](https://twitter.com/berry_ales), the creator of [Spacebudz](https://spacebudz.io), and [Smaug](https://twitter.com/SmaugPool), the creator of [Pool.pm](https://pool.pm/). They propose to create a framework to attach metadata to a token. Metadata is important because it describes and gives information about the token. Since tokens on Cardano are native, the link from the token to the metadata needed to be established differently from Ethereum, which creates the link using smart contracts. For Cardano to make the link unique, CIP 721 suggests that the metadata should be attached to the transaction where the token was created.

To read more about CIP 721 and the NFT Metadata Standard, click [here](https://github.com/cardano-foundation/CIPs/blob/8b1f2f0900d81d6233e9805442c2b42aa1779d2d/CIP-NFTMetadataStandard.md). To view all Cardano Improvement Proposals (CIPs), click [here](https://github.com/cardano-foundation/CIPs).

**How we minted the NFTAs**

Tokens that are built on Cardano are native. Unlike Ethereum’s ERC-20 tokens, Cardano doesn’t require a smart contract. Instead, the tokens are treated like Cardano’s native token, ADA. Using native tokens, you can create a variety of digital assets like Non-Fungible-Tokens representing art or appreciation. Learn more about this [here](https://developers.cardano.org/docs/native-tokens/).

To make sure the NFTAs came from the Cardano Foundation, a **policyId** identifies them. You can check out more information about the NFTAs and the **policyId** at the [Cardano Foundation NFTA Official Page](https://cardanofoundation.org/nfta). In addition, they are attached with [metadata](https://pool.pm/2783ee3048c5158646674def386e8610ce2c8824e515451baa4769a6.CFNFTA01) that describes the details of the transaction and ownership address.

To mint the NFT’s, we first used a Cardano Foundation wallet to create a transaction to mint the tokens containing the metadata. Second, the ten developers sent us a receiving wallet address to receive the token. Third, another transaction to send the token to their wallet. Finally, to verify the work, each NFTA has a QR code that will navigate to the [Cardano Blockchain Explorer](https://explorer.cardano.org/en/address.html?address=addr1v8jad20nlga6ca7vjtqs2pr8cu0tcq3rq8s6svm546rvyjggl5yh7) for anyone to view and verify the transactions, including the Bronze Developer Portal Token issuance. Thus, no matter how much time goes by, the blockchain will have an immutable record to show that the community members received the first Non-Fungible Token of Appreciation.

![title image](/img/devblog/how-to-mint.png)

At the time of writing this article, two NFTs have not been minted. We are waiting on two developers to provide their wallet addresses. Also, the Cardano Explorer is not showing the transactions correctly when you try to scan the QR code on the NFTAs. IOG is working on fixing this issue. We will keep you updated on when resolved. If you are interested in learning more or mint native assets or NFTs, visit the [Cardano Developer Portal](https://developers.cardano.org/docs/native-tokens/).
85 changes: 54 additions & 31 deletions docs/get-started/cardanosharp-wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,32 @@ image: ./img/og-developer-portal.png
---

# CardanoSharp.Wallet
[![Build status](https://ci.appveyor.com/api/projects/status/knh87k86mf7gbxyo?svg=true)](https://ci.appveyor.com/project/nothingalike/cardanosharp-wallet) [![Test status](https://img.shields.io/appveyor/tests/nothingalike/cardanosharp-wallet)](https://ci.appveyor.com/project/nothingalike/cardanosharp-wallet) [![NuGet Version](https://img.shields.io/nuget/v/CardanoSharp.Wallet.svg?style=flat)](https://www.nuget.org/packages/CardanoSharp.Wallet/) ![NuGet Downloads](https://img.shields.io/nuget/dt/CardanoSharp.Wallet.svg)
[![Build status](https://ci.appveyor.com/api/projects/status/knh87k86mf7gbxyo?svg=true)](https://ci.appveyor.com/project/nothingalike/cardanosharp-wallet/branch/main) [![Test status](https://img.shields.io/appveyor/tests/nothingalike/cardanosharp-wallet)](https://ci.appveyor.com/project/nothingalike/cardanosharp-wallet/branch/main) [![NuGet Version](https://img.shields.io/nuget/v/CardanoSharp.Wallet.svg?style=flat)](https://www.nuget.org/packages/CardanoSharp.Wallet/) ![NuGet Downloads](https://img.shields.io/nuget/dt/CardanoSharp.Wallet.svg)

CardanoSharp Wallet is a .NET library for Creating/Managing Wallets and Building/Signing Transactions.

## Features

* Generate Mnemonics
* Create Private and Public Keys
* Create Addresses
* Build Transactions
* Sign Transactions
* Generate Mnemonics
* Create Private and Public Keys
* Create Addresses
* Build Transactions
* Sign Transactions

## Getting Started

CardanoSharp.Wallet is installed from NuGet.
CardanoSharp.Wallet is installed from NuGet.

```
```sh
Install-Package CardanoSharp.Wallet
```

## Generate a Mnemonic

```csharp
using CardanoSharp.Wallet;
using CardanoSharp.Wallet.Enums;
using CardanoSharp.Wallet.Models.Keys;

class Program
{
Expand All @@ -43,41 +46,46 @@ class Program
int size = 24;

// This will generate a 24 English Mnemonic
string mnemonic = keyService.Generate(24, WordLists.English);
Mnemonic mnemonic = keyService.Generate(size, WordLists.English);
System.Console.WriteLine(mnemonic.Words);
}
}
```

## Create Private and Public Keys

Add powerful extensions to create and derive keys.

```csharp
// Here we can get the entropy from our mnemonic
var entropy = keyService.Restore(mnemonic);
using CardanoSharp.Wallet.Extensions.Models;
```

// The masterKey is a Tuple made of up of the
// - Private Key(Item1)
// - Chain Chain(Item2)
var masterKey = keyService.GetRootKey(entropy);
```csharp
// The masterKey is a PrivateKey made of up of the
// - byte[] Key
// - byte[] Chaincode
PrivateKey masterKey = mnemonic.GetRootKey();

// This path will give us our Payment Key on index 0
var paymentPath = $"m/1852'/1815'/0'/0/0";
string paymentPath = $"m/1852'/1815'/0'/0/0";
// The paymentPrv is another Tuple with the Private Key and Chain Code
var paymentPrv = keyService.DerivePath(paymentPath, masterKey.Item1, masterKey.Item2);
PrivateKey paymentPrv = masterKey.Derive(paymentPath);
// Get the Public Key from the Payment Private Key
var paymentPub = keyService.GetPublicKey(paymentPrv.Item1, false);
PublicKey paymentPub = paymentPrv.GetPublicKey(false);

// This path will give us our Stake Key on index 0
var stakePath = $"m/1852'/1815'/0'/2/0";
string stakePath = $"m/1852'/1815'/0'/2/0";
// The stakePrv is another Tuple with the Private Key and Chain Code
var stakePrv = keyService.DerivePath(stakePath, masterKey.Item1, masterKey.Item2);
var stakePrv = masterKey.Derive(stakePath);
// Get the Public Key from the Stake Private Key
var stakePub = keyService.GetPublicKey(stakePrv.Item1, false);
var stakePub = stakePrv.GetPublicKey(false);
```

## Create Addresses

```csharp
// Creating Addresses require the Public Payment and Stake Keys
var baseAddr = addressService.GetAddress(
Address baseAddr = addressService.GetAddress(
paymentPub,
stakePub,
NetworkType.Testnet,
Expand Down Expand Up @@ -111,11 +119,20 @@ namespace CardanoSharp.Wallet.Enums
}
```

## Building and Sign Transactions
This is just an example of how to start. You will need to Calculate Fees, compare with Protocol Parameters and re-serialize.
## Build and Sign Transactions

This is just an example of how to start. You will need to Calculate Fees, compare with Protocol Parameters and re-serialize.

```csharp
using CardanoSharp.Wallet.Models.Transactions;
```

```csharp
// The Transaction Builder allows us to contruct and serialize our Transaction
var transactionBuilder = new TransactionBuilder();
using CardanoSharp.Wallet.Models.Transactions;
using CardanoSharp.Wallet.Extensions.Models.Transactions;
//For CBOR Utilities
using PeterO.Cbor2;

// Create the Transaction Body
// The Transaction Body:
Expand All @@ -137,14 +154,14 @@ var transactionBody = new TransactionBody()
new TransactionInput()
{
TransactionIndex = 0,
TransactionId = someTxHash
TransactionId = new byte[32]
}
},
TransactionOutputs = new List<TransactionOutput>()
{
new TransactionOutput()
{
Address = addressService.GetAddressBytes(baseAddr),
Address = baseAddr.GetBytes(),
Value = new TransactionOutputValue()
{
Coin = 1
Expand All @@ -163,8 +180,8 @@ var witnesses = new TransactionWitnessSet()
{
new VKeyWitness()
{
VKey = paymentPub,
SKey = paymentPrv
VKey = paymentPub.Key,
SKey = paymentPrv.Key
}
}
};
Expand All @@ -178,15 +195,20 @@ var transaction = new Transaction()

// Serialize Transaction with Body and Witnesses
// This results in a Signed Transaction
var signedTx = transactionBuilder.SerializeTransaction(transaction);
var signedTxSerialized = transaction.Serialize();
```

### Calculate Fees

```csharp
var fee = transactionBuilder.CalculateFee(signedTx);
// From Current Protocol Parameters
// 44 = txFeePerByte
// 155381 = txFeeFixed
var fee = transaction.CalculateFee(44, 155381);
```

### Adding Metadata

```csharp
var auxData = new AuxiliaryData()
{
Expand All @@ -205,4 +227,5 @@ var transaction = new Transaction()
```

### More Examples

Please see the [Transaction Tests](https://github.com/CardanoSharp/cardanosharp-wallet/blob/main/CardanoSharp.Wallet.Test/TransactionTests.cs)
6 changes: 3 additions & 3 deletions docs/get-started/installing-cardano-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This guide will show you how to compile and install the `cardano-node` and `card
:::note
If you want to avoid compiling the binaries yourself, You can download the latest pre-built binaries of `cardano-node` and `cardano-cli` from the links below.

- [Linux](https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-linux/latest-finished)
- [MacOS](https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-macos/latest-finished)
- [Windows](https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-win64/latest-finished)
- [Linux](https://hydra.iohk.io/build/6263009)
- [MacOS](https://hydra.iohk.io/build/6263000)
- [Windows](https://hydra.iohk.io/build/6263143)

The components can be built and run on **Windows** and **MacOS**, but we recommend that stake pool operators use **Linux** in production to take advantage of the associated performance advantages.
:::
Expand Down
8 changes: 4 additions & 4 deletions docs/get-started/running-cardano.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ You can obtain the current **Cardano** blockchain network configuration files he
**NetworkMagic**: `764824073`

```
https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-config.json
https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-byron-genesis.json
https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-shelley-genesis.json
https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-topology.json
https://hydra.iohk.io/build/7191656/download/1/mainnet-config.json
https://hydra.iohk.io/build/7191656/download/1/mainnet-byron-genesis.json
https://hydra.iohk.io/build/7191656/download/1/mainnet-shelley-genesis.json
https://hydra.iohk.io/build/7191656/download/1/mainnet-topology.json
```

#### Testnet / Sandbox
Expand Down
Loading