Environment

Local Environment

If you need to deploy a canister locally, you can follow these steps:

  1. Install dfinity SDK

    on Ubuntu system (version 20.04) or Mac system, it is recommended to switch to root user and execute the following commands

    sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
    
    # check
    dfx  --version
    
  2. Create a demo project (type = rust)

    • Create a demo project

      dfx new --type=rust demo
      
    • Start dfx environment

      dfx start --clean --background
      
    • Start project

      dfx deploy 
      
  3. Start the project with the compiled wasm package

    If there is only a compiled wasm package and no source code, you can use the following steps for local deployment:

    • Create a demo project

      dfx new --type=rust demo
      
    • Put the wasm package and did file in the project, the path is ./path/demo.wasm./{path}/demo.wasm ./{path}/demo.did, where ${path} is the directory where it is placed

    • Find the dfx.json file in the project root directory, modify wasm and did, and keep the same path as the previous step

       "canisters": {
           "demo": {
               "type": "custom",
               "wasm": "./${path}/demo.wasm",
               "candid": "./${path}/demo.did"
           }
       }
      
    • Start dfx environment

      dfx start --clean --background
      
    • Start project

      dfx deploy 
      
  4. Call a method on the console

    dfx canister call   canister_name method_name [argument] 
    

Test Environment

In order to facilitate developers to test, we also provide a test environment , and developers can directly call our test environment for interface access.

service name canisterId remark
Social Graph psgwm-maaaa-aaaal-qac2q-cai
  1. Call a method on the console:
    dfx canister --network ic call  psgwm-maaaa-aaaal-qac2q-cai   method_name [argument] 
    
Last Updated: 4/5/2022, 7:45:44 PM