Development and test network of SEER traffic crowdfunding module and release of use documents

Time:2020-1-25

Seer uses the blockchain reward mechanism to solve the pain points of traditional sports events and improve the operation efficiency of the industry. For example, improve the revenue of the event side, let the audience freely choose the game they want to watch, give the participants of the event crowdfunding influence, and make them get the incentive quantified by the smart contract. This function can be widely used in a variety of scenes in the sports industry, including but not limited to performances, events, etc.

Only asset issuers can create new crowdfunding. In SEER developer’s Web wallet, you can see the “crowdfunding list” button in the asset function on the asset page of the asset issuer, and enter to view the existing crowdfunding list of the current user or create a new crowdfunding.

When creating crowdfunding, you can set the start and end time of crowdfunding, agents, etc. The original intention of the agent’s design is for security reasons. The asset owner’s account / DAPP official account can’t be online for a long time. After the crowdfunding is created, the agent will exercise the follow-up power. At the same time, the agent can also act as a faucet to promote and register the account.

When creating crowdfunding, you also need to set the name of various incentives and the number of each incentive. For example, 10abc will be awarded for each assistance, and 5abc will be awarded for friend assistance.

When creating crowdfunding, you need to add beneficiary roles, such as cooperative media, stars, and sponsors. When creating these roles, you need to set the allocation proportion of the fund pool after crowdfunding is successful, and you can separately set the locking methods and locking days for each role, such as linear unlocking, non locking, and expiration unlocking.

When crowdfunding is in progress, it needs to be used in conjunction with the corresponding front-end programs and activity programs. The main solution in the chain is to add, destroy, distribute and lock the assets raised through smart contracts. In the step of user contribution traffic, a specific activity program is required to provide data to the blockchain, and the creator or agent authority will inject new assets into the crowdfunding according to the activity data.

For example, in a certain period of an activity, 10000 people log in with wechat authorization to assist. In addition, these users generate 5000 person times of data about inviting friends to assist. According to the setting of 10abc and 5abc for each assistance reward, a total of 10000 people are injected into the fund pool in this period 10 + 5000 5 = 125000 ABC. At the same time, another 150 users donated or rewarded 50000 ABC by participating in crowdfunding. The assets available for each beneficiary in this cycle are 175000 ABC. These assets will be distributed according to the pre-set proportion after the success of the activity. In case of failure, the donation will be returned to the user. According to the activity data, the initiator can give various reputation rewards, ranging from naming, advertising exposure, to the surrounding of star signature, according to the user’s donation and assistance contribution or ranking.

If you have any questions, please join us at the developer forum: https://forum.seerchain.org/t

Experience flow

Developers can first download the configuration command line wallet locally and connect to this test network. Import the private key of the test account tester, generate multiple key pairs, and register multiple test accounts. Use tester to transfer the seer tested to the self registered account, and then use the self registered account to create assets, then create crowdfunding and open crowdfunding. Then use the created multiple other accounts to donate assets to the self created crowdfunding, use the proxy account or crowdfunding initiation account to simulate the value of traffic for additional issuance, enter the results of crowdfunding success or failure after the expiration of crowdfunding, and use the beneficiary account set at the time of creation or update to collect income.

Interface specification

The flow crowdfunding module needs to be used in conjunction with the original asset distribution and destruction functions in the chain, mainly including six new interfaces: competition [create], competition [update], competition [participation], competition [input], competition [claim] and competition [result]. Among them, it is more complex to create crowdfunding competition, update crowdfunding competition update parameters, collect competition claim together with revenue, input result competition result, and generally use web wallet operation.

The following describes the participation in crowdfunding competition and the injection of new assets competition input interface.

competition_participate

Format: competition_participant (string account, competition_id_type competition, asset amount, bool broadcast = false);

Parameters: Account: initiator, competition: crowdfunding ID, amount: amount involved (with precision), asset type, broadcast: broadcast or not;

Role: ordinary users participate in crowdfunding (donate assets to the crowdfunding pool).

Command line wallet example: competition_participation 1.2.13 1.18.7 {“amount”: 10000000, “asset_id”: “1.3.3”} true

RPC example:{"jsonrpc": "2.0", "method": "competition_participate", "params": ["1.2.13","1.18.7",{"amount":10000000,"asset_id":"1.3.3"},true], "id": 1}

Parameter description (RPC form):

{

    "jsonrpc": "2.0",

    "method": "competition_participate",

    "params": [

      "1.2.13", // initiator

        "1.18.7", {// crowdfunding ID

            "Amount": 10000000, // amount of participation

            "Asset" Id ":" 1.3.3 "// asset type

        },

        true

    ],

    "id": 1

}

Example of return information:

{

    "id": 1,

    "jsonrpc": "2.0",

    "result": {

        "ref_block_num": 3404,

        "ref_block_prefix": 135777280,

        "expiration": "2019-10-16T15:32:36",

        "operations": [

            [65, {

                "Fee": {// handling fee

                    "amount": 500000,

                    "asset_id": "1.3.0"

                },

                "Issuer": "1.2.13", // initiator

                "Competition": "1.18.7", // crowdfunding ID

                "amount": {

                    "Amount": 10000000, // amount of participation

                    "Asset" Id ":" 1.3.3 "// asset type

                }

            }]

        ],

        "extensions": [],

        "signatures": ["2071d05......2e491"]

    }

}

competition_input

