Only this pageAll pages
Powered by GitBook
1 of 40

BOSagora

Agora

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Validator Start

Loading...

Loading...

Loading...

Loading...

VOTERA

Loading...

Loading...

Loading...

Loading...

Getting Started

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Tools

Loading...

Loading...

Loading...

Loading...

Loading...

dAPPs

Loading...

Loading...

Loading...

Loading...

Consensus mechanism (POS)

Description of Bosagora's Proof of Stake (POS) consensus mechanism

Bosagora blockchain is using which is a combination of Casper the Friendly Finality Gadget (Casper-FFG) and the LMD-GHOST fork choice algorithm to achieve Proof of Stake (PoS) consensus. This is well battle tested and proven to be reliable and secure as it has been used for the Ethereum Beacon Chain consensus mechanism since December 2020.

Gasper

Why BOSagora

Description of why to use BOSagora

BOSagora is a blockchain that uses a Proof of Stake consensus mechanism which means that it is very energy efficient. It uses a tiny fraction of the energy used by Proof of Work consensus blockchains which are very wasteful in energy consumption. For example, BitCoin requires more energy than some countries to keep it secure.

BOSagora has generous rewards given to those that keep it secure and also gives them voting rights in funds that can be used for projects to make a better World.

BOSagora is pursuing democracy, legitimacy, fairness, transparency and efficiency of the highest standards.

What is BOSagora

General information page about BOSagora

BOSagora is an open decentralized blockchain that is built using open source software from the public domain. The goal is to make a better world by using blockchain technology as a project enabler.

The word is defined in the wikipedia as originating from Ancient Greek to mean a public gathering space. This is an apt name for the Agora blockchain that is for public use and for the benefit of all.

Agora

BOSagora Chain

High level description of the BOSagora Blockchain

The ultimate goal is for the BOSagora blockchain to be fully open and distributed to all using only PoS consensus. However, the first step to achieve this was to start with a Proof of Authority consensus mechanism which is also very energy efficient. This was to enable early adoption of the chain. The next step is to add a PoS consensus layer that runs alongside the PoA chain. In a similar way to how Ethereum had a PoW and PoS chain to enable the transition from PoW to only PoS. A A PoS consensus chain BOSagora runs with a PoA execution chain to prove secure and reliable, and the Agora Chain has been completely changed to a PoS consensus chain.

Agora staking economics

The initial stake required is 40,000 BOA per validator. Each validator will get a share of the allocated validator rewards if it behaves honestly by proposing blocks when required and attesting to valid blocks proposed by other validators. If a validator does not propose a block when it is the chosen validator or it does not attest to blocks within the expected time it will be penalized by having a small amount of stake removed. If it is proven to be dishonest then it will be slashed which results in larger amounts of stake being removed. Slashing only occurs for any of the following protocol violations: 1. a misbehaving block proposer who proposes two different blocks at the same slot height 2. an attester which publishes a vote with different source checkpoints for the same target checkpoint 3. an attester which publishes a vote that surrounds or is surrounded by another of its votes in relation to source and target checkpoints

BOSagora Chain info

Description of Chain information

BOSagora Mainnet

  • Network Name: BOSagora mainnet

  • New RPC URL: https://mainnet.bosagora.org

  • Chain ID: 2151

  • Currency Symbol: BOA

  • Agora Validator Deposit address: 0xC26Dd0f6e94afE288a2dd5D300F4dDaA0D93D9CB

BOSagora Testnet

  • Network Name: BOSagora testnet

  • New RPC URL: https://testnet.bosagora.org

  • Chain ID: 2019

  • Currency Symbol: BOA

  • Agora Validator Deposit address: 0xc11adf2BDF377dbABfB4344B7b8A18D552982680

  • Faucet: GET https://faucet.bosagora.org/request/boa/ + Your's BOA Address

Boascan (Execution layer explorer):

Agorascan (Consensus layer explorer):

Agora staking client:

Boascan (Execution layer explorer):

Agorascan (Consensus layer explorer):

Agora staking client:

https://www.boascan.io
https://www.agorascan.io
https://agora-staking.bosagora.org
https://testnet.boascan.io
https://testnet.agorascan.io
https://testnet-agora-staking.bosagora.org

Check list to be Validator

Visit page to check what is required to become an Agora blockchain validator.

https://agora-staking.bosagora.org/en/checklist

Upgrades

Blockchains rely on updates to enable new features and functionality without starting a new blockchain. For clients to be prepared for when the updates are available they need to install the client version which supports the update. Following sections describe the expected updates in the coming months.

The withdrawals upgrade for Mainnet

This will be an upgrade that adds the ability to withdraw rewards and validators' staked deposits.

It is mandatory for node operators to upgrade before the applicable upgrade date.

The upgrade schedule is as follows

Mainnet Withdrawal Upgrade Date: August 23, 2023, 01:05:53 AM (UTC)

Mainnet Withdrawal Upgrade Epoch : 50,324

Your mainnet Agora node upgrade should be complete before this date.

How to upgrade an Agora node for mainnet (For Linux and Mac Users)

1. Mainnet Upgrade for Linux or MacOS

Stop the existing node and run the command below.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.sh)"

Start the node.

./agora.sh start

2. Validator withdrawals for Linux or MacOS

! Withdrawals must be executed after the mainnet withdrawal upgrade.

The command below shows simple commands.

  • Generate the SignedBLSToExecutionChange data to enable withdrawals

    ./agora.sh deposit-cli generate-bls-to-execution-change <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

  • Send the SignedBLSToExecutionChange data to enable withdrawals

    ./agora.sh validator withdraw <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

How to upgrade an Agora node for mainnet (For Windows users)

1. Mainnet Upgrade for Windows

Stop the existing node and run the command below.

curl -S -L -o upgrade.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.bat
upgrade.bat

Start the node.

agora.bat start

2. Validator withdrawals for Windows

! Withdrawals must be executed after the mainnet withdrawal upgrade.

The command below shows simple commands.

  • Generate the SignedBLSToExecutionChange data to enable withdrawals

    agora.bat deposit-cli generate-bls-to-execution-change <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

  • Send the SignedBLSToExecutionChange data to enable withdrawals

    agora.bat validator withdraw <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

Update monitoring dashboard data sources

The monitoring dashboard data source has been updated.

More detailed rewards and deposit withdrawal explanations and tutorials can be found .

3. For more information about upgrading and running nodes, see .

More detailed rewards and deposit withdrawal explanations and tutorials can be found .

3. For more information about upgrading and running nodes, see .

Newly changed dashboard data source . The monitoring address and port are http://localhost:3000

here
here
here
here
link

Withdraw your validator

After the Agora Withdrawal upgrade (August 23, 2023, 01:05:53 AM (UTC)), you will be able to withdraw your staked BOA on validator nodes in two ways:

In this how-to, you'll learn how to perform both types of withdrawals. Familiarity with Agora wallets, mnemonic phrases, and command lines is expected.

  1. Your validator mnemonic: You'll use this to authorize your validator withdrawal request(s).

We'll install other dependencies as we go.

Option 1: Partial (earnings) withdrawals

This section walks you through the process of performing a partial validator withdrawal, allowing you to withdraw staked balances above 40,000 BOA for each of your active Agora validators.

Retrieve your validator’s withdrawal_credentials from the deposit_data-XXX.json file that was generated when you first used the staking launchpad. The withdrawal_credentials value looks like this:

0x00500b3bf612bed69e888edeb045f590c3f37251e3e049c0732f3adaa57ea3f6

If you don't have the deposit_data-XXX.json file, you can retrieve your withdrawal_credentials by sending a request to your synced beacon node via Agora-cl API and providing your validator index or public key:

curl -X 'GET' \
  'http://YOUR_AGORA_NODE_HOST:3500/eth/v1/beacon/states/head/validators/YOUR_VALIDATOR_INDEX_OR_PUBLIC_KEY' \
  -H 'accept: application/json'

Your withdrawal credentials will be visible in the response to this request - look for withdrawal_credentials.

Example output with placeholder values:

{
  "execution_optimistic": false,
  "data": {
    "index": "1",
    "balance": "1",
    "status": "active_ongoing",
    "validator": {
      "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
      "withdrawal_credentials": "0x008e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
      "effective_balance": "1",
      "slashed": false,
      "activation_eligibility_epoch": "1",
      "activation_epoch": "1",
      "exit_epoch": "1",
      "withdrawable_epoch": "1"
    }
  }
}

If you already have a node running or installed using Agora-chain, you can skip the instructions below.

  • Linux / Mac

mkdir agora-chain
cd agora-chain
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/agora.sh)"
  • Windows

mkdir agora-chain
cd agora-chain
curl -S -L -o agora.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/agora.bat
call agora.bat

CAUTION

We recommend doing this next step without an Internet connection to be maximally secure. Either turn off the internet before introducing your mnemonic for signing or migrate to an air-gapped environment to continue the following steps.

Here’s the command to get started with the process. This command will not submit your signed message to the network yet, and will only generate the data needed for the next steps.

./agora.sh deposit-cli generate-bls-to-execution-change <folder>

'folder' is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

By calling the command above, you should go through an interactive process that will ask you for the following information:

  1. Your language. You can see the different options available, where English is one of the options, among others.

  2. The network you wish to perform this operation for. example: mainnet,testnet or devnet.

  3. Enter your mnemonic next

INFO

Inside the original deposit.json file used for staking you can count each validator's public key in sequential order starting from 0. The validator starting index is the index of the first validator key you would like to withdraw (i.e. validator key 1 has an index of 0, validator key 2 has an index of 1 etc.). For most stakers, the validator starting index should be set to 0 for withdrawing all their validator keys, however the validator starting index will be different if you choose to skip withdrawing some validators. There are other niche cases where the mnemonic is used for deposit generation multiple times, resulting in a different validator starting index. Validators spanning across different mnemonics will need to be counted separately with starting index as 0 on each of them.

INFO

Validator indices need to be provided sequentially without skipped indices in the order of original creation. You can typically find the order in your original deposit.json file. The generate-bls-to-execution-change command needs to be repeated in cases where multiple validator keys that are not in sequential order need to be withdrawn, and will require either merging of the output files or multiple blstoexecutionchange submissions. In the case of validators requiring different withdrawal addresses you will need to also repeat this process using the validator start index of the validator that the different withdrawal address.

  1. Next you will be asked for your withdrawal credentials, which you should now have if you followed this guide

  2. Next you will be asked for the BOA address you wish to use to receive your withdrawn funds. This needs to be checksummed, and you can get it from your wallet or a block explorer. You cannot change this once it is set on-chain, so triple check it before proceeding.

Below is an example of running through the interactive process explained above:

Please choose the (mainnet or testnet) network/chain name ['mainnet', 'testnet', 'devnet']:  [mainnet]: devnet

Please enter your mnemonic separated by spaces (" "). Note: you only need to enter the first 4 letters of each word if you'd prefer.: board fire prize defy limb arm diet fee usage settle rigid sunny duty squirrel cheap history session same tilt candy loan culture pretty anchor
Please enter the index position for the keys to start generating withdrawal credentials in ERC-2334 format. [0]: 39
Please enter a list of the validator index number(s) of your validator(s) as identified on the beacon chain. Split multiple items with whitespaces or commas.: 39
Please enter a list of the old BLS withdrawal credentials of your validator(s). Split multiple items with whitespaces or commas. The withdrawal credentials are in hexadecimal encoded form.: 0x0072b98f706baf445239abb7b3cbf7a070f9bf34cf016a2c093a9034f364045d
Please enter the 20-byte execution address for the new withdrawal credentials. Note that you CANNOT change it once you have set it on chain.: 0xc304A2aBCb9f14677cE1BA9242637A3a053b2e3a

**[Warning] you are setting an BOA address as your withdrawal address. Please ensure that you have control over this address.**

Repeat your execution address for confirmation.: 0xc304A2aBCb9f14677cE1BA9242637A3a053b2e3a

**[Warning] you are setting an BOA address as your withdrawal address. Please ensure that you have control over this address.**


Success!
Your SignedBLSToExecutionChange JSON file can be found at: /agora-chain/bls_to_execution_changes/bls_to_execution_changes
[
    {
    "message": {
      "validator_index": "838",
      "from_bls_pubkey": "0xb89bebc655569726a318c8e9971bd3144497c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b",
      "to_execution_address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0a"
    },
    "signature": "0xa42103e15d3dbdaa75fb15cea782e4a11329eea77d155864ec682d7907b3b70c7771960bef7be1b1c4e08fe735888b950c1a22053f6049b35736f48e6dd018392efa3896c9e427ea4e100e86e9131b5ea2673388a4bf188407a630ba405b7dc5"
  },
    {
    "message": {
      "validator_index": "20303",
      "from_bls_pubkey": "0xb89bebc699769726a502c8e9971bd3172227c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b",
      "to_execution_address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
    },
    "signature": "0xa86103e15d3dbdaa75fb15cea782e4a11329eea77d155864ec682d7907b3b70c7771960bef7be1b1c4e08fe735888b950c1a22053f6049b35736f48e6dd018392efa3896c9e427ea4e100e86e9131b5ea2673388a4bf188407a630ba405b7dc5"
  }
]

The above demonstrates two different validators withdrawing - one with validator index 838, the other with validator index 20303.

CAUTION

Make sure the validator_index corresponds to the correct chosen to_execution_address. Once this message is accepted on submission you will not be able to change it again!

Move the generated bls_to_execution_changes-*.json file to an online environment that has access to a synced beacon node for the next step.

This step requires access to a synchronized Agora-cl node.

You can use the ./agora.sh validator withdraw command, which will ask for terms of service acceptance and confirmation of command by providing additional flags, and also a path to the bls_to_execution_changes file from the previous step.

INFO

default Agora node REST <node-url> is http://localhost:3500 aka http://127.0.0.1:3500

Open a terminal in the location where you installed the agora-chain. Some users will need to give permissions to be executable. Linux users can do this by right clicking the file, going to permissions, and clicking the Allow executing file as program checkmark. This may be different for each operating system.

  • Linux / Mac

./agora.sh validator withdraw <folder>
  • Windows

agora.bat validator withdraw <folder>

'folder' is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

This will extract data from the bls_to_execution_changes-*.json call the Beacon API endpoint on the synced Beacon Node and validate if the request was included.

On successful submission, the SignedBLStoExecutionChange messages are included in the pool waiting to be included in a block.

agora.sh version 2.0.0
The selected network is 'devnet'
Default data folder is bls_to_execution_changes
INFO[0000] found JSON files for setting withdrawals: [/agora-chain/bls_to_execution_changes/bls_to_execution_changes/bls_to_execution_change-1687424246.json] 
SETTING VALIDATOR INDEX 39 TO WITHDRAWAL ADDRESS 0xc304a2abcb9f14677ce1ba9242637a3a053b2e3a
INFO[0000] Successfully published messages to update 1 withdrawal addresses. 
INFO[0000] Verifying requested withdrawal messages known to node... 
INFO[0000] There are a total of 1 messages known to the node's pool. 
INFO[0000] All (total:1) signed withdrawal messages were found in the pool. 

The withdrawal will be initiated by using the execution address you provided, and your validators’ withdrawal credentials will change to look something like this:

*0x010000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b* 

where the BOA address of your choosing will be found within.

You can track your withdrawal on an Agora Proof of Stake Block Scanner. Some examples listed below and will be based on network.

you can also confirm the withdrawal_credentials updated by querying your local Agora-cl node.

curl -X 'GET' \
  'http://YOUR_PRYSM_NODE_HOST:3500/eth/v1/beacon/states/head/validators/YOUR_VALIDATOR_INDEX' \
  -H 'accept: application/json'

and you should see a response that contains withdrawal credentials that should have changed to the 0x01 format which includes your BOSagora execution address.

Once your withdrawal_credentials field on the validator is updated to the 0x01 prefix all withdrawal actions are complete. Withdrawals of earnings over 40,000 BOA will be automatically sent to the chosen BOSagora address when a block proposer includes your validator in its block. Note that a maximum of 16 validators can have their balances withdrawn per block so delay times may vary before seeing the values appear in the BOA address.

To fully withdraw a validator and its earnings, your validator needs to also be exited in addition to having its withdrawal credentials changed.

CAUTION

Instructions for setting your withdrawal address do not need to be repeated if withdrawal_credentials are updated to the 0x01 prefix.

Once the validator is both exited as well as having its withdrawal_credentials changed to the 0x01 prefix, the validator will automatically have its full balance withdrawn into the chosen Agora BOA address when a block proposer includes your validator in its block. Note that a maximum of 16 validators can have their balances withdrawn per block so delay times may vary before seeing the values appear in the BOA address.

CAUTION

Slashed or involuntarily exited validators will still need to go through the process of updating withdrawal_credentials to fully withdraw its remaining balance.

: This option lets you withdraw your earnings (that is, all value staked above 40,000 BOA) and continue validating.

: This option lets you liquidate your entire stake and earnings, effectively liquidating your validator node(s) and exiting the network.

Prerequisites

Access to a beacon node: You'll need to connect your validator to a beacon node in order to submit your withdrawal request. Visit our for instructions if you need them.

The agora-chain installed: The is agora nodes and tool provided by the Agora research team.

Time to focus: This is a time-consuming procedure making a mistake can be expensive. Be vigilant against scammers; never share your mnemonic; take your time; ping us if you have any questions.

Step 1: Prepare your withdrawal credentials

Step 2: run the in an offline environment with your mnemonic to generate the blstoexecutionchange message(s)

In this step, you submit a signed request to the Agora network using the tool provided by the BOSagora project.

installation instructions

Now that the Agora-chain's tool is executable, you can then use it to generate your signed request. You need to use your mnemonic for this step, so doing it offline is key and ensuring you do not paste your mnemonic anywhere else than necessary.

Next, you will be asked for the starting index you used to create your validators (read more about hd wallets ). For most users, this will be 0 unless you created validators from a non default index.

You will then be asked the validator indices for the validators you wish to generate the message for. You can find your validator indices on block explorers such as or in your Agora-cl validator client logs. For example, the validator with public key 0x800b1496d4532bbf3404de63619b779bad95dba69396e5d5c4eb64c7aa4a9a1a77229ec8783ad114a14d2eda2a3483ca on has validator index 20, which you can verify by navigating to its .

Step 3: verify the blstoexecutionchange message(s) that the corresponding validator will set to the chosen BOA address

Once you complete the above, you’ll have a file contained in the bls_to_execution_changes/ folder of your . It will represent a list of BLS to execution messages that have been signed with your private keys and are ready to submit to Agora. Here’s what a sample file of these looks like. Example output with placeholder values:

Step 4: submit your signed blstoexecutionchange message(s) to the Agora network using

Step 5: Confirm submission

Step 6: Confirm your withdrawal

: ,

Done: Receiving partial withdrawals after withdrawal_credentials are updated is automatic, but will take time.

Option 2: Full withdrawals

Please follow our .

Refer to the above option 1: guidance to change your validator's withdrawal credentials.

Done: Receiving full withdrawals after withdrawal_credentials are updated and the validator is fully exited is automatic, but will take time.

​
quickstart
agora-chain
on Telegram
​
agora-deposit-cli
​
Agora-chain
Agora-chain
deposit-cli
BLS to Execution
here
https://www.agorascan.io/
https://www.agorascan.io/
page
​
agora-deposit-cli
Agora-chain​
​
​
agorascan.io
mainnet
testnet
​
​
exiting-a-validator how-to
​
Partial (earnings) withdrawal
Full withdrawal
partial withdrawal

Running an Agora node and Validator

Setting up an Agora node

It is a good idea to first run a test node within the Agora testnet to get familiar with how things work before running a node in the Agora mainnet

The withdrawals upgrade for Testnet

This will be an upgrade that adds the ability to withdraw rewards and validators' staked deposits.

The timing of the upgrade will be applied first on Agora Testnet, then we will watch for network stabilization and upgrade to Agora Mainnet.

The upgrade schedule is as follows.

TestNet Withdrawal Upgrade Date: July 12, 2023, 10:04 AM

Testnet withdrawal upgrade Epoch: 58857

The testnet agora node upgrade must be completed before that date and time.

How to upgrade an Agora node for testnet (For Linux and Mac Users)

1. Testnet Upgrade for Linux or MacOS

Stop the existing node and run the command below.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.sh)"

Start the node.

./agora.sh start

2. Validator withdrawals for Linux or MacOS

  • Generate the SignedBLSToExecutionChange data to enable withdrawals

    ./agora.sh deposit-cli generate-bls-to-execution-change <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

  • Send the SignedBLSToExecutionChange data to enable withdrawals

    ./agora.sh validator withdraw <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

How to upgrade an Agora node for testnet (For Windows users)

1. Testnet Upgrade for Windows

Stop the existing node and run the command below.

curl -S -L -o upgrade.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.bat
upgrade.bat

Start the node.

agora.bat start

2. Validator withdrawals for Windows

  • Generate the SignedBLSToExecutionChange data to enable withdrawals

    agora.bat deposit-cli generate-bls-to-execution-change <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

  • Send the SignedBLSToExecutionChange data to enable withdrawals

    agora.bat validator withdraw <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

Update monitoring dashboard data sources

The monitoring dashboard data source has been updated.

Withdraw rewards and how to withdraw deposits can be found .

For more information about upgrading and running nodes, see .

Withdraw rewards and how to withdraw deposits can be found .

For more information about upgrading and running nodes, see .

Newly changed dashboard data source . The monitoring address and port are http://localhost:3000

here
here
here
here
link

How to Vote

Any member of congress can vote by following these steps:

  1. Find the proposal you want to vote for and click on it to enter the proposal details screen.

  2. Review the proposal details and discussions and decide whether to support, oppose, or abstain from the proposal.

  3. Select "Vote" tab to enter the voting screen.

  4. Select one of the three buttons: "Yes", "No", and "Abstain".

  5. Click the "Vote" button.

When the voting process is complete, a completion message is displayed.

Business Proposal

Any member of congress can begin the decision-making process by writing a business proposal.

Proposal authors must provide the following information so that other members of the congress can understand and participate:

  • Type of proposal

  • Title of proposal

  • Voting period

  • Request amount

  • Business goals and descriptions

  • Related attachments

In order to prevent abuse, a small fee must be paid according to the policy when registering a proposal, and the fee to be paid is automatically calculated and presented according to the entered request amount.

Members of the congress can participate in the proposed business proposal in three ways: Discussion, Evaluation and Voting.

In discussion, members of congress can share opinions on proposals, recommend good proposals, and display them sorted by the latest and number of recommendations.

Members of congress can comment on registered opinions, and registered opinion and comments can not be modified or deleted.

In evaluating, the suitability of the proposal is evaluated to determine whether to accept it as a formal proposal. Evaluation will be conducted for 7 days including the date of registration of the proposal.

In voting, members of congress can vote for, against, or abstain from proposals that have passed evaluation.

Voting is done to reach consensus.

Voting information is recorded in blocks for transparency.

The hash of the voting information is recorded so that the voting information is not disclosed until the end of the voting.

After voting ends, voting information is recorded in a block, and voting information is aggregated and verified using the hash already recorded.

A quorum for decision-making is one-third of all members of the congress.

A proposal is approved if the percentage of votes in favor exceeds the percentage of votes against by 10%.

Funds can be withdrawn 24 hours after the closing time for voting.

Funds can not be withdrawn if the foundation vetoes it.

Deploy Smart Contract

Three deploy methods are described in this section.

System Proposal

Any member of congress can begin the decision-making process by writing a system proposal.

Proposal authors must provide the following information so that other members of the congress can understand and participate:

  • Type of proposal

  • Title of proposal

  • Voting period

  • Goals and descriptions

  • Related attachments

In order to prevent abuse, a small fee must be paid according to the policy when registering the proposal, and the fee to be paid is calculated and presented automatically.

Members of congress can participate in the proposed system proposal in two ways: Discussion and Voting.

In Discussion, members of congress can share opinions on proposals, recommend good proposals, and display them sorted by the latest and number of recommendations.

Members of congress can comment on registered opinions, and registered opinions and comments cannot be modified or deleted.

In voting, members of congress can vote for, against, or abstain from system proposals.

Voting is done to reach consensus.

Voting information is recorded in blocks for transparency.

The hash of the voting information is recorded so that the voting information is not disclosed until the end of the voting.

After voting ends, voting information is recorded in a block, and voting information is aggregated and verified using the hash already recorded.

A quorum for decision-making is one-third of all members of the congress.

A proposal is approved if the percentage of votes in favor exceeds the percentage of votes against by 10%.

If the proposal is approved, the development team proceeds with the development according to the proposal.

Agora Testnet

How to install a node for the Agora Testnet

Install Docker Engine

For Linux or MacOS users

Install testnet

mkdir agora-chain
cd agora-chain
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/agora.sh)"
./agora.sh network testnet
  • Available commands and descriptions of agora.sh

    ./agora.sh 
    agora.sh version 2.0.0
    Usage: ./agora.sh PROCESS FLAGS.
    PROCESS can be el-node, cl-node, validator, docker-compose, docker-compose-monitoring, start, stop, upgrade
    
    ./agora.sh network <network to change>
           - <network to change> is one of mainnet, testnet, and devnet, and the default is mainnet.
           - If <network to change> is not specified, it shows the currently set up network.
    
    ./agora.sh el-node ( init, run )
        el-node init
           - Initialize agora-el. At this point, all existing block data is deleted.
        el-node run
           - Run agora-el.
    
    ./agora.sh cl-node ( run )
        cl-node run
           - Run agora-cl.
    
    ./agora.sh validator ( accounts, exit, withdraw, slashing-protection-history )
    
    ./agora.sh validator accounts ( import, list, backup )
        validator accounts import <validator keys folder>
           - Add the validator's keys to the local wallet.
        validator accounts list
           - Show the validator's keys stored in the local wallet.
        validator accounts delete
           - Delete the validator's keys from the local wallet.
        validator accounts backup <validator keys folder>
           - Back up the validator's keys stored in the local wallet.
    
        validator exit
           - Used to voluntarily exit the validator's function. After this is done, you will see a screen where you select the validator's keys.
        validator withdraw <data folder>
           - Send pre-created withdrawal address registration data to the network.
           - Currently, only devnet is supported. Other networks will be supported later.
    
    ./agora.sh validator slashing-protection-history ( export, import ) 
        validator slashing-protection-history export <data folder>
           - Save the information that the verifiers worked on as a file. At this point, the validator on the current server must be stopped.
           - One validator must validate only once per block. Otherwise, the validator may be slashed.
               - If a validator runs on multiple servers, that validator may violate the above condition.
               - If a validator's server is changed to another server, the validator may violate the above condition.
               - To avoid this, you need to transfer the block verification information that the validators has performed so far.
        validator slashing-protection-history import <data folder>
           - Register block verification information performed by validators.
    
    ./agora.sh deposit-cli ( new-mnemonic, existing-mnemonic, generate-bls-to-execution-change )
        deposit-cli new-mnemonic
           - This command is used to generate keystores with a new mnemonic.
        deposit-cli existing-mnemonic
           - This command is used to re-generate or derive new keys from your existing mnemonic.
        deposit-cli generate-bls-to-execution-change <data folder>
           - Generates the data required to register the address to which the validator's amount will be withdrawn.
           - Currently, only devnet is supported. Other networks will be supported later.        
    
    ./agora.sh docker-compose ( up, down )
        docker-compose up
           - Run agora-el, agora-cl, validator.
        docker-compose down
           - Stop agora-el, agora-cl, validator.
    
    ./agora.sh docker-compose-monitoring ( up, down )
        docker-compose-monitoring up
            - Run agora-el, agora-cl, validator, and containers required for monitoring.
        docker-compose-monitoring down
           - Stop agora-el, agora-cl, validator, and containers required for monitoring.
    
    ./agora.sh start
           - Run agora-el, agora-cl, validator, and containers required for monitoring.
           - It's the same as './agora.sh docker-compose-monitoring up'
    
    ./agora.sh stop
           - Stop agora-el, agora-cl, validator, and containers required for monitoring.
           - It's the same as './agora.sh docker-compose-monitoring down'
    
    ./agora.sh upgrade
           - The latest version is installed, at which point the user data is preserved.

Upgrade for Linux or macOS

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.sh)"

Execution Layer for Linux or MacOS

  • Init execution node

    ./agora.sh el-node init
  • Run execution node

    ./agora.sh el-node run

Consensus Layer for Linux or MacOS

  • Run consensus node

    ./agora.sh cl-node run

Agora validator (Agora-cl-validator)

This step is optional but essential if you want to participate in securing the Agora Blockchain, have the right to vote, and receive rewards.

Create personal keys and prepare deposit data and deposit stake

Validator accounts for Linux or MacOS

  • Generate your validator keys when you don't have mnemonic

    ./agora.sh deposit-cli new-mnemonic
  • Generate your validator keys when you have mnemonic

    ./agora.sh deposit-cli existing-mnemonic
  • Import your key stores

    ./agora.sh validator import <your key stores folder>

    or

    ./agora.sh validator accounts import <your key stores folder>

    <your key stores folder> is where the validator keys are stored. The default folder is ./validator_keys

  • List your key stores in your wallet

    ./agora.sh validator accounts list
  • Backup your key stores in your wallet

    ./agora.sh validator accounts backup <folder>

    <folder> is where the backup key is stored. The default folder is ./backup-wallet

Validator execution for Linux or MacOS

  • Run validator

    ./agora.sh validator run

Validator exit for Linux or MacOS

  • Voluntary exit of the validator

    ./agora.sh validator exit

Validator withdrawals for Linux or MacOS

  • Generate the SignedBLSToExecutionChange data to enable withdrawals

    ./agora.sh deposit-cli generate-bls-to-execution-change <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

  • Send the SignedBLSToExecutionChange data to enable withdrawals

    ./agora.sh validator withdraw <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

Validator slashing protection for Linux or MacOS

  • export

    ./agora.sh validator slashing-protection-history export <folder>

    <folder> is where the slashing protection history data is stored. The default folder is ./slashing-protection-export

  • import

    ./agora.sh validator slashing-protection-history import <folder>

    <folder> is where the slashing protection history data is stored. The default folder is ./slashing-protection-export

Using docker-compose for Linux or MacOS

  1. Init the execution node

./agora.sh el-node init
  1. Import your key stores

./agora.sh validator import <your key stores folder>

or

./agora.sh validator accounts import <your key stores folder>
  1. Edit wallet password

nano ./root/config/cl/password.txt
  1. Edit transaction fee receiving address

nano ./root/config/cl/proposer_config.json
  1. Run docker-compose

./agora.sh docker-compose up
  1. Stop docker-compose

./agora.sh docker-compose down

Using docker-compose with monitoring for Linux or MacOS

  1. Init the execution node

./agora.sh el-node init
  1. Import your key stores

./agora.sh validator import <your key stores folder>

or

./agora.sh validator accounts import <your key stores folder>
  1. Edit wallet password

nano ./root/config/cl/password.txt
  1. Edit transaction fee receiving address

nano ./root/config/cl/proposer_config.json
  1. Run docker-compose

./agora.sh docker-compose-monitoring up

or

./agora.sh start
  1. Stop docker-compose

./agora.sh docker-compose-monitoring down

or

./agora.sh stop

To check the status and rewards of the validator

For Windows users

Install Testnet

mkdir agora-chain
cd agora-chain
curl -S -L -o agora.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/agora.bat
call agora.bat
agora.bat network testnet
  • Available commands and descriptions of agora.bat

    agora.bat
    agora.bat version 2.0.0
    Usage: agora.bat PROCESS FLAGS.
    PROCESS can be el-node, cl-node, validator, docker-compose, docker-compose-monitoring, start, stop, upgrade
    
    agora.bat network <network to change>
           - <network to change> is one of mainnet, testnet, and devnet, and the default is mainnet.
           - If <network to change> is not specified, it shows the currently set up network.
    
    agora.bat el-node ( init, run )
        el-node init
           - Initialize agora-el. At this point, all existing block data is deleted.
        el-node run
           - Run agora-el.
    
    agora.bat cl-node ( run )
        cl-node run
           - Run agora-cl.
    
    agora.bat validator ( accounts, exit, withdraw, slashing-protection-history )
    
    agora.bat validator accounts ( import, list, backup )
        validator accounts import <validator keys folder>
           - Add the validator's keys to the local wallet.
        validator accounts list
           - Show the validator's keys stored in the local wallet.
        validator accounts delete
           - Delete the validator's keys from the local wallet.
        validator accounts backup <validator keys folder>
           - Back up the validator's keys stored in the local wallet.
    
        validator exit
           - Used to voluntarily exit the validator's function. After this is done, you will see a screen where you select the validator's keys.
        validator withdraw <data folder>
           - Send pre-created withdrawal address registration data to the network.
           - Currently, only devnet is supported. Other networks will be supported later.
    
    agora.bat validator slashing-protection-history ( export, import ) 
        validator slashing-protection-history export <data folder>
           - Save the information that the verifiers worked on as a file. At this point, the validator on the current server must be stopped.
           - One validator must validate only once per block. Otherwise, the validator may be slashed.
               - If a validator runs on multiple servers, that validator may violate the above condition.
               - If a validator's server is changed to another server, the validator may violate the above condition.
               - To avoid this, you need to transfer the block verification information that the validators has performed so far.
        validator slashing-protection-history import <data folder>
           - Register block verification information performed by validators.
    
    agora.bat deposit-cli ( new-mnemonic, existing-mnemonic, generate-bls-to-execution-change )
        deposit-cli new-mnemonic
           - This command is used to generate keystores with a new mnemonic.
        deposit-cli existing-mnemonic
           - This command is used to re-generate or derive new keys from your existing mnemonic.
        deposit-cli generate-bls-to-execution-change <data folder>
           - Generates the data required to register the address to which the validator's amount will be withdrawn.
           - Currently, only devnet is supported. Other networks will be supported later.        
    
    agora.bat docker-compose ( up, down )
        docker-compose up
           - Run agora-el, agora-cl, validator.
        docker-compose down
           - Stop agora-el, agora-cl, validator.
    
    agora.bat docker-compose-monitoring ( up, down )
        docker-compose-monitoring up
            - Run agora-el, agora-cl, validator, and containers required for monitoring.
        docker-compose-monitoring down
           - Stop agora-el, agora-cl, validator, and containers required for monitoring.
    
    agora.bat start
           - Run agora-el, agora-cl, validator, and containers required for monitoring.
           - It's the same as 'agora.bat docker-compose-monitoring up'
    
    agora.bat stop
           - Stop agora-el, agora-cl, validator, and containers required for monitoring.
           - It's the same as 'agora.bat docker-compose-monitoring down'
    
    agora.bat upgrade
           - The latest version is installed, at which point the user data is preserved.

Upgrade for Windows

curl -S -L -o upgrade.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.bat
upgrade.bat

Execution Layer for Windows

  • Init execution node

    agora.bat el-node init
  • Run execution node

    agora.bat el-node run

Consensus Layer for Windows

  • Run consensus node

    agora.bat cl-node run

Agora validator (Agora-cl-validator)

This step is optional but essential if you want to participate in securing the Agora Blockchain, have the right to vote, and receive rewards.

Create personal keys and prepare deposit data and deposit stake

Validator accounts for Windows

  • Generate your validator keys when you don't have mnemonic

    agora.bat deposit-cli new-mnemonic
  • Generate your validator keys when you have mnemonic

    agora.bat deposit-cli existing-mnemonic
  • Import your key stores

    agora.bat validator import <your key stores folder>

    or

    agora.bat validator accounts import <your key stores folder>

    <your key stores folder> is where the validator keys are stored. The default folder is ./validator_keys

  • List your key stores in your wallet

    agora.bat validator accounts list
  • Backup your key stores in your wallet

    agora.bat validator accounts backup <folder>

    <folder> is where the backup key is stored. The default folder is ./backup-wallet

Validator execution for Windows

  • Run validator

    agora.bat validator run

Validator exit for Windows

  • Voluntary exit of the validator

    agora.bat validator exit

Validator withdrawals for Windows

  • Generate the SignedBLSToExecutionChange data to enable withdrawals

    agora.bat deposit-cli generate-bls-to-execution-change <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

  • Send the SignedBLSToExecutionChange data to enable withdrawals

    agora.bat validator withdraw <folder>

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

Validator slashing protection for Windows

  • export

    ./agora.bat validator slashing-protection-history export <folder>

    <folder> is where the slashing protection history data is stored. The default folder is ./slashing-protection-export

  • import

    ./agora.bat validator slashing-protection-history import <folder>

    <folder> is where the slashing protection history data is stored. The default folder is ./slashing-protection-export

Using docker-compose for Windows

  1. Init the execution node

agora.bat el-node init
  1. Import your key stores

agora.bat validator import <your key stores folder>

or

agora.bat validator accounts import <your key stores folder>
  1. Edit wallet password

notepad ./root/config/cl/password.txt
  1. Edit transaction fee receiving address

notepad ./root/config/cl/proposer_config.json
  1. Run docker-compose

agora.bat docker-compose up
  1. Stop docker-compose

agora.bat docker-compose down

Using docker-compose with monitoring for Windows

  1. Init the execution node

agora.bat el-node init
  1. Import your key stores

agora.bat validator import <your key stores folder>

or

agora.bat validator accounts import <your key stores folder>
  1. Edit wallet password

notepad ./root/config/cl/password.txt
  1. Edit transaction fee receiving address

notepad ./root/config/cl/proposer_config.json
  1. Run docker-compose

agora.bat docker-compose-monitoring up

or

agora.bat start
  1. Stop docker-compose

agora.bat docker-compose-monitoring down

or

agora.bat stop

Other features

Documentation of Agora-cl

To check the status and rewards of the validator

Agora Mainnet

How to install a node for the Agora Mainnet

Install Docker Engine

For Linux or macOS users

Install mainnet

  • Available commands and descriptions of agora.sh

Upgrade for Linux or macOS

Execution Layer for Linux or MacOS

  • Init execution node

  • Run execution node

Consensus Layer for Linux or MacOS

  • Run consensus node

Validator accounts for Linux or MacOS

  • Generate your validator keys when you don't have mnemonic

  • Generate your validator keys when you have mnemonic

  • Import your key stores

    or

    <your key stores folder> is where the validator keys are stored. The default folder is ./validator_keys

  • List your key stores in your wallet

  • Backup your key stores in your wallet

    <folder> is where the backup key is stored. The default folder is ./backup-wallet

Validator execution for Linux or MacOS

  • Run validator

Validator exit for Linux or MacOS

  • Voluntary exit of the validator

Validator withdrawals for Linux or MacOS

  • Generate the SignedBLSToExecutionChange data to enable withdrawals

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

  • Send the SignedBLSToExecutionChange data to enable withdrawals

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

Validator slashing protection for Linux or MacOS

  • export

    <folder> is where the slashing protection history data is stored. The default folder is ./slashing-protection-export

  • import

    <folder> is where the slashing protection history data is stored. The default folder is ./slashing-protection-export

Using docker-compose for Linux or MacOS

  1. Init the execution node

  1. Import your key stores

or

  1. Edit wallet password

  1. Edit transaction fee receiving address

  1. Run docker-compose

  1. Stop docker-compose

Using docker-compose with monitoring for Linux or MacOS

  1. Init the execution node

  1. Import your key stores

or

  1. Edit wallet password

  1. Edit transaction fee receiving address

  1. Run docker-compose

or

  1. Stop docker-compose

or

For Windows users

Install Mainnet for Windows

  • Available commands and descriptions of agora.bat

Upgrade for Windows

Execution Layer for Windows

  • Init execution node

  • Run execution node

Consensus Layer for Windows

  • Run consensus node

Validator accounts for Windows

  • Generate your validator keys when you don't have mnemonic

  • Generate your validator keys when you have mnemonic

  • Import your key stores

    or

    <your key stores folder> is where the validator keys are stored. The default folder is ./validator_keys

  • List your key stores in your wallet

  • Backup your key stores in your wallet

    <folder> is where the backup key is stored. The default folder is ./backup-wallet

Validator execution for Windows

  • Run validator

Validator exit for Windows

  • Voluntary exit of the validator

Validator withdrawals for Windows

  • Generate the SignedBLSToExecutionChange data to enable withdrawals

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

  • Send the SignedBLSToExecutionChange data to enable withdrawals

    <folder> is where the SignedBLSToExecutionChange data is stored. The default folder is ./bls_to_execution_changes

Validator slashing protection for Windows

  • export

    <folder> is where the slashing protection history data is stored. The default folder is ./slashing-protection-export

  • import

    <folder> is where the slashing protection history data is stored. The default folder is ./slashing-protection-export

Using docker-compose for Windows

  1. Init the execution node

  1. Import your key stores

or

  1. Edit wallet password

  1. Edit transaction fee receiving address

  1. Run docker-compose

  1. Stop docker-compose

Using docker-compose with monitoring for Windows

  1. Init the execution node

  1. Import your key stores

or

  1. Edit wallet password

  1. Edit transaction fee receiving address

  1. Run docker-compose

or

  1. Stop docker-compose

or

Other features

Documentation of Agora-cl

To check the status and rewards of the validator

Using Hardhat

What is Hardhat

Hardhat is a development environment to compile, deploy, test, and debug your smart contract.

Setting up the development environment

There are a few technical requirements before we start. Please install the following: Requirements:

Installing

There are a few technical requirements before we start. Please install the following: Requirements:

  • Windows, Linux, or Mac OS X

First, you need to create an empty project npm init --yes

Once your project is ready, you should run

It's recommended to install some dependencies.

To use your local installation of Hardhat, you need to use npx to run it (i.e. npx hardhat).

Create A Project

To create your Hardhat project run npx hardhat in your project folder:

  • Initialize your project:

Once this project is initialized, you'll now have a project structure with the following items:

  • contracts/: Directory for Solidity contracts

  • scripts/: Directory for scriptable deployment files

  • test/: Directory for test files for testing your application and contracts

  • hardhat-config.js: Hardhat configuration file

Create Contract

Config Hardhat for Agora(BizNet)

  • Go to hardhat.config.js

  • Update the config

Note It requires a mnemonic to be passed in for Provider, this is the seed phrase for the account you'd like to deploy from. Create a new .secret file in the root directory and enter your 12-word mnemonic seed phrase to get started. To get the seed words from metamask wallet you can go to Metamask Settings, then from the menu choose Security and Privacy where you will see a button that says reveal seed words.

Compile Contract

To compile a Hardhat project, change to the root of the directory where the project is located and then type the following into a terminal:

Deploying on Agora(BizNet) Network

Run this command at root of the project directory:

Remember your address, transaction_hash and other details provided would differ, Above is just to provide an idea of structure.

Congratulations! You have successfully deployed ERC20 Smart Contract. Now you can interact with the Smart Contract.

Using Remix

Deploys a ERC20 smart contract with a message, and renders it in the front-end. You can interact with the smart contract easily!

  • Remix is an online IDE to develop smart contracts.

  • You need to choose Solidity Compiler and Deploy and Run Transactions.

  • Go to File Explorers, And Create a new file, Name it ERC20Token.sol

  • Copy/Paste the Smart contract below into the newly created file ERC20Token.sol

Writing the Smart Contract

  • Modify "TOKEN_NAME", "TOKEN_SYMBOL", "DECIMALS" and "TOTAL_SUPPLY" according to your requirements.

Compile Smart Contract

  • Step1: Click the button to switch to compile page

  • Step2: Select the "ERC20Token" contract

  • Step3: Enable "Auto compile" and "optimization"

  • Step4: Click "ABI" to copy contract ABI and save it.

Deploy Smart Contract Using TestNet

Now, We have to deploy our smart contract on BizNet Network. For that, we have to connect to web3 world, We will be using Metamask.

  • Copy your address from Metamask

  • Now, let's Deploy the Smart Contract on Testnet

  • Select "Injected Web3" in the ENVIRONMENT dropdown and your contract

  • Metamask accepts the Connection Request!

  • From the CONTRACT dropdown menu, select the ERC20Token.sol you created earlier.

  • Click the Deploy button in Remix and accept another Metamask popup that requires transaction confirmation once connected!

To run an Agora node, you must first have Docker installed and running. See for instructions on how to install the Docker Engine

See for instructions on how to install

If you want to test transfers then tBOA can be obtained from the Testnet Faucet at <Your testnet account>

However, in this section we are using the Agora Testnet BOA so rewards have no real value. Do not use real BOA in Testnet but request 40,000 tBOA by sending an email to with subject "validator" or if this fails then make a request in Telegram at .

Go to website

If you want to test transfers then tBOA can be obtained from the Testnet Faucet at <Your testnet account>

However, in this section we are using the Agora Testnet BOA so rewards have no real value. Do not use real BOA in Testnet but request 40,000 tBOA by sending an email to with subject "validator" or if this fails then make a request in Telegram at .

Go to website

Go to website

To run an Agora node, you must first have Docker installed and running. See for instructions on how to install the Docker Engine

See for instructions on how to install

Go to website

Go to website

You can write your own smart contract or download the .

You can check the deployment status here: or

This dApp implements a "Hello World" style application that echoes a message passed to the contract to the front end. This tutorial is intended to be followed using the online IDE available at .

Setting Up

Create a new contract ERC20Token.sol and copy the contract code from the ERC20 token template

In the first line, pragma solidity ^0.8.0 specifies that the source code is for a Solidity version greater than 0.8.0. are common instructions for compilers about how to treat the source code (e.g., pragma once).

A contract in the sense of Solidity is a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum blockchain. Learn more about the and in the docs.

Head over to Faucet - and request test BOA

Congratulations! You have successfully deployed an ERC20 Contract. Now you can interact with the Smart Contract. Check the deployment status here:

here
https://docs.docker.com/engine/install/
here
https://faucet.bosagora.org/request/boa/
agora-chain@bosagora.io
https://t.me/bosagora_eng
https://testnet-agora-staking.bosagora.org
https://testnet.agorascan.io/
https://faucet.bosagora.org/request/boa/
agora-chain@bosagora.io
https://t.me/bosagora_eng
https://testnet-agora-staking.bosagora.org
https://agora-cl-docs.bosagora.org/
https://testnet.agorascan.io
mkdir agora-chain
cd agora-chain
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/agora.sh)"
./agora.sh network mainnet
./agora.sh 
agora.sh version 2.0.0
Usage: ./agora.sh PROCESS FLAGS.
PROCESS can be el-node, cl-node, validator, docker-compose, docker-compose-monitoring, start, stop, upgrade

./agora.sh network <network to change>
       - <network to change> is one of mainnet, testnet, and devnet, and the default is mainnet.
       - If <network to change> is not specified, it shows the currently set up network.

./agora.sh el-node ( init, run )
    el-node init
       - Initialize agora-el. At this point, all existing block data is deleted.
    el-node run
       - Run agora-el.

./agora.sh cl-node ( run )
    cl-node run
       - Run agora-cl.

./agora.sh validator ( accounts, exit, withdraw, slashing-protection-history )

./agora.sh validator accounts ( import, list, backup )
    validator accounts import <validator keys folder>
       - Add the validator's keys to the local wallet.
    validator accounts list
       - Show the validator's keys stored in the local wallet.
    validator accounts delete
       - Delete the validator's keys from the local wallet.
    validator accounts backup <validator keys folder>
       - Back up the validator's keys stored in the local wallet.

    validator exit
       - Used to voluntarily exit the validator's function. After this is done, you will see a screen where you select the validator's keys.
    validator withdraw <data folder>
       - Send pre-created withdrawal address registration data to the network.
       - Currently, only devnet is supported. Other networks will be supported later.

./agora.sh validator slashing-protection-history ( export, import ) 
    validator slashing-protection-history export <data folder>
       - Save the information that the verifiers worked on as a file. At this point, the validator on the current server must be stopped.
       - One validator must validate only once per block. Otherwise, the validator may be slashed.
           - If a validator runs on multiple servers, that validator may violate the above condition.
           - If a validator's server is changed to another server, the validator may violate the above condition.
           - To avoid this, you need to transfer the block verification information that the validators has performed so far.
    validator slashing-protection-history import <data folder>
       - Register block verification information performed by validators.

./agora.sh deposit-cli ( new-mnemonic, existing-mnemonic, generate-bls-to-execution-change )
    deposit-cli new-mnemonic
       - This command is used to generate keystores with a new mnemonic.
    deposit-cli existing-mnemonic
       - This command is used to re-generate or derive new keys from your existing mnemonic.
    deposit-cli generate-bls-to-execution-change <data folder>
       - Generates the data required to register the address to which the validator's amount will be withdrawn.
       - Currently, only devnet is supported. Other networks will be supported later.        

./agora.sh docker-compose ( up, down )
    docker-compose up
       - Run agora-el, agora-cl, validator.
    docker-compose down
       - Stop agora-el, agora-cl, validator.

./agora.sh docker-compose-monitoring ( up, down )
    docker-compose-monitoring up
        - Run agora-el, agora-cl, validator, and containers required for monitoring.
    docker-compose-monitoring down
       - Stop agora-el, agora-cl, validator, and containers required for monitoring.

./agora.sh start
       - Run agora-el, agora-cl, validator, and containers required for monitoring.
       - It's the same as './agora.sh docker-compose-monitoring up'

./agora.sh stop
       - Stop agora-el, agora-cl, validator, and containers required for monitoring.
       - It's the same as './agora.sh docker-compose-monitoring down'

./agora.sh upgrade
       - The latest version is installed, at which point the user data is preserved.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.sh)"
./agora.sh el-node init
./agora.sh el-node run
./agora.sh cl-node run
./agora.sh deposit-cli new-mnemonic
./agora.sh deposit-cli existing-mnemonic
./agora.sh validator import <your key stores folder>
./agora.sh validator accounts import <your key stores folder>
./agora.sh validator accounts list
./agora.sh validator accounts backup <folder>
./agora.sh validator run
./agora.sh validator exit
./agora.sh deposit-cli generate-bls-to-execution-change <folder>
./agora.sh validator withdraw <folder>
./agora.sh validator slashing-protection-history export <folder>
./agora.sh validator slashing-protection-history import <folder>
./agora.sh el-node init
./agora.sh validator import <your key stores folder>
./agora.sh validator accounts import <your key stores folder>
nano ./root/config/cl/password.txt
nano ./root/config/cl/proposer_config.json
./agora.sh docker-compose up
./agora.sh docker-compose down
./agora.sh el-node init
./agora.sh validator import <your key stores folder>
./agora.sh validator accounts import <your key stores folder>
nano ./root/config/cl/password.txt
nano ./root/config/cl/proposer_config.json
./agora.sh docker-compose-monitoring up
./agora.sh start
./agora.sh docker-compose-monitoring down
./agora.sh stop
mkdir agora-chain
cd agora-chain
curl -S -L -o agora.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/agora.bat
call agora.bat
agora.bat network mainnet
agora.bat
agora.bat version 2.0.0
Usage: agora.bat PROCESS FLAGS.
PROCESS can be el-node, cl-node, validator, docker-compose, docker-compose-monitoring, start, stop, upgrade

agora.bat network <network to change>
       - <network to change> is one of mainnet, testnet, and devnet, and the default is mainnet.
       - If <network to change> is not specified, it shows the currently set up network.

agora.bat el-node ( init, run )
    el-node init
       - Initialize agora-el. At this point, all existing block data is deleted.
    el-node run
       - Run agora-el.

agora.bat cl-node ( run )
    cl-node run
       - Run agora-cl.

agora.bat validator ( accounts, exit, withdraw, slashing-protection-history )

agora.bat validator accounts ( import, list, backup )
    validator accounts import <validator keys folder>
       - Add the validator's keys to the local wallet.
    validator accounts list
       - Show the validator's keys stored in the local wallet.
    validator accounts delete
       - Delete the validator's keys from the local wallet.
    validator accounts backup <validator keys folder>
       - Back up the validator's keys stored in the local wallet.

    validator exit
       - Used to voluntarily exit the validator's function. After this is done, you will see a screen where you select the validator's keys.
    validator withdraw <data folder>
       - Send pre-created withdrawal address registration data to the network.
       - Currently, only devnet is supported. Other networks will be supported later.

agora.bat validator slashing-protection-history ( export, import ) 
    validator slashing-protection-history export <data folder>
       - Save the information that the verifiers worked on as a file. At this point, the validator on the current server must be stopped.
       - One validator must validate only once per block. Otherwise, the validator may be slashed.
           - If a validator runs on multiple servers, that validator may violate the above condition.
           - If a validator's server is changed to another server, the validator may violate the above condition.
           - To avoid this, you need to transfer the block verification information that the validators has performed so far.
    validator slashing-protection-history import <data folder>
       - Register block verification information performed by validators.

agora.bat deposit-cli ( new-mnemonic, existing-mnemonic, generate-bls-to-execution-change )
    deposit-cli new-mnemonic
       - This command is used to generate keystores with a new mnemonic.
    deposit-cli existing-mnemonic
       - This command is used to re-generate or derive new keys from your existing mnemonic.
    deposit-cli generate-bls-to-execution-change <data folder>
       - Generates the data required to register the address to which the validator's amount will be withdrawn.
       - Currently, only devnet is supported. Other networks will be supported later.        

agora.bat docker-compose ( up, down )
    docker-compose up
       - Run agora-el, agora-cl, validator.
    docker-compose down
       - Stop agora-el, agora-cl, validator.

agora.bat docker-compose-monitoring ( up, down )
    docker-compose-monitoring up
        - Run agora-el, agora-cl, validator, and containers required for monitoring.
    docker-compose-monitoring down
       - Stop agora-el, agora-cl, validator, and containers required for monitoring.

agora.bat start
       - Run agora-el, agora-cl, validator, and containers required for monitoring.
       - It's the same as 'agora.bat docker-compose-monitoring up'

agora.bat stop
       - Stop agora-el, agora-cl, validator, and containers required for monitoring.
       - It's the same as 'agora.bat docker-compose-monitoring down'

agora.bat upgrade
       - The latest version is installed, at which point the user data is preserved.
curl -S -L -o upgrade.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.bat
upgrade.bat
agora.bat el-node init
agora.bat el-node run
agora.bat cl-node run
agora.bat deposit-cli new-mnemonic
agora.bat deposit-cli existing-mnemonic
agora.bat validator import <your key stores folder>
agora.bat validator accounts import <your key stores folder>
agora.bat validator accounts list
agora.bat validator accounts backup <folder>
agora.bat validator run
agora.bat validator exit
agora.bat deposit-cli generate-bls-to-execution-change <folder>
agora.bat validator withdraw <folder>
./agora.bat validator slashing-protection-history export <folder>
./agora.bat validator slashing-protection-history import <folder>
agora.bat el-node init
agora.bat validator import <your key stores folder>
agora.bat validator accounts import <your key stores folder>
notepad ./root/config/cl/password.txt
notepad ./root/config/cl/proposer_config.json
agora.bat docker-compose up
agora.bat docker-compose down
agora.bat el-node init
agora.bat validator import <your key stores folder>
agora.bat validator accounts import <your key stores folder>
notepad ./root/config/cl/password.txt
notepad ./root/config/cl/proposer_config.json
agora.bat docker-compose-monitoring up
agora.bat start
agora.bat docker-compose-monitoring down
agora.bat stop
npm install --save-dev hardhat
npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers
mkdir MegaCoin
cd MegaCoin
$ npx hardhat
888    888                      888 888               888
888    888                      888 888               888
888    888                      888 888               888
8888888888  8888b.  888d888 .d88888 88888b.   8888b.  888888
888    888     "88b 888P"  d88" 888 888 "88b     "88b 888
888    888 .d888888 888    888  888 888  888 .d888888 888
888    888 888  888 888    Y88b 888 888  888 888  888 Y88b.
888    888 "Y888888 888     "Y88888 888  888 "Y888888  "Y888

Welcome to Hardhat v2.0.8

? What do you want to do? …
❯ Create a sample project
  Create an empty hardhat.config.js
  Quit
require("@nomiclabs/hardhat-waffle");
require('@nomiclabs/hardhat-ethers');
const { mnemonic } = require('./secrets.json');

// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async () => {
  const accounts = await ethers.getSigners();

  for (const account of accounts) {
    console.log(account.address);
  }
});

// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more

/**
 * @type import('hardhat/config').HardhatUserConfig
 */
module.exports = {
  defaultNetwork: "mainnet",
  networks: {
  	localhost: {
      url: "http://127.0.0.1:8545"
    },
    hardhat: {
    },
    testnet: {
      url: "https://testnet.bosagora.org/",
      chainId: 2019,
      gasPrice: 20000000000,
      accounts: {mnemonic: mnemonic}
    },
    mainnet: {
      url: "https://mainnet.bosagora.org/",
      chainId: 2151,
      gasPrice: 20000000000,
      accounts: {mnemonic: mnemonic}
    }
  },
  solidity: {
  version: "0.8.0",
  settings: {
    optimizer: {
      enabled: true
    }
   }
  },
  paths: {
    sources: "./contracts",
    tests: "./test",
    cache: "./cache",
    artifacts: "./artifacts"
  },
  mocha: {
    timeout: 20000
  }
};
npx hardhat compile
$  npx hardhat run --network testnet scripts/deploy.js

Introduction

VOTERA is an online decision-making tool that overcomes the challenges of group decision-making and enables more comprehensive and efficient decision-making.

By storing decision data in blocks, VOTERA ensures transparency and makes accountability clear.

To maintain confidentiality, a hash of voting data is stored in blocks for data validation during the voting period.

At the end of the voting period, the voting data is written to the block and the data is verified through the recorded hash.

Information on discussion and evaluation is stored on a separate server and is provided so that participants can view it at any time.

here
https://docs.docker.com/engine/install/
here
https://agora-cl-docs.bosagora.org/
https://www.agorascan.io/
Node.js v8.9.4 LTS or later
Git
ERC20 token smart contract template
https://scan.bosagora.org
https://testnet-scan.bosagora.org
Remix IDE
Remix IDE
here
Pragmas
constructor
memory
https://faucet.bosagora.org/request/boa/your-address
https://testnet-scan.bosagora.org

Wallets

What is a Wallet?

A crypto wallet is a device or program used for the transfer and storage of cryptocurrency. Crypto wallets can be of different types, such as paper wallets, hardware wallets, and software wallets. There are also several smartphone mobile apps and computer programs that provide a user-friendly way to create and manage wallets. Along with cryptocurrency, crypto wallets store a collection of crypto keys that are used for sending, receiving, and tracking ownership of cryptocurrencies.

A key pair is a cryptographically-derived securely generated private and public key. A private key and its corresponding public key are together known as a key pair. A wallet contains a collection of one or more key pairs and provides some means to interact with them. The security of any crypto wallet depends upon how the private key is stored.

The public key is known as the wallet's receiving address or simply its address. The wallet address may be shared and displayed freely. When another party is going to send some amount of cryptocurrency to a wallet, they need to know the wallet's receiving address. Depending on a blockchain's implementation, the address can also be used to view certain information about a wallet, such as viewing the balance, but has no ability to change anything about the wallet or withdraw any tokens.

In order to send cryptocurrencies to another address or to make any changes to the wallet, the private key is used for digitally signing the transactions. It is important to note that the private key must never be shared and should always be kept securely. If by any means access is gained to the private key attached to a wallet, the attacker can withdraw all the tokens contained. Furthermore, if the private key for a wallet is lost, any tokens that have been sent to or stored in that wallet's address are permanently lost.

Supported Wallets

  • List of Wallets Supporting Agora

Key Management

This article is a guide about key management strategy on the client side of your Decentralised Application on Agora

Setup Web3

web3.js is a javascript library that allows our client-side application to talk to the blockchain. We configure web3 to communicate via Metamask.

Connect to Agora network

    // mainnet 
    const web3 = new Web3('https://mainnet.bosagora.org');
    // testnet
    const web3 = new Web3('https://testnet.bosagora.org');

Set up account

If the installation and instantiation of web3 were successful, the following should successfully return a random account:

    const account = web3.eth.accounts.create();

Recover account

If you have a backup private key to your account, you can use it to restore your account.

    const account = web3.eth.accounts.privateKeyToAccount("$private-key")

Full Example

const Web3 = require('web3');
async function main() {

    const web3 = new Web3('https://mainnet.bosagora.org:443');
    const loader = setupLoader({ provider: web3 }).web3;

    const account = web3.eth.accounts.create();
    console.log(account);
}

NFT Metadata Standard

Implementing Token URI

To facilitate a marketplace on BizNet to pull in off-chain metadata for ERC721 assets, the NFT contract will need to return a URI where the metadata can be found. To find this URI, the token URI method in ERC721 and the URI method in ERC1155 are used to track your NFT. You should implement the function in the Contract:

/**
 * @dev Returns a URI for a given token ID
 */
function tokenURI(uint256 _tokenId) public view returns (string) {
  return Strings.strConcat(
      baseTokenURI(),
      Strings.uint2str(_tokenId)
  );
}

The token URI function in your Contract should return an HTTP or IPFS URL. When queried, this URL should in turn return a JSON blob of data with the metadata for your token.

Metadata Structure

{
    "name":"NFT Name",
    "description":"NFT Description",
    "image":"https://somedomain.com/pic/xxxx.jpg",
    "external_url":"https://originalsite.io/2",
    "attributes":[...]
}

Here's how each of these properties works:

Property
Description

name

Name of the item. Max 200 characters.

description

A human-readable description of the item. Markdown is supported. Max 500 characters.

image

This is the URL to the image of the item. It can be just about any type of image. A 350 x 350 image is recommended.

animation_url

This is the URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA.

animation_type

This is the file format of the multi-media attachment provided from animation_url.

external_url

This is the URL that will appear below the asset's image on the marketplace and will allow users to leave the marketplace and view the item on your site.

attributes

These are the attributes for the item to describe the detail of the NFT. (see array below)

Attributes

To present NFT traits, include the following array in the metadata:

{
    "attributes":[
        {
            "trait_type":"Rarity Class",
            "value":"Normal"
        },
        {
            "trait_type":"Type",
            "value":"Male"
        },
        {
            "trait_type":"Face",
            "value":"Mole"
        },
        {
            "trait_type":"Beard",
            "value":"Chinstrap"
        },
        {
            "display_type":"boost_number",
            "trait_type":"Power",
            "value":"Power"
        },
        {
            "display_type":"boost_percentage",
            "trait_type":"Health Increase",
            "value":"20"
        },
        {
            "display_type":"number",
            "trait_type":"Generation",
            "value":"3"
        }
    ]
}

Here trait_type is the name of the trait, value is the value of the trait, and display_type is a field indicating how you would like a numeric value should be displayed. For string traits, you don't have to worry about display_type. All traits included in the attributes will be displayed in Attribute. If you don't want to have a trait_type for a particular trait, you can include just a value in the trait and it will be set as a generic attribute.

Numeric Traits

