Skip to content

Commit

Permalink
added boilerplate pages for new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaga committed Mar 17, 2023
1 parent b5543ff commit a6f341f
Show file tree
Hide file tree
Showing 28 changed files with 910 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/developers/build/_category_.json
@@ -0,0 +1,8 @@
{
"label": "Build",
"position": 2,
"collapsed": false,
"link": {
"type": "generated-index"
}
}
28 changes: 28 additions & 0 deletions docs/developers/build/configuring-flint-for-devs.mdx
@@ -0,0 +1,28 @@
---
sidebar_label: "Configuring Flint Wallet"
sidebar_position: 1
---

import puzzleIcon from "@site/static/img/puzzle-icon.png";

# Configuring Flint Wallet

Flint Wallet is a Chrome extension that serves as a go-to light wallet for DeFi and NFTs. The current version of Flint allows users to create a Cardano Testnet wallet and enable "Milkomeda mode" to send transactions to the Milkomeda C1 sidechain.

Install Flint Wallet by visiting the following link while using Chrome browser and clicking the “Add to Chrome” button: [Install Flint Wallet](https://chrome.google.com/webstore/detail/flint/hnhobjmcibchnmglfbldbfabcgaknlkj)

After installing, click the Extensions icon <img src={puzzleIcon} className="img-icon" /> at the top right of the Chrome window and select **Flint Wallet**. Within the Flint window, proceed past the initial warning screen, click “**Let’s Begin**”, choose your language, click “**I agree**”, and when you arrive at the screen shown below, click the “**Testnet**” button.

:::info
To use real ADA on the mainnet version of Milkomeda C1, click "Mainnet" to create a mainnet Cardano wallet instead.
:::

![Select tesnet network](/img/flint-select-testnet.png)

Next, click “**Confirm**”, “**Create a new wallet**”, and write down a copy of your recovery phrase.

Confirm the recovery phrase at the next screen, set a wallet password, and click “**Create my wallet**”. For now you can select “**Skip**” at the App Passcode screen, and then click “**Finish**”. You should now have a Cardano Testnet wallet, as shown:

![Flint home screen](/img/flint-home-screen.png)

Next, we will access the Cardano Testnet faucet to obtain some test ADA.
7 changes: 7 additions & 0 deletions docs/developers/build/frameworks/_category_.json
@@ -0,0 +1,7 @@
{
"label": "Development Frameworks",
"position": 1,
"link": {
"type": "generated-index"
}
}
62 changes: 62 additions & 0 deletions docs/developers/build/frameworks/apeworx.mdx
@@ -0,0 +1,62 @@

# ApeworX

Plugins are core to ApeworX’s architecture and to add a new network, it has to be bundled into a plugin. Luckily, dcspark has developed a plugin (ape-milkomeda) to allow Apeworx to connect to A1 and C1, mainnet and testnet.

Download is available at…

Steps
Install the ape-milkomeda plugin to have the milkomeda chains available in the ApeworX network list.

Either download the repo and install from source:

```
git glone https://github.com/dcspark/ape-milkomeda
cd ape-milkomeda
pip install .
```

or install from the pypi repository (I have finished plugin but it’s only on my pc):

```
pip install ape-milkomeda
```


Initialize an ape project in an empty folder:

```
ape init
```

Copy the WinnerDraw.sol to the contracts folder.
Compile the contract:

```
ape compile
```

Import your account to ApeworX account list:

```
ape accounts import <ALIAS>
```

(you will be prompted for the private key and a passphrase to encrypt it)


Create a file names deploy.py in the scripts folder:

```
from ape import project, accounts
def main():
signer = accounts.load('test')
winnerDraw = signer.deploy(project.WinnerDraw)
```

Run the deployment script on C1 testnet:

```
ape run deploy --network milkomeda:c1-testnet
```
56 changes: 56 additions & 0 deletions docs/developers/build/frameworks/brownie.mdx
@@ -0,0 +1,56 @@
# Brownie

Brownie is currently in maintenance mode and ApeworX should be it’s successor, but in any case we will lease here the steps to set it up.

Steps
Initialize a brownie project in an empty folder:

```
brownie init
```

Copy the WinnerDraw.sol to the contracts folder.
Compile the contract:

```
brownie compile
```

Add the Milkomeda C1 testnet list of networks in brownie:

```
brownie networks add Milkomeda milkomeda-cardano-testnet chainid=200101 explorer=https://explorer-devnet-cardano-evm.c1.milkomeda.com host=https://rpc-devnet-cardano-evm.c1.milkomeda.com name="Milkomeda C1 Testnet"
```


Create a file named brownie-config.yml in the root of the project with the following content:

```
dotenv: .env
wallets:
- dummy: ${PRIVATE_KEY}
```

Create a file named .env with the private key of the funded account:

```
PRIVATE_KEY=<PRIVATE_KEY>
```


Create a file named deploy.py in the scripts folder:

```
from brownie import WinnerDraw, accounts, config
def main():
signer = accounts.add(config['wallets'][0]['dummy'])
WinnerDraw.deploy({"from": signer})
```


Run the deployment script on C1 testnet:

```
brownie run scripts/deploy.py --network milkomeda-cardano-testnet
```
29 changes: 29 additions & 0 deletions docs/developers/build/frameworks/forge.mdx
@@ -0,0 +1,29 @@
# Forge

Initialize an ape project in an empty folder:

```bash
forge init .
```


Compile the contract:

```bash
forge build
```

Create a file named .env with the private key of the funded account:

```
PRIVATE_KEY=<PRIVATE_KEY>
```

Run the deployment script on C1 testnet:

```bash
source .env
forge create --legacy --rpc-url https://rpc-devnet-cardano-evm.c1.milkomeda.com --private-key $PRIVATE_KEY src/WinnerDraw.sol:WinnerDraw
```

(Notice the -–legacy is necessary since milkomeda chains have not yet implemented EIP-1559)
92 changes: 92 additions & 0 deletions docs/developers/build/frameworks/hardhat.mdx
@@ -0,0 +1,92 @@
---
sidebar_position: 1
description: This description will override the default.
---


# Hardhat

Initialize a Hardhat project in an empty folder:

```bash
yarn init
yarn add --dev hardhat
npx hardhat
```


Create a contract in the contracts folder

Compile the contract:

```bash
npx hardhat compile
```


Edit hardhat.config.js to add the desired Milkomeda chain and your funded test account:


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

<Tabs>
<TabItem value="c1" label="C1" default>

```
require("@nomicfoundation/hardhat-toolbox");
const TESTNET_API_KEY = "<PRIVATE_KEY>";
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.17",
networks: {
c1_testnet: {
url: `https://rpc-devnet-cardano-evm.c1.milkomeda.com`,
accounts: [TESTNET_API_KEY]
}
}
};
```


</TabItem>
<TabItem value="a1" label="A1">
This is a banana 🍌
</TabItem>
<TabItem value="c1-testnet" label="C1 Testnet">
This is an orange 🍊
</TabItem>
<TabItem value="a1-testnet" label="A1 Testnet">
This is a banana 🍌
</TabItem>
</Tabs>





Create a file named deploy.js in the scripts folder:

```
const hre = require("hardhat");
async function main() {
const WinnerDraw = await hre.ethers.getContractFactory("WinnerDraw");
const winnerDraw = await WinnerDraw.deploy();
await winnerDraw.deployed();
console.log(`WinnerDraw contract deployed to ${winnerDraw.address}`);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
```

Run the deployment script on C1 testnet:

```
npx hardhat run scripts/deploy.js --network c1_testnet
```
4 changes: 4 additions & 0 deletions docs/developers/build/frameworks/truffle.mdx
@@ -0,0 +1,4 @@

# Truffle

...
32 changes: 32 additions & 0 deletions docs/developers/build/obtaining-test-ada.mdx
@@ -0,0 +1,32 @@
---
sidebar_label: "Obtaining Test ADA"
sidebar_position: 2
---

# Obtaining Test ADA

Now we’re ready to get some test ADA from the Cardano testnet faucet.

:::info

If you will be using real ADA on the mainnet version of Milkomeda C1, skip this step and proceed to the [next page](./configuring-metamask-for-devs)

:::

Within the Flint Wallet window, click "**Receive**". At the Receive window, click "**Copy Address**" to copy your Cardano Testnet wallet address to the clipboard, and then click "**Testnet faucet (tADA)**" at the bottom of the screen, as shown.

![](/img/flint-copy-tada-receive-address.png)

This will take you to the following link: [Cardano Testnet Faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/)

Here, select "tAda" from the dropdown menu and paste your Cardano testnet wallet address into the "Address" field. You can leave the "API Key" field blank.

![](/img/cardano-testnet-faucet.png)

Complete the Captcha and click "**Request funds**".

After waiting a few minutes (usually 5 minutes or less), you should be able to see some tADA in your Cardano Testnet wallet.

![](/img/flint-confirm-tada-balance.png)

Next we will set up MetaMask and get an address on the Milkomeda C1 sidechain.

0 comments on commit a6f341f

Please sign in to comment.