Format: competition’input (string account, competition’id’type competition, map < uint8’t, uint32’t > input, bool broadcast = false);

Parameters: Account: initiator, competition: crowdfunding ID, input: new amount of each incentive, broadcast: broadcast or not;

Function: because users have contributed attention, new assets are issued and injected into the public fund-raising pool

Example of command line Wallet: competition_input 1.2.13 1.18.7 [[0100], [1, 200]] true

RPC example:{"jsonrpc": "2.0", "method": "competition_input", "params": ["1.2.13","1.18.7",[[0,100],[1, 200]],true], "id": 1}

Parameter description (RPC form):

{

    "jsonrpc": "2.0",

    "method": "competition_input",

    "params": [

        "1.2.13", // initiator

         "1.18.7", // crowdfunding ID

         [

            [0, 100], // new amount of the first incentive

            [1, 200] // new amount of the second incentive

        ], 

        true],

    "id": 1

}

Example of return information:

{

    "id": 1,

    "jsonrpc": "2.0",

    "result": {

        "ref_block_num": 3370,

        "ref_block_prefix": 1021658047,

        "expiration": "2019-10-16T15:30:54",

        "operations": [

            [66, {

                "Fee": {// handling fee

                    "amount": 500000,

                    "asset_id": "1.3.0"

                },

                "Issuer": "1.2.13", // initiator

                "Competition": "1.18.7", // crowdfunding ID

                "input": [

                    [0, 100], // new amount of the first incentive

                    [1, 200] // new amount of the second incentive

                ]

            }]

        ],

        "extensions": [],

        "signatures": ["2054f3......f765c15"]

    }

}

Seer development test network

At present, in the development of SEER traffic crowdfunding module, the developer has set up a test network, and the node API is as follows: ws://192.144.171.138:8003

To use the test web wallet http://192.144.171.138, you need to add and switch to the API above.

Test network account: tester

Private key: 5hxsqrcnu6nz5xalk9f6rtvkghjsvgzejz8cnc8e3qnpc14ludp

win wallet:https://cdn.jsdelivr.net/gh/a…

This test network may be destroyed or reset at any time. Please do not save important data.

Novice guide

Considering that some of our partners are in contact with SEER for the first time, let’s make up a lesson from the beginning, how to use the developer’s network wallet and command-line wallet. Here, the command-line wallet takes windows as an example.

First, download the wallet https://cdn.jsdelivr.net/gh/a

After decompression, create a new text document, and inputcli_wallet.exe -s ws://192.144.171.138:8003 -r 127.0.0.1:9991 -H 127.0.0.1:9992, save as run.cmd, and click run.cmd.

After a successful run, the new > >

  1. inputset_password 123Set wallet password;

https://docs.seerchain.org/#/…

  1. inputunlock 123Unlock wallet;

Remember to unlock every time you see locked > >

https://docs.seerchain.org/#/…

  1. inputimport_key tester 5HxSqrcNu6nZ5xaLK9f6RTVKghJsVGZejz8CnC8e3qnPc14LUdPImport the private key of the test account;

https://docs.seerchain.org/#/…

  1. inputsuggest_brain_keyGenerate several pairs of secret key pairs and copy them;

https://docs.seerchain.org/#/…

  1. Replace the public key in the template with the public key (a string of alphanumeric characters beginning with SEER) in the generated secret key pairSEER......yVgnQ, modify the new account user name in the templatenameInputregister_account name SEER4xBLW....yVgnQ SEER4....yVgnQ tester tester 20 true, register account, multiple accounts are registered for many times;

https://docs.seerchain.org/#/…

  1. inputtransfer tester name 1000000 SEER "" trueTransfer 1 million SEER test currency for the account name you created (to be replaced), multiple accounts transfer multiple times;

https://docs.seerchain.org/#/…

  1. inputimport_key name 5Kb1...RciImport the private key of the test account you just registered. Multiple accounts are imported multiple times;
  2. Add the API server node ws://192.144.171.138:8003 in the http://192.144.171.138 settings access point of the test web wallet and switch;
  3. Settings – recover / import – Import private key, paste5HxSqrcNu6nZ5xaLK9f6RTVKghJsVGZejz8CnC8e3qnPc14LUdPSubmit, you can import the test account tester, of course, you can also import other accounts created by yourself;
  4. Menu – Asset page create an asset, fill in the asset code and create an asset;
  5. Click the “crowdfunding list” button behind the newly created asset to enter the list page and create crowdfunding. Add various parameters according to the prompts on the creation page;
  6. After creation, open crowdfunding. After opening crowdfunding, you can input and participate in operations in the web wallet. However, because these operations need program control in actual operation, command-line wallet and RPC interface are used to simulate operations;
  7. Input in command line Walletcompetition_participate 1.2.N 1.18.N {"amount":N,"asset_id":"1.3.N"} trueParticipate in crowdfunding (donation reward), refer to the above documents for detailed parameter description;
  8. inputcompetition_input 1.2.N 1.18.N [[0,100],[1, 200]] trueInput the new quantity of each incentive item to the public financing pool, inject new assets, and refer to the above documents for detailed parameter description.

The object ID of the user name can be accessed through theget_account_id nameQuery.

https://docs.seerchain.org/#/…

Recommended Today

RCAST 35: add type to currency

– font ALT: Simsun; MSO font charset: 134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} @font-face {font-family:”Cambria Math”; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; Variable; Ose-1: 216301111; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} /\* Style […]