There are 3 supported options for display_type: number will show the value in pure number, boost_number allows you to show the number with a Plus or Minus symbol, and boost_percentage is similar to boost_number but will show a percent sign behind the number.

Date

The marketplace also supports date traits in date display_type. Pass in a UNIX timestamp as the value.

   {
      "display_type": "date", 
      "trait_type": "birthday", 
      "value": 1608490000
    }
    

ERC-20 Tokens

  constructor() public {
    _name = {{TOKEN_NAME}};
    _symbol = {{TOKEN_SYMBOL}};
    _decimals = {{DECIMALS}};
    _totalSupply = {{TOTAL_SUPPLY}};
    _balances[msg.sender] = _totalSupply;

    emit Transfer(address(0), msg.sender, _totalSupply);
  }

Connect to BizNet's public RPC endpoint

const Web3 = require('web3');
// mainnet
const web3 = new Web3('https://mainnet.bosagora.org');

// testnet
const web3 = new Web3('https://testnet.bosagora.org');

Create a Wallet

web3.eth.accounts.create([entropy]);

Output:

web3.eth.accounts.create();
{
  address: '0x926605D0729a968266f1BB299d8Df0471C4F5367',
  privateKey: '0x6b4618539d95f205f33e916e89404b301dde545c0c4acc181fd0c0b42708bad3',
  signTransaction: [Function: signTransaction],
  sign: [Function: sign],
  encrypt: [Function: encrypt]
}

Recover a Wallet

const account = web3.eth.accounts.privateKeyToAccount("0xe500f5754d761d74c3eb6c2566f4c568b81379bf5ce9c1ecd475d40efe23c577")

Check Balance

web3.eth.getBalance(holder).then(console.log);

Output:

The balance will be bumped by e18 for BOA.

6249621999900000000

Create Transaction

Parameters

  • Object - The transaction object to send:

  • from - String|Number: The address for the sending account. Uses the web3.eth.defaultAccount property, if not specified. Or an address or index of a local wallet in web3.eth.accounts.wallet.

  • to - String: (optional) The destination address of the message, left undefined for a contract-creation transaction.

  • value - Number|String|BN|BigNumber: (optional) The value transferred for the transaction in wei, also the endowment if it’s a contract-creation transaction.

  • gas - Number: (optional, default: To-Be-Determined) The amount of gas to use for the transaction (unused gas is refunded).

  • gasPrice - Number|String|BN|BigNumber: (optional) The price of gas for this transaction in wei, defaults to web3.eth.gasPrice.

  • data - String: (optional) Either a ABI byte string containing the data of the function call on a contract, or in the case of a contract-creation transaction the initialization code.

  • nonce - Number: (optional) Integer of a nonce. This allows overwriting your own pending transactions that use the same nonce.

	// // Make a transaction using the promise
	web3.eth.sendTransaction({
	    from: holder,
	    to: '0x0B75fbeB0BC7CC0e9F9880f78a245046eCBDBB0D',
	    value: '1000000000000000000',
	    gas: 5000000,
        gasPrice: 18e9,
	}, function(err, transactionHash) {
      if (err) {
        console.log(err);
        } else {
        console.log(transactionHash);
       }
    });

Deploy NFTs

In this tutorial, we will create a non-fungible token (NFT) and deploy it to a public testnet.

Setting up the Environment

We begin by creating a new project.

$ mkdir mynft && cd mynft
$ npm init -y
$ npm i --save-dev @openzeppelin/contracts
$ npm i truffle

Getting the Contract Artifacts

We will set up our Solidity project using truffle init to create a contracts directory and configuration to connect to a network.

$ npx truffle init
Starting init...
================

> Copying project files to

Init successful, sweet!

The Preset contracts have already been compiled, so we only need to copy the artifacts to the build/contracts directory.

$ mkdir -p build/contracts/
$ cp node_modules/@openzeppelin/contracts/build/contracts/* build/contracts/

Using your favorite editor create 2_deploy.js in the migrations directory with the following contents:

// migrations/2_deploy.js
// SPDX-License-Identifier: MIT
const ERC721PresetMinterPauserAutoId = artifacts.require("ERC721PresetMinterPauserAutoId");

module.exports = function(deployer) {
  deployer.deploy(ERC721PresetMinterPauserAutoId, "My NFT","NFT", "http://my-json-server.typicode.com/huangsuyu/nft/tokens");
};

Deploy the Contract to a Local Blockchain

$ npx truffle develop
Truffle Develop started at http://127.0.0.1:9545/

Accounts:
(0) 0xc7e4bbc4269fdc62f879834e363173aee7895f45

Private Keys:
(0) ef424b4dc91a9c9d6c1fc4ae0a50ce80668f3a955a7e982584b45577e2c70e27

Mnemonic: mechanic cannon setup general indicate people notable frown poet friend credit true

⚠️  Important ⚠️ : This mnemonic was created for you by Truffle. It is not secure.
Ensure you do not use it on production blockchains, or else you risk losing funds.

truffle(develop)> migrate

Compiling your contracts...
===========================
> Compiling ./contracts/Migrations.sol
> Artifacts written to /Users/Documents/work/mynft/build/contracts
> Compiled successfully using:
   - solc: 0.5.16+commit.9c3226ce.Emscripten.clang

Starting migrations...
======================
> Network name:    'develop'
> Network id:      5777
> Block gas limit: 6721975 (0x6691b7)

1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------
   > transaction hash:    0x9a17a50e6efd52ba3e55245c76c52b065d20587add45aee732c233987033e567
   > Blocks: 0            Seconds: 0
   > contract address:    0x77409B688eA5461078a31450F3138EA8324F72C9
   > block number:        1
   > block timestamp:     1604387655
   > account:             0xc7e4bBc4269fdC62F879834E363173aeE7895F45
   > balance:             99.99616114
   > gas used:            191943 (0x2edc7)
   > gas price:           20 gwei
   > value sent:          0 BOA
   > total cost:          0.00383886 BOA


   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:          0.00383886 BOA


2_deploy.js
===========

   Deploying 'ERC721PresetMinterPauserAutoId'
   ------------------------------------------
   > transaction hash:    0xc1a3994c2ad2ba706ac49934b4f480c7b3d9b94241f526afa2dfe91545145a4e
   > Blocks: 0            Seconds: 0
   > contract address:    0xEaB17D581552123695f03F12b09e378EE9463b44
   > block number:        3
   > block timestamp:     1604387655
   > account:             0xc7e4bBc4269fdC62F879834E363173aeE7895F45
   > balance:             99.92142266
   > gas used:            3694586 (0x385ffa)
   > gas price:           20 gwei
   > value sent:          0 BOA
   > total cost:          0.07389172 BOA


   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:          0.07389172 BOA


Summary
=======
> Total deployments:   2
> Final cost:          0.07773058 BOA

truffle(develop)>

We can deploy our new NFT to our development blockchain using migrate.

truffle(develop)> migrate

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'develop'
> Network id:      5777
> Block gas limit: 6721975 (0x6691b7)


1_initial_migration.js
======================

   Replacing 'Migrations'
   ----------------------
   > transaction hash:    0x5d71b0a45a0fe20e2ca645393bb44b83fbd47351c009c48be0b8b84b610fb3b7
   > Blocks: 0            Seconds: 0
   > contract address:    0x3797c825cAC4a1FA765F6D8cd7787fB195849555
   > block number:        1
   > block timestamp:     1590736865
   > account:             0x0445c33BdCe670D57189158b88c0034B579f37cE
   > balance:             99.99671674
   > gas used:            164163 (0x28143)
   > gas price:           20 gwei
   > value sent:          0 BOA
   > total cost:          0.00328326 BOA


   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:          0.00328326 BOA


2_deploy.js
===========

   Replacing 'ERC721PresetMinterPauserAutoId'
   ------------------------------------------
   > transaction hash:    0x166d7b28f4afb949585b5a0e5b4151daa54acbcb70566b202fd62ab380a6650c
   > Blocks: 0            Seconds: 0
   > contract address:    0xDEE9411430c7Dd9b67fC6DA723DE729AdAB50AD7
   > block number:        3
   > block timestamp:     1590736866
   > account:             0x0445c33BdCe670D57189158b88c0034B579f37cE
   > balance:             99.92191642
   > gas used:            3697675 (0x386c0b)
   > gas price:           20 gwei
   > value sent:          0 BOA
   > total cost:          0.0739535 BOA


   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:           0.0739535 BOA


Summary
=======
> Total deployments:   2
> Final cost:          0.07723676 BOA

We can then use our deployed contract.

truffle(develop)> nft = await ERC721PresetMinterPauserAutoId.deployed()
undefined

Interact With Your Token

The accounts that we can use were displayed when we started truffle develop

Token Metadata

We can call the contract to read token metadata such as name, symbol and baseURI

truffle(develop)> await nft.name()
'My NFT'
truffle(develop)> await nft.symbol()
'NFT'
truffle(develop)> await nft.baseURI()

Mint

We can send a transaction to mint tokens to a given account, from an account with the minter role. In our case we are minting from the account which deployed the token, which is given the minter role.

We will mint 1 NFT with token ID 0.

truffle(develop)> await nft.mint("0x0445c33bdce670d57189158b88c0034b579f37ce")
{ tx:
   '0xd301a60dbb8ac187687f6639f200d4e6f2cfa065923092b3940330e35a26421d',
  receipt:
   { transactionHash:
      '0xd301a60dbb8ac187687f6639f200d4e6f2cfa065923092b3940330e35a26421d',
     transactionIndex: 0,
     blockHash:
      '0x3ad3cfcb26da0c969e9d5a5414a5e90a91a3a862c9e9082afc38a0ec0f1a5d00',
     blockNumber: 5,
     from: '0x0445c33bdce670d57189158b88c0034b579f37ce',
     to: '0xdee9411430c7dd9b67fc6da723de729adab50ad7',
     gasUsed: 156470,
...

We can check the owner of the token and the token URI for the metadata

truffle(develop)> await nft.ownerOf(1)
'0x0445c33BdCe670D57189158b88c0034B579f37cE'
truffle(develop)> await nft.tokenURI(1)

Metadata

How you create and host this metadata is up to you. I would suggest using a domain that you control to point to where you host the data so that you can move it as required.

Warning For production we need to store our metadata in a permanent location that can exist for the life of the token.

Deploy to a Public Testnet

Next we will deploy to Agora testnet .

You will need the following:

  • RPC URL of TestNet

  • @truffle/hdwallet-provider installed

  • Configure truffle-config.js for TestNet

  • A funded testnet account and mnemonic

  • A secrets.json or another secret-management solution. Make sure you don’t commit this to GitHub!

My truffle-config.js has the following

     testnet: {
      provider: () => new HDWalletProvider(mnemonic, `https://testnet.bosagora.org`),
      network_id: 2019,
      confirmations: 10,
      timeoutBlocks: 200,
      skipDryRun: true
    },
    mainnet: {
      provider: () => new HDWalletProvider(mnemonic, `https://mainnet.bosagora.org`),
      network_id: 2151,
      confirmations: 10,
      timeoutBlocks: 200,
      skipDryRun: true
    },

Deploy to Agora Testnet

$ npx truffle migrate --network testnet

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

Starting migrations...
======================
> Network name:    'develop'
> Network id:      5777
> Block gas limit: 6721975 (0x6691b7)


1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------
   > transaction hash:    0x9a17a50e6efd52ba3e55245c76c52b065d20587add45aee732c233987033e567
   > Blocks: 0            Seconds: 0
   > contract address:    0x77409B688eA5461078a31450F3138EA8324F72C9
   > block number:        1
   > block timestamp:     1604387655
   > account:             0xc7e4bBc4269fdC62F879834E363173aeE7895F45
   > balance:             99.99616114
   > gas used:            191943 (0x2edc7)
   > gas price:           20 gwei
   > value sent:          0 BOA
   > total cost:          0.00383886 BOA


   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:          0.00383886 BOA


2_deploy.js
===========

   Deploying 'ERC721PresetMinterPauserAutoId'
   ------------------------------------------
   > transaction hash:    0xc1a3994c2ad2ba706ac49934b4f480c7b3d9b94241f526afa2dfe91545145a4e
   > Blocks: 0            Seconds: 0
   > contract address:    0xEaB17D581552123695f03F12b09e378EE9463b44
   > block number:        3
   > block timestamp:     1604387655
   > account:             0xc7e4bBc4269fdC62F879834E363173aeE7895F45
   > balance:             99.92142266
   > gas used:            3694586 (0x385ffa)
   > gas price:           20 gwei
   > value sent:          0 BOA
   > total cost:          0.07389172 BOA


   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:          0.07389172 BOA


Summary
=======
> Total deployments:   2
> Final cost:          0.07773058 BOA

Mint

We can send a transaction to mint tokens to a given account, from an account with the minter role.

truffle(develop)> nft = await ERC721PresetMinterPauserAutoId.deployed()
undefined

In our case we are minting from the account which deployed the token, which is given the minter role.

To see configured accounts run the command accounts.

truffle(testnet)> accounts
[ '0x133d144f52705ceb3f5801b63b9ebccf4102f5ed',

We will mint 1 NFT with token ID 1. Specify the address that you want to be the token holder (0xc7e4bBc4269fdC62F879834E363173aeE7895F45 is one of my test accounts)

truffle(testnet)> await nft.mint("0x133d144f52705ceb3f5801b63b9ebccf4102f5ed")
{ tx:
   '0x0d90d4a2a4ac3f33d5220deb11e8f65adf14a6669afd18abd4cce8ca7ab58e04',
  receipt:
   { blockHash: '0x724ba66bc1d799820c05a93ae67991b21bb769fd1e9dddd5db9f725f5f633331',
     blockNumber: 3333746,
     contractAddress: null,
     cumulativeGasUsed: 164785,
     from: '0x77737a65c296012c67f8c7f656d1df81827c9541',
     gasUsed: 164785,
...

Using Truffle

Setting up the development environment

Requirements

There are a few technical requirements before we start. Please install the following: Requirements:

  • Windows, Linux, or Mac OS X

Recommendations for Windows

If you're running Truffle on Windows, you may encounter some naming conflicts that could prevent Truffle from executing properly. Please see the section on resolving naming conflicts for solutions.

Installing Truffle

Once we have those installed, we only need one command to install Truffle:

npm install -g truffle

To verify that Truffle is installed properly, type truffle version on a terminal. If you see an error, make sure that your npm modules are added to your path.

Project Creation, Compilation, and Configuration

The first step is to create a Truffle project. We'll use the *MegaCoin as an example, which creates a token that can be transferred between accounts:

Create a new directory for your Truffle project

mkdir MegaCoin
cd MegaCoin

Intialize your project:

To initialize your project use the following command

truffle init

Once this operation is completed, you'll now have a project structure with the following items:

  • contracts/: Directory for Solidity contracts

  • migrations/: Directory for scriptable deployment files

  • test/: Directory for test files for testing your application and contracts

  • truffle-config.js: Truffle configuration file

Create Contract

You can write your own smart contract or download the ERC20 token smart contract template.

Compile Contract

To compile a Truffle project, change to the root of the directory where the project is located and then type the following into a terminal:

truffle compile

Config Truffle for (Agora)BizNet

  • Go to truffle-config.js

    • Update the truffle-config

const HDWalletProvider = require('@truffle/hdwallet-provider');
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard RPC port (default: none)
      network_id: "*",       // Any network (default: none)
    },
    testnet: {
      provider: () => new HDWalletProvider(mnemonic, `https://testnet.bosagora.org`),
      network_id: 2019,
      confirmations: 10,
      timeoutBlocks: 200,
      skipDryRun: true
    },
    mainnet: {
      provider: () => new HDWalletProvider(mnemonic, `https://mainnet.bosagora.org`),
      network_id: 2151,
      confirmations: 10,
      timeoutBlocks: 200,
      skipDryRun: true
    },
  },

  // Set default mocha options here, use special reporters etc.
  mocha: {
    // timeout: 100000
  },

  // Configure your compilers
  compilers: {
    solc: {
      version: "^0.8.0"
    }
  }
}

Notice, it requires a mnemonic to be passed in for Provider, this is the seed phrase for the account you'd like to deploy from. Create a new .secret file in the root directory and enter your 12-word mnemonic seed phrase to get started. To get the seed words from Metamask wallet you can go to Metamask Settings, then from the menu choose Security and Privacy where you will see a button that says reveal seed words.

Deploying on Agora(BizNet) Network

Run this command the root of the project directory:

$ truffle migrate --network testnet

A contract will be deployed on Agora(BizNet) Testnet, it looks like this:

1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------
   > transaction hash:    0xaf4502198400bde2148eb4274b08d727a17080b685cd2dcd4aee13d8eb954adc
   > Blocks: 3            Seconds: 9
   > contract address:    0x81eCD10b61978D9160428943a0c0Fb31a5460466
   > block number:        32948
   > block timestamp:     1604049862
   > account:             0x623ac9f6E62A8134bBD5Dc96D9B8b29b4B60e45F
   > balance:             6.24574114
   > gas used:            191943 (0x2edc7)
   > gas price:           20 gwei
   > value sent:          0 BOA
   > total cost:          0.00383886 BOA

   Pausing for 5 confirmations...
   ------------------------------
   > confirmation number: 2 (block: 3223952)
   > confirmation number: 3 (block: 3223953)
   > confirmation number: 4 (block: 3223954)
   > confirmation number: 6 (block: 3223956)

   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:          0.00383886 BOA


Summary
=======
> Total deployments:   1
> Final cost:          0.00383886 BOA

Remember your address, transaction_hash and other details provided would differ, Above is just to provide an idea of structure.

Congratulations! You have successfully deployed ERC20 Smart Contract. Now you can interact with the Smart Contract.

Block explorer

Block explorers are your portal to Agora's data. You can use them to see real-time data on blocks, transactions, validators, accounts, and other on-chain activity.

Services

DATA

BOSagora is transparent by design so everything is verifiable. Block explorers provide an interface for getting this information. And this is for both the main BOSagora network and the testnets, should you need that data. Data is divided into execution data and consensus data. The execution data refers to the transactions that have been executed in a specific block. The consensus data refers to the blocks themselves and the validators who proposed them.

Here's a summary of the types of data you can get from a block explorer.

Execution data

New blocks are added to BOSagora every 12 seconds (unless a block proposer misses its turn), so a near-constant stream of data gets added to block explorers. Blocks contain a lot of important data that you may find useful:

Standard data

  • Block height - The block number and length of the blockchain (in blocks) on creation of the current block

  • Timestamp - The time at which a block was proposed

  • Transactions - The number of transactions included within the block

  • Fee recipient - The address that received gas fee tips from transactions

  • Block Reward - The amount of BOA awarded to the validator who proposed the block

  • Size - The size of the data within the block (measured in bytes)

  • Gas used - The total units of gas used by the transactions in the block

  • Gas limit - The total gas limits set by the transactions in the block

  • Base fee per gas - The minimum multiplier required for a transaction to be included in a block

  • Burnt fees - How much BOA is burned in the block

  • Extra data - Any extra data the miner has included in the block

Advanced data

  • Hash - The cryptographic hash that represents the block header (the unique identifier of the block)

  • Parent hash - The hash of the block that came before the current block

  • StateRoot - The root hash of Merkle trie which stores the entire state of the system

Gas

Not only will block explorers give you data about Gas usage in transactions and blocks, but some will give you information on the network's current gas prices. This will help you understand network usage, submit safe transactions and not overspend on gas. Look out for APIs that can help you get this information into your product's interface. Gas-specific data covers:

  • Estimated units of gas needed for a safe but slow transaction (+ estimated price and duration)

  • Estimated units of gas needed for an average transaction (+ estimated price and duration)

  • Estimated units of gas needed for a fast transaction (+ estimated price and duration)

  • Average confirmation time based on gas price

  • Contracts that are consuming gas - in other words, popular products that are seeing lots of usage on the network

  • Accounts that are spending gas - in other words, frequent network users

Transactions

Block explorers have become a common place for people to track the progress of their transactions. That's because the level of detail you can get provides extra certainty. Transaction data includes:

Standard data

  • Transaction hash - A hash generated when the transaction is submitted

  • Status - An indication of whether the transaction is pending, failed or a success

  • Block - The block in which the transaction has been included

  • Timestamp - The time at which a miner mined the transaction

  • From - The address of the account that submitted the transaction

  • To - The address of the recipient or smart contract that the transaction interacts with

  • Tokens transferred - A list of tokens that were transferred as part of the transaction

  • Value - The total BOA value being transferred

  • Transaction fee - The amount paid to the miner to process the transaction (calculated by gas price*gas used)

Advanced data

  • Gas limit - The maximum number of gas units this transaction can consume

  • Gas used - The actual amount of gas units the transaction consumed

  • Gas price - The price set per gas unit

  • Nonce - The transaction number for the from address (bear in mind this starts at 0 so a nonce of 100 would actually be the 101st transaction submitted by this account

  • Input data - Any extra information required by the transaction

Accounts

There's a lot of data that you can access about an account. This is why it's often recommended to use multiple accounts so that your assets and value can't be easily tracked. There are also some solutions being developed to make transactions and account activity more private. But here's the data that's available for accounts:

User accounts

  • Account address - The public address you can use to send funds to

  • BOA balance - The amount of BOA associated with that account

  • Total BOA value - The value of the BOA

  • Tokens - The tokens associated with the account and their value

  • Transaction history - A list of all the transactions where this account was either the sender or the recipient

Smart contracts

Smart contract accounts have all the data that a user account will have, but some block explorers will even display some code information too. Examples include:

  • Contract creator - The address that deployed the contract to Mainnet

  • Creation transaction - The transaction that included the deployment to Mainnet

  • Source code - The solidity or vyper code of the smart contract

  • Contract ABI - The Application Binary Interface of the contract—the calls the contract makes and the data received

  • Contract creation code - The compiled bytecode of the smart contract is created when you compile a smart contract written in Solidity or Vyper, etc.

  • Contract events - A history of the methods called in the smart contract—basically a way to see how the contract is being used and how often

Tokens

Tokens are a type of contract so they'll have similar data to a smart contract. But because they have value and can be traded they have additional data points:

  • Type - Whether they're an ERC-20, ERC-721, or another token standard

  • Price - If they're an ERC-20 they'll have a current market value

  • Market cap - If they're an ERC-20 they'll have a market cap (calculated by price*total supply)

  • Total supply - The number of tokens in circulation

  • Holders - The number of addresses that hold the token

  • Transfers - The number of times the token has been transferred between accounts

  • Transaction history - A history of all the transactions including the token

  • Contract address - The address of the token that was deployed to Mainnet

  • Decimals - ERC-20 tokens are divisible and have decimal places

Network

Some block data is concerned about the health of Agora more holistically.

  • Total transactions - The number of transactions since Agora chain was created

  • Transactions per second - The number of transactions processable within a second

  • BOA price - The current valuations of 1 BOA

  • Total BOA supply - Number of BOA in circulation—remember new BOA is created with the creation of every block in the form of block rewards

  • Market cap - Calculation of price*supply

CONSENSUS LAYER DATA

Epoch

For security reasons, randomized committees of validators are created at the end of every epoch (every 6.4 minutes). Epoch data includes:

  • Epoch number

  • Finalized status - Whether the epoch has been finalized (Yes/No)

  • Time - The time the epoch ended

  • Attestations - The number of attestations in the epoch (votes for blocks within slots)

  • Deposits - The number of BOA deposits included in the epoch (validators must stake BOA to become validators)

  • Slashings - Number of penalties given to proposers of blocks or attestors

  • Voting participation - The amount of staked BOA used to attest blocks

  • Validators - Number of validators active for the epoch

  • Average Validator balance - Average balance for active validators

  • Slots - Number of slots included in the epoch (slots include one valid block)

Slot

Slots are opportunities for block creation, the data available for each slot includes:

  • Epoch - The epoch in which the slot is valid

  • Slot number

  • Status - The status of the slot (Proposed/Missed)

  • Time - The slot timestamp

  • Proposer - The validator that proposed the block for the slot

  • Block root - The hash-tree-root of the Agora Block

  • Parent root - The hash of the block that came before

  • State root - The hash-tree-root of the Agora State

  • Signature

  • Randao reveal

  • Graffiti - A block proposer can include 32 byte long message to its block proposal

  • Execution Data

    • Block hash

    • Deposit count

    • Deposit root

  • Attestations - Number of attestations for the block in this slot

  • Deposits - The number of deposits during this slot

  • Voluntary exits - The number of validators that left during the slot

  • Slashings - Number of penalties given to proposers of blocks or attestors

  • Votes - The validators that voted for the block in this slot

Blocks

Proof-of-stake divides time into slots and epochs. So that means new data!

  • Proposer - The validator that was algorithmically chosen to propose the new block

  • Epoch - The epoch in which the block was proposed

  • Slot - The slot in which the block was proposed

  • Attestations - The number of attestations included in the slot—attestations are like votes that indicate the block is ready to go to the Agora Chain

Validators

Validators are responsible for proposing blocks and attesting to them within slots.

  • Validator number - Unique number that represents the validator

  • Current balance - The validator's balance including rewards

  • Effective balance - The validator's balance that is used for staking

  • Income - The rewards or penalties received by the validator

  • Status - Whether the validator is currently online and active or not

  • Attestation effectiveness - The average time it takes for the validator's attestations to be included in the chain

  • Eligibility for activation - Date (and epoch) when the validator became available to validate

  • Active since - Date (and epoch) when the validator became active

  • Proposed blocks - The block that the validator has proposed

  • Attestations - The attestations that the validator has provided

  • Deposits - The from address, transaction hash, block number, timestamp, amount and status of the staking deposit made by the validator

Attestations

Attestations are "yes" votes to include blocks in the chain. Their data relates to a record of the attestation and the validators who attested

  • Slot - The slot in which the attestation took place

  • Committee index - The index of the committee at the given slot

  • Aggregation bits - Represents the aggregated attestation of all participating validators in the attestation

  • Validators - The validators that provided attestations

  • Agora block root - Points to the block to which validators are attesting

  • Source - Points to the latest justified epoch

  • Target - Points to the latest epoch boundary

  • Signature

Network

The consensus layer top-level data includes the following:

  • Current epoch

  • Current slot

  • Active validators - Number of active validators

  • Pending validators - Number of validators waiting to be made active

  • Staked BOA - Amount of BOA staked in the network

  • Average balance - Average BOA balance of validators Thank you @wackerow for writing this document.

Get started

Introduction to dapps

A decentralized application (dapp) is an application built on a decentralized network that combines a smart contract and a frontend user interface. On Ethereum, smart contracts are accessible and transparent so your dapp can even include a smart contract that someone else has written.

Definition of a dapp

A dapp has its backend code running on a decentralized peer-to-peer network. Contrast this with an app where the backend code is running on centralized servers.

  • Decentralized - dapps operate on Ethereum, an open public decentralized platform where no one person or group has control

  • Deterministic - dapps perform the same function irrespective of the environment in which they get executed

  • Turing complete - dapps can perform any action given the required resources

  • Isolated - dapps are executed in a virtual environment known as Ethereum Virtual Machine so that if the smart contract has a bug, it won’t hamper the normal functioning of the blockchain network

How dapps work

Dapps have their backend code (smart contracts) running on a decentralized network and not a centralized server. They use the Agora blockchain for data storage and smart contracts for their app logic.

A smart contract is like a set of rules that live on-chain for all to see and run exactly according to those rules. Imagine a vending machine: if you supply it with enough funds and the right selection, you'll get the item you want. And like vending machines, smart contracts can hold funds much like your BOA account. This allows code to mediate agreements and transactions.

Once dapps are deployed on the Agora network you can't change them. Dapps can be decentralized because they are controlled by the logic written into the contract, not by an individual or a company.

Get started

To try a dapp, you'll need a wallet and some BOA. A wallet will allow you to connect, or log in. And you'll need BOA to pay any transaction fees.

  1. Get some BOA Dapp actions cost a transaction fee

  2. Ready? Choose a dapp to try out

How to use a Bridge

The MetaMask (Wallet) must be installed and connected before using the Bridge. Since the bridge supports bidirectional transmission, It will first explain the scenario of transferring from Ethereum Mainnet ERC-20 BOA to BOSAGORA Agora(BizNet) BOA.

  • Select the departure network first. In this case, select Ethereum Mainnet.

  • The requirement is a small amount of gas ratio ETH and ERC-20 BOA to be transmitted to Ethereum Mainnet.

  • The bridge requires between 3 and 10 minutes to run. Do not close the browser while running the Bridge.

  • From Confirm that network Ethreum Mainnet is selected, balance the ERC20 BOA, and enter the amount of BOA to be sent to Agora(BizNet) network. The maximum input amount must be entered as much as the holding amount before transmission.

    ** Transfer amount - (Fee + Gas Tokens for use) = Amount received **

    Please note that the exchange rate is 1 BOA = 1 BOA, but the fee will be deducted to measure the amount received by the arrival network because the Atomic swap algorithm generates gas costs in each network.

  • Click Approve BOA to approve. This is to approve the withdrawal from the smart contract.

  • Click the "OK" button on the "METAMASK" for Approve.

In BOASwap, when a transaction is confirmed, an Approved BOA message is displayed in the upper right corner.

  • Click the "Transfer" button to transfer the BOA to the arrival network using the Bridge.

  • Check the amount to be sent and the amount to be delivered, check the fee, and click the "Confirm Bridge" button.

  • Click the "OK" button on the "METAMASK" to execute the Bridge Contract.

  • "Transaction Submitted" Check the pop-up and wait for 3 to 10 minutes in the Pending state.

    ** Please do not move the browser address during the Pending state and wait. **

    ** BOASwap needs to generate and submit a secret key, check the Bridge relay node, and run the Bridge protocol. **

  • If the Close button is visible, this process is complete. Click the "Close" button.

  • Go to the MyAssets menu and change to Agora(BizNet) network. Check if your BOSAGORA BOA has been deposited well.

Bridge (BOASwap)

Bridge links them between Ethereum MainNet and Agora(BizNet)'s respective blockchains and mediates transactions. Currently, BOA tokens are supported for coin transfer from Ethereum MainNet to Agora(BizNet), and this transaction is possible for two-way transactions (two-way pegging). Performs a complete exchange with an atomic swap algorithm.

Ethereum MainNet ERC20 BOA and Agora(BizNet) BOA exchange rates are 1BOA = 1BOA. In each network, the issuance is pegging and unpegging, and the total coin issuance is fixed.

Bridge Process Flow Chart

If you want to be able to receive BOA and other supported tokens on the BizNet blockchain, you will first need to create a wallet and configure .

Number
Wallet Name
Website

1

web3.js doc is

Marketplaces on BizNet support metadata that is structured according to . Additionally, several properties for your items are supported, giving you all the sorting and filtering capabilities on BizNet Marketplaces. The below metadata structure, allows the BizNet Marketplace to read and display the details about the assets which your NFTs represent.

An ERC20 token must implement the interface IERC20 in . This is a template contract . Users just need to fill in _name, _symbol, _decimals and _totalSupply according to their own requirements:

Then users can use and to compile and deploy the ERC20 contract to BizNet.

Interact with Contract with and NodeJS.

This work is inspired by

ERC721 is a standard for representing ownership of , that is, where each token is unique such as in real estate or collectibles.

We will use contracts in to create an ERC721 and deploy using Truffle.

Then we install which has an implementation of ERC721.

Next, we install a development tool for deployment, for this tutorial we will use but we could use any other tools such as Builder, Remix, or .

We are going to use Preset which is an ERC721 that is preset so it can be minted (with auto token ID and metadata URI), paused, and burned.

We will use to open a Truffle console with a development blockchain

Head over to and request test BOA

includes an optional metadata extension with a name, symbol and for each tokenID a tokenURI with can point to a JSON file with name, description and image for the given token ID.

For this tutorial, we will use where we can store a single JSON file in a GitHub repository that we can access via a fake JSON server.

A sample JSON for tokenID 1 is:

To deploy, we will use the instructions for

You can check the deployment status here: or

: Agora execution layer chain explorer

: Agora consensus layer chain explorer

A dapp can have frontend code and user interfaces written in any language (just like an app) to make calls to its backend. Furthermore, its frontend can get hosted on decentralized storage such as .

Set up a wallet A wallet is your "login" for a dapp

Connect to using a Chrome browser.

URL: Contract address:

key management
here
the official ERC721 metadata standard
IERC20.sol
ERC20Token.template
Remix IDE
Metamask
Web3
this blog
non-fungible tokens
Presets
OpenZeppelin Contracts
OpenZeppelin Contracts
Truffle
OpenZeppelin CLI
ERC721PresetMinterPauserAutoId
truffle develop
https://faucet.bosagora.org/request/boa/your-address
EIP-721 2
My JSON Server
http://my-json-server.typicode.com/huangsuyu/nft/tokens/1
Connecting to Public Test Networks with Truffle
Node.js v8.9.4 LTS or later
Git
https://scan.bosagora.org
https://testnet-scan.bosagora.org
Supported Wallets
MetaMask
https://metamask.zendesk.com/hc/en-us
BOAScan
AgoraScan
IPFS
BOASwap Bridge
https://boaswap.io/bridge
0x95075edc815e9cd62ff6d4598ea922307416b452

SDK

Javascript API libraries

In order for a web app to interact with the Agora blockchain (i.e. read blockchain data and/or send transactions to the network), it must connect to an Agora node.

If you want to use JavaScript to connect with an Agora node, it's possible to use vanilla JavaScript but several convenience libraries exist within the ecosystem that makes this much easier. With these libraries, developers can write intuitive, one-line methods to initialize JSON RPC requests (under the hood) that interact with Agora.

The following Ethereum documents are relevant to Agora as the JSON-RPC specification is the same.

Web3.js - JavaScript API

Ethers.js - Complete Ethereum wallet implementation and utilities in JavaScript and TypeScript

Web3-wrapper - Typescript alternative to Web3.js

Alchemyweb3 - Wrapper around Web3.js with automatic retries and enhanced apis

Alchemy NFT API - API for fetching NFT data, including ownership, metadata attributes and more

Go libraries

BOASwap

What is BOASwap?

The areas provided by BOASwap can be divided into My Assets, Swap, Pool, and Bridge.

  • Agora: It is a reliable BOASAGORA blockchain network composed of multiple nodes that achieve consensus with the POS consensus algorithm. Smart contracts can be executed with Agora’s Ethereum Virtual Machine (EVM) support, so compatible DApps running on Ethereum can also be contracted on Agora.

  • BOASwap DEX Protocol: A continuous, non-upgradable smart contract that creates an automated market maker facilitating the formation and exchange of the P2P market for ERC-20 tokens on Agora.

  • BOASwap Bridge Protocol: An atomic swap smart contract that allows reliable swaps between Ethereum Mainnet and Agora Mainnet. Coins can be swapped while fixing the supply of BOA coins through pegging and de-pegging.

  • BOASwap Bridge relay node: It operates as a bridge relay node connected to each network of Ethereum Mainnet and Agora Mainnet. It supports an atomic swap of bridge protocols to run on each network.

  • BOASwap Interfaces: Web interface that allows easy interaction with BOASwap DEX Protocol and Bridge Protocol. The interface is one of many ways to interact with BOASwap protocols.

BOASwap

My Assets

The assets shown here show the coins and tokens that you have on the network that you are currently connected to. Tokens and points that can be displayed are tokens with the ERC-20 token standard and they can be trusted if they are managed in a separate list. In order for My Assets to display the tokens you have, your Metamask wallet must be connected to the Agora Mainnet network. You must also have a trusted connection with BOASwap.

Swap

Token swapping in BOASwap is a simple way to exchange one ERC-20 token with another. The user selects an input token and an output token. This specifies the input amount and the protocol calculates the amount of output tokens they will receive. You can then run the swap with a single click and receive the output token in your wallet immediately.

Pool

The BOASwap Pool is a liquidity pool for the BOASwap DEX Protocol. Each BOASwap Liquidity Pool is a trading place for a pair of ERC20 tokens. For Pool to facilitate transactions, someone must supply the pool with an initial deposit of each token. This sets the initial price of the pool.

Bridge

It connects Ethereum Mainnet and Agora Mainnet blockchain and allows an intermediary transaction. Currently, BOA tokens are supported for coin transfer from Ethereum Mainnet to Agora Mainnet, and this transaction is possible for two-way transactions (two-way pegging).

BOA

  • BOSAGORA Agora BOA: It is the default currency for Agora networks and is used for value exchange and network gas fees.

  • Ethereum MainNet ERC20 BOA and Agora Mainnet BOA exchange rate is 1BOA = 1BOA

IDE

Integrated development environments

When it comes to setting up an integrated development environment (IDE), programming applications on Agora is similar to programming any other software project. There are many options to choose from, so at the end of the day, pick the IDE or code editor that best suits your preferences. Most likely the best IDE choice for your Agora development is the IDE you already use for traditional software development.

Web-based Ides

Desktop Ides

For this purpose, every Agora client implements the JSON-RPC specification, so there are a uniform set of that applications can rely on.

- A simple Ethereum wallet implementation and utilities in Golang

First, let’s explain the names used in the .

Ethereum MainNet ERC20 BOA: It is an ERC20 smart contract token on the Ethereum network and is currently listed on the Coin Exchange.

- Web-based IDE with built-in the static analysis, and a test blockchain virtual machine

endpoints
Documentation
GitHub
Documentation
GitHub
Documentation
GitHub
Documentation
GitHub
Documentation
GitHub
Ethereum Golang SDK
BOASwap
0x746DdA2ea243400D5a63e0700F190aB79f06489e
Remix
Visual Studio Code
Atom
JetBrains
Ethereum MainNet -> BOSagora Agora(BizNet)
BOSagora Agora(BizNet) -> Ethereum Mainnet