https://pypi.org/project/diem/
>>>fromdiem.jsonrpcimportAsyncClient>>>fromdiem.testingimportJSON_RPC_URL>>>importasyncio>>>>>>asyncdefmain():
... client=AsyncClient(JSON_RPC_URL)
... print(awaitclient.get_metadata())
...
>>>asyncio.run(main())
version: 3300304timestamp: 1601492912847973chain_id: 2
......You can find more examples under the examples directory:
For building a wallet application, see MiniWallet Application for example.
Checkout MiniWallet implementation for off-chain service implementation example.
See mini_wallet.md
make init
make test
run specific test:
make test t=<test file / test name match pattern>
run with local docker testnet (requires initializing diem submodule):
make test t=<test file / test name match pattern> dt=1
git submodule update --init diem
cd diem
git pull origin main
cd ..
make gen
SPEC = specification
DIP-X = Diem Improvement Protocol
Root module name: diem
Sub-modules:
jsonrpc: diem JSON-RPC APIs client and API response types. SPECstdlib: generated code, move stdlib script utils for constructing transaction script playload.diem_types: generated code, Diem on-chain data structure types for encoding and decoding BCS data.utils: utility functions, account address utils, currency code, hashing, hex encoding / decoding, transaction utils.AuthKey|auth_key: auth key utilsidentifier: Diem Account Identifier and Diem Intent Identifier. DIP-5txnmetadata: utils for creating peer to peer transaction metadata. DIP-4testnet: Testnet utility, minting coins, create Testnet client, chain id, Testnet JSON-RPC URL.testing: Testing utility, MiniWallet application, MiniWallet test suites,LocalAccountfor managing local account keys and generating random local account.chain_ids: list of static chain